You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Nov 30, 2023. It is now read-only.
When used with treeshake.pureExternalModules, essentially all unused imports after terser minification should be removed. But I guess that happens before the minification and thus persists.
Looks like adding this plug-in also removes the #__PURE__ annotations from the resulting bundle (at least based on my experiments with using it in react-window)
Hi @bvaughn
I think your issue is with terser. I tried a bunch of settings but could not retain the comments with just terser: https://repl.it/repls/ProudClientsideGreenware
And as this plugin is a wrapper around terser, I don't think this plugin will be able to retain the comments unless fixed in terser. Let's open an issue with terser for this.
I think you have another step for tree shaking after your code goes through terser where it is unable to treeshake because #__PURE__ comments are no longer there.
My issue is slightly different. My #__PURE__ code + comment gets removed correctly but rollup's treeshake.pureExternalModules step happens before my code is passed to terser and not after so my unused imports are still retained. (For which I am doing regex for my agadoo like tree shaking tests)
When used with treeshake.pureExternalModules, essentially all unused imports after terser minification should be removed. But I guess that happens before the minification and thus persists.
Minimal reproducing case: https://repl.it/repls/SoupyWigglyExtraction
Here it should not log anything. (The last line of index.js)
This might not be a bug with
rollup-plugin-terser
orrollup
orterser
individually per se, but maybe if we can change the order this might work.Related: terser/terser#168 which might require some effort if tackled only from terser's side.
The text was updated successfully, but these errors were encountered: