Skip to content

Commit b474aa5

Browse files
dasagithub-actions[bot]andygup
authored
fix(esbuild): remove extra css files created in build output (#594)
Co-authored-by: Dasa Paddock <dpaddock@esri.com> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: Andy G. <agup@esri.com>
1 parent 32d8835 commit b474aa5

34 files changed

+11
-9
lines changed

core-samples/.metrics/4.34.0.csv

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Sample,Build size (MB),Build file count,Main bundle file,Main bundle size (MB),Main bundle gzipped size (MB),Main bundle brotli compressed size (MB),Load time (ms),Total runtime (ms),Loaded size (MB),Total JS requests,Total JS size (MB),Total HTTP requests,JS heap size (MB)
2-
esbuild 0.25.0,22.91,1526,index.js,0.30,0.08,0.07,9990,23786,5.60,515,4.00,612,32.24
3-
Angular 20.3.3,13.75,1244,chunk-QVKBXHBS.js,1.09,0.27,0.22,9381,23207,5.73,517,4.15,614,34.66
4-
React 19.2.0,12.70,704,index-Cv-cEcH6.js,1.72,0.50,0.40,9395,23132,5.69,204,4.10,299,34.59
5-
Vue 3.5.22,12.57,703,index-dQOoJ2Ut.js,1.59,0.46,0.37,8890,22384,5.57,204,3.97,301,34.10
6-
Rollup 4.52.4,12.35,703,main.js,1.51,0.42,0.33,8178,22007,5.41,204,3.84,300,31.00
7-
Webpack 5.102.0,15.52,496,index.js,1.62,0.47,0.36,9018,22485,6.02,71,4.42,168,35.49
2+
esbuild 0.25.0,13.49,1239,index.js,0.30,0.08,0.07,9244,23015,5.60,515,4.00,612,35.67
3+
Angular 20.3.3,13.75,1244,chunk-QVKBXHBS.js,1.09,0.27,0.22,9408,23189,5.73,517,4.15,614,37.51
4+
React 19.2.0,12.70,704,index-jiQ-nvh9.js,1.72,0.50,0.40,9110,22843,5.70,204,4.10,301,35.09
5+
Vue 3.5.22,12.57,703,index-YOWEJfKb.js,1.59,0.46,0.37,8731,22530,5.57,204,3.97,301,27.05
6+
Rollup 4.52.4,12.35,703,main.js,1.51,0.42,0.33,8592,22390,5.41,204,3.84,300,35.35
7+
Webpack 5.102.0,15.52,496,index.js,1.62,0.47,0.36,10030,23723,6.02,71,4.42,168,35.92

core-samples/esbuild/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ This sample demonstrates how to use the [`@arcgis/core`](https://www.npmjs.com/p
77
## Known issues
88

99
- This sample uses esbuild code splitting which outputs a large number of on-disk files. For best performance use [HTTP/2](https://developer.mozilla.org/en-US/docs/Glossary/HTTP_2) or [HTTP/3](https://developer.mozilla.org/en-US/docs/Glossary/HTTP_3) for production environments. For more information: https://esbuild.github.io/api/#splitting.
10+
- This sample includes a workaround for a known esbuild bug that duplicates CSS: https://github.com/evanw/esbuild/issues/3529. The bug causes the Calcite Components CSS to be duplicated, which increases the size of on-disk build output by up to 10MB, as well as adds approximately 275 additional CSS files. The workaround uses the `postbuild` script included in the package.json file to delete the duplicate files.
1011

1112
## Get Started
1213

core-samples/esbuild/package.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,16 @@
66
"scripts": {
77
"init-dist": "del-cli dist && cpx \"public/**\" dist",
88
"build": "npm run init-dist && esbuild src/index.js --bundle --chunk-names=chunks/[name]-[hash] --format=esm --log-override:empty-glob=debug --splitting --outdir=dist --minify",
9-
"start": "npm run init-dist && esbuild src/* --bundle --chunk-names=chunks/[name]-[hash] --format=esm --log-override:empty-glob=debug --splitting --outdir=dist --sourcemap --servedir=dist",
10-
"watch": "npm run init-dist && esbuild src/* --bundle --chunk-names=chunks/[name]-[hash] --format=esm --log-override:empty-glob=debug --splitting --outdir=dist --sourcemap --watch"
9+
"postbuild": "del-cli \"dist/chunks/*.css\"",
10+
"start": "npm run init-dist && esbuild src/index.js --bundle --chunk-names=chunks/[name]-[hash] --format=esm --log-override:empty-glob=debug --splitting --outdir=dist --sourcemap --servedir=dist",
11+
"watch": "npm run init-dist && esbuild src/index.js --bundle --chunk-names=chunks/[name]-[hash] --format=esm --log-override:empty-glob=debug --splitting --outdir=dist --sourcemap --watch"
1112
},
1213
"dependencies": {
1314
"@arcgis/core": "~4.34.0"
1415
},
1516
"devDependencies": {
1617
"cpx2": "^8.0.0",
17-
"del-cli": "^6.0.0",
18+
"del-cli": "^7.0.0",
1819
"esbuild": "^0.25.0"
1920
}
2021
}
0 Bytes
Binary file not shown.
0 Bytes
Binary file not shown.

zips/coding-components-angular.zip

0 Bytes
Binary file not shown.

zips/coding-components-react.zip

0 Bytes
Binary file not shown.

zips/coding-components-vite.zip

0 Bytes
Binary file not shown.

zips/components-oauth.zip

0 Bytes
Binary file not shown.
0 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)