New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
React app not working with tree shaking enabled #2859
Comments
The first problem here is that console.log("Coucou depuis tsx!"); {
"sideEffects": false
} produces an empty bundle. But this is actually somewhat correct: https://github.com/stereobooster/package.json#sideeffects
As you've already said: with that line is removed, |
Ok, now i better understand the benefits (and in my case irrelevance) of the sideEffects flag. But that does not solve my rendering problem :-/. And with --no-minify, the final bundle size is... Bigger ^^ |
Yes, that wasn't a workaround, just a finding. Digging deeper:
Prepending
I'm guessing we rename a variable even though the name is already used. |
Should be fixed in Parcel 2 |
馃悰 bug report
If i try to enable tree shaking (with
--experimental-scope-hoisting
)when building my typescript react project, nothing is displayed any more. And no error message either in build time nor in run time. Without the--experimental-scope-hoisting
option, everything works well and my apps runs properly. It works as expected in development mode of course.馃帥 Configuration
.babelrc
:package.json
: package.jsontsconfig.json
:index.jsx :
馃 Expected Behavior
A typescript react app built with
--experimental-scope-hoisting
option runs the same way as a normal build馃槸 Current Behavior
The app with
--experimental-scope-hoisting
and"sideEffects": false,
options Built correctly without error but don't display on the browser. In addition, no errors are displayed in browser console馃拋 Possible Solution
sideEffects": false,
don't fix the problem, but at least, index.jsxconsole.log("Coucou depuis tsx!")
logs is properly displayed on the console.<p>Hello world</p>
react. Without tree shaking, this ref appears at the end of file.馃敠 Context
Trying to minify my app to reduce bundle size.
馃捇 Code Sample
build with yarn
build:shake
i'm running it to test my build with
spa-http-server
:http-server --push-state
in thebuild
folder馃實 Your Environment)
| Software | Version(s)
| Parcel | 1.12.3
| Node | 11.8.0
| Yarn | 1.13.0
| spa-http-server | 0.9.0
| Operating System | macOS Mojave 10.14.3 (18D109)
The text was updated successfully, but these errors were encountered: