this project which only includes React and react-intl results in following builds:
normal build (no --experimental-scope-hoisting)
$ yarn build
yarn run v1.9.4
warning package.json: No license field
$ parcel build index.html
โ Built in 32.81s.
dist\src.0a4b8332.map โผ 2.29 MB 337ms
dist\src.0a4b8332.js โผ 1.14 MB 13.68s
dist\index.html 159 B 18.58s
Done in 42.11s.
build with --experimental-scope-hoisting
$ yarn build --experimental-scope-hoisting
yarn run v1.9.4
warning package.json: No license field
$ parcel build index.html --experimental-scope-hoisting
โ Built in 32.43s.
dist\src.3fbcb662.js โผ 1.32 MB 20.95s
dist\index.html 159 B 16.61s
Done in 37.49s.
With CRA the file size after gzip is 47kb (157kb non-gzipped)
The bundle should get smaller.
Getting bigger.
| Software | Version(s) |
| ---------------- | ---------- |
| Parcel | 1.9.7
| Node | 8.11.3
| npm/Yarn | 5.6.0 / 1.9.4
| Operating System | Win10
Do you this still have this issue?
yup: I updated the dependencies (https://codesandbox.io/s/4zr09pqzo0), downloaded the sandbox-project and built it locally:
without --experimental-scope-hoisting

with --experimental-scope-hoisting

Why are your JS bundles (both) so large? On macOS:
$ parcel build index.html
โจ Built in 14.37s.
dist/src.e4004e4c.map 404.38 KB 166ms
dist/src.32972fef.js 160.19 KB 13.29s
dist/index.html 159 B 875ms
$ parcel build index.html --experimental-scope-hoisting
โจ Built in 18.14s.
dist/src.482df5c1.js 155.01 KB 17.07s
dist/index.html 159 B 3.96s
Oha, then it's the operating system? I use Windows 10.
Otherwise, as I said, I have done nothing else than:
yarn installyarn buildIf it works correctly for other Windows users (can anyone confirm that?), I unfortunately have no idea why.
Oha, then it's the operating system? I use Windows 10.
Can confirm, that this happens on Windows 10 and not on macOS.
Interestingly, the tree shaking test suite is currently disabled on Windows...
I'm not completely sure why, but https://github.com/parcel-bundler/parcel/pull/2445 fixed your issue (December 24th, 2018). So it will be fixed in the next release
Interestingly, the tree shaking test suite is currently disabled on Windows...
This has nothing to do with this.