-
Notifications
You must be signed in to change notification settings - Fork 12k
[build-optimizer] docs about sideEffects: false
and maybe bug
#11399
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’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
sideEffects: false
and maybe bugside_effects: false
and maybe bug
side_effects: false
and maybe bugsideEffects: false
and maybe bug
The underlying issue is that the build optimizer does not currently understand the usage of the object literal function definition syntax used in the example. Changing the function definition to the following results in proper behavior:
|
Thanks ! |
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Bug Report or Feature Request
Area
Versions
@angular-devkit/[email protected]
Issue
After adding
sideEffects: false
to a library doing webgl stuff, I found out some code was removed because the library contains unpure functions (any function doing webgl stuff).Turns out build-optimizer is also using that flag in his process to prefix functions with
/*@__PURE__*/
and that is the cause of code removal.I have build up a repro with one of the function :
https://repl.it/@GhetGhetolay/buildoptimizerwebgl
I'm not sure if
isSideEffectFree
to falseIf it's not a bug this means we're using same flag for different purposes, webpack
sideEffects
and build-optimizerisSideEffectFree
options are not about the same kind of side effects (module vs functions).Anyway I think we're missing a bit of docs, neither the Angular Package Format nor the build-optimizer docs mentionned the use of
sideEffects
flag by build-optimizer.The text was updated successfully, but these errors were encountered: