@@ -24,117 +24,120 @@ import bundleStatsPlugin, { DEFAULT_GROUPING } from './src';
2424 * nx code-pushup:minimal-angular plugin-bundle-stats
2525 */
2626
27- const GROUPING_PACKAGES = [
28- {
29- title : 'Payment' ,
30- patterns : [ '**/payments/**/*' ] ,
31- icon : '🚀' ,
32- } ,
33- {
34- title : 'Loaders Library' ,
35- patterns : [ '**/loaders-lib/**/*' ] ,
36- icon : '🔄' ,
37- } ,
38- {
39- title : 'Sports Platform' ,
40- patterns : [ '**/sports/**/*' ] ,
41- icon : '⚽' ,
42- } ,
43- {
44- title : 'Host App' ,
45- patterns : [ '**/host-app/**/*' ] ,
46- icon : '🏠' ,
47- } ,
48- {
49- title : 'Casino' ,
50- patterns : [ '**/casino/**/*' ] ,
51- icon : '🎰' ,
52- } ,
53- {
54- title : 'Oxygen Framework' ,
55- patterns : [ '**/oxygen/**/*' ] ,
56- icon : '🔧' ,
57- } ,
58- ] ;
59-
60- const GROUPING_ANGULAR_BLOCKS = [
61- {
62- title : 'Components' ,
63- patterns : [ '**/*.component.ts' ] ,
64- icon : '🅰️' ,
65- } ,
66- {
67- title : 'Directives' ,
68- patterns : [ '**/*.directive.ts' ] ,
69- icon : '🅰️' ,
70- } ,
71- {
72- title : 'Pipes' ,
73- patterns : [ '**/*.pipe.ts' ] ,
74- icon : '🅰️' ,
75- } ,
76- {
77- title : 'Modules' ,
78- patterns : [ '**/*.module.ts' ] ,
79- icon : '🅰️' ,
80- } ,
81- {
82- title : 'Guards' ,
83- patterns : [ '**/*.guard.ts' ] ,
84- icon : '🅰️' ,
85- } ,
86- {
87- title : 'Resolvers' ,
88- patterns : [ '**/*.resolver.ts' ] ,
89- icon : '🅰️' ,
90- } ,
91- {
92- title : 'Interceptors' ,
93- patterns : [ '**/*.interceptor.ts' ] ,
94- icon : '🅰️' ,
95- } ,
96- {
97- title : 'Providers' ,
98- patterns : [ '**/*.provider.ts' ] ,
99- icon : '🅰️' ,
100- } ,
101- {
102- title : 'Services' ,
103- patterns : [ '**/*.service.ts' ] ,
104- icon : '🅰️' ,
105- } ,
27+ const groups = [
28+ { title : 'Payments Package' , patterns : [ '**/packages/payments/**' ] , icon : '💳' } ,
29+ { title : 'Casino Package' , patterns : [ '**/packages/casino/**' ] , icon : '🎰' } ,
30+ { title : 'Bingo Package' , patterns : [ '**/packages/bingo/**' ] , icon : '🎯' } ,
31+ { title : 'Sports Package' , patterns : [ '**/packages/sports/**' ] , icon : '⚽' } ,
32+ { title : 'Poker Package' , patterns : [ '**/packages/poker/**' ] , icon : '🃏' } ,
33+ { title : 'Lottery Package' , patterns : [ '**/packages/lottery/**' ] , icon : '🎲' } ,
34+ { title : 'Horse Racing Package' , patterns : [ '**/packages/horseracing/**' ] , icon : '🐎' } ,
35+ { title : 'Oxygen Package' , patterns : [ '**/packages/oxygen/**' ] , icon : '🫧' } ,
36+ { title : 'Engagement Package' , patterns : [ '**/packages/engagement/**' ] , icon : '🎯' } ,
37+ { title : 'My Account Package' , patterns : [ '**/packages/myaccount/**' ] , icon : '👤' } ,
38+ { title : 'Design System Package' , patterns : [ '**/packages/design-system/**' ] , icon : '🎨' } ,
39+ { title : 'Global Search Package' , patterns : [ '**/packages/global-search/**' ] , icon : '🔍' } ,
40+ { title : 'Gantry Package' , patterns : [ '**/packages/gantry/**' ] , icon : '🏗️' } ,
41+ { title : 'Vanilla Package' , patterns : [ '**/packages/vanilla/**' ] , icon : '🍦' } ,
42+ { title : 'Promo Package' , patterns : [ '**/packages/promo/**' ] , icon : '🎁' } ,
43+ { title : 'Moka Bingo Package' , patterns : [ '**/packages/mokabingo/**' ] , icon : '🎯' } ,
44+ { title : 'Host App Package' , patterns : [ '**/packages/host-app/**' ] , icon : '🏠' } ,
45+ { title : 'Test Web App Package' , patterns : [ '**/packages/testweb-app/**' ] , icon : '🧪' } ,
46+ { title : 'Theme Park Package' , patterns : [ '**/packages/themepark/**' ] , icon : '🎢' } ,
47+ { title : 'Rewards Hub Package' , patterns : [ '**/packages/rewards-hub/**' ] , icon : '🏆' } ,
48+ { title : 'Reporting Package' , patterns : [ '**/packages/reporting/**' ] , icon : '📊' } ,
49+ { title : 'Migration Kit Package' , patterns : [ '**/packages/migration-kit/**' ] , icon : '🔄' } ,
50+ { title : 'Loaders Lib Package' , patterns : [ '**/packages/loaders-lib/**' ] , icon : '📦' } ,
51+ { title : 'GitLab Data Access Package' , patterns : [ '**/packages/gitlab-data-access/**' ] , icon : '🔗' } ,
52+ { title : 'Geo Coordinator Lib Package' , patterns : [ '**/packages/geo-coordinator-lib/**' ] , icon : '🌍' } ,
53+ { title : 'ESBuild Plugins Package' , patterns : [ '**/packages/esbuild-plugins/**' ] , icon : '🔌' } ,
54+ { title : 'ESLint Utils Package' , patterns : [ '**/packages/eslint-utils/**' ] , icon : '🔧' } ,
55+ { title : 'Extractor App Package' , patterns : [ '**/packages/extractor-app/**' ] , icon : '📤' } ,
56+ { title : 'Gantry App Package' , patterns : [ '**/packages/gantry-app/**' ] , icon : '🏗️' } ,
57+ { title : 'Moxxi Test Utils Package' , patterns : [ '**/packages/moxxi-test-utils/**' ] , icon : '🧪' } ,
58+ { title : 'NX Plugin Package' , patterns : [ '**/packages/nx-plugin/**' ] , icon : '⚙️' } ,
59+ { title : 'RTMS Test App Package' , patterns : [ '**/packages/rtms-test-app/**' ] , icon : '🧪' } ,
60+ { title : 'SFAPI Smoke Test Package' , patterns : [ '**/packages/sfapi-smoke-test/**' ] , icon : '💨' } ,
61+ { title : 'Device Atlas Smoke Test Package' , patterns : [ '**/packages/device-atlas-smoke-test/**' ] , icon : '📱' } ,
62+ { title : 'Zendesk Webchat Feature Package' , patterns : [ '**/packages/zendesk-webchat-feature/**' ] , icon : '💬' } ,
63+ { title : 'Dev Kit Package' , patterns : [ '**/packages/dev-kit/**' ] , icon : '🛠️' } ,
64+ { title : 'E2E Test Framework Package' , patterns : [ '**/packages/e2e-test-framework/**' ] , icon : '🧪' } ,
65+ { title : 'Node Modules' , patterns : [ '**/node_modules/**' ] , icon : '📦' } ,
10666] ;
10767
10868const config = {
10969 plugins : [
11070 await bundleStatsPlugin ( {
71+ bundler : 'esbuild' ,
11172 artefactsPath :
112- './packages/plugin-bundle-stats/mocks/fixtures/stats/ angular-large. stats.json' ,
73+ './packages/plugin-bundle-stats/mocks/fixtures/angular-large/dist/ angular-large/ stats.json' ,
11374 audits : [
11475 {
115- title : 'Initial Bundles ' ,
76+ title : 'all ' ,
11677 selection : {
117- includeOutputs : [
118- '**/main*.js' ,
119- '**/polyfills*.js' ,
120- '**/runtime*.js' ,
121- ] ,
78+ includeOutputs : [ '**/*' ] ,
79+ excludeOutputs : [ '**/*.map' ] , // Only exclude source maps as they're not part of runtime bundle
12280 } ,
12381 scoring : {
124- totalSize : 100_000 ,
125- } ,
126- artefactTree : {
127- groups : GROUPING_PACKAGES ,
82+ // Main bundle size threshold - warn when total exceeds 80MB
83+ totalSize : 80000000 , // 80MB in bytes
84+ penalty : {
85+ // Penalty for individual files that are too large
86+ // This highlights large files without hiding them
87+ artefactSize : [ 0 , 3000000 ] , // 0-3MB range - penalty for files > 3MB
88+
89+ // NO BLACKLIST - we want to see everything, especially problematic files
90+ blacklist : [ ] ,
91+ } ,
12892 } ,
12993 insights : [
130- ...GROUPING_PACKAGES ,
131- ...GROUPING_ANGULAR_BLOCKS ,
94+ // 🚨 CRITICAL: Files that shouldn't be in production - these are important findings!
13295 {
133- title : 'Node Modules' ,
134- patterns : [ '**/node_modules/**/*' ] ,
135- icon : '📚' ,
96+ title : '🚨 Test Files in Production' ,
97+ patterns : [
98+ '**/node_modules/**/*.test.js' ,
99+ '**/node_modules/**/*.spec.js' ,
100+ '**/node_modules/**/test/**' ,
101+ '**/node_modules/**/tests/**' ,
102+ '**/node_modules/**/__tests__/**' ,
103+ ] ,
104+ icon : '⚠️' ,
136105 } ,
106+ {
107+ title : '📚 Documentation in Bundle' ,
108+ patterns : [
109+ '**/node_modules/**/demo/**' ,
110+ '**/node_modules/**/examples/**' ,
111+ '**/node_modules/**/docs/**' ,
112+ '**/node_modules/**/*.md' ,
113+ '**/node_modules/**/README*' ,
114+ '**/node_modules/**/CHANGELOG*' ,
115+ '**/node_modules/**/LICENSE*' ,
116+ ] ,
117+ icon : '📄' ,
118+ } ,
119+ {
120+ title : '🛠️ Dev Tools in Production' ,
121+ patterns : [
122+ '**/node_modules/**/webpack.config.js' ,
123+ '**/node_modules/**/rollup.config.js' ,
124+ '**/node_modules/**/jest.config.js' ,
125+ '**/node_modules/**/.eslintrc*' ,
126+ '**/node_modules/**/.babelrc*' ,
127+ '**/node_modules/**/tsconfig*.json' ,
128+ ] ,
129+ icon : '🔧' ,
130+ } ,
131+ ...groups ,
137132 ] ,
133+ artefactTree : {
134+ groups : [ ...groups ] ,
135+ pruning : {
136+ maxChildren : 20 ,
137+ maxDepth : 3 ,
138+ minSize : 50_000 ,
139+ } ,
140+ } ,
138141 } ,
139142 ] ,
140143 } ) ,
0 commit comments