-
Notifications
You must be signed in to change notification settings - Fork 12k
TerserPlugin - exclude specific module / files #14750
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
In the future, please follow the issue template. It is quite difficult to provide assistance without the requested information. The package is marked as being side effect free (https://github.com/bpmn-io/bpmn-js/blob/master/package.json#L38). If code is being removed, the most likely cause is that the package is not actually side effect free. |
@clydin Sorry about the template. |
This is actually an issue with the package. It is advertising itself as being side effect free when it is not. The CLI is acting appropriately given the information it is being provided by the package. |
@clydin yeah, I know, I've been reading issues regarding Terser/UglifyJs behavior. |
If you need a temporary workaround, you can remove the side effects field from the installed package. This would need to be done every time it is installed. For completeness, a post install script for the project is a common method to augment errant packages. If the package is being imported into the application then there is no separate file to exclude. Only the final bundles are run through the minifier. |
Thanks for confirming that. I tought I was doing something wrong while debugging the builder.
I'll give this one a try, as I don't want to hand-edit the file every time. Last question, if you can answer: the
|
It's not actually the content of the function but rather the location of the call. Since the call is at the module level, importing the module will result in execution and cause some type of effect by simply importing the module. |
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. |
I haven't found a way to customize the
TerserPlugin
exclude
option (and others).Do you have any suggestion?
Terser is removing important functions from an external pure JavaScript library (bpmn-js) and I absolutely need to exclude it, while maintaining the build optimization.
The text was updated successfully, but these errors were encountered: