Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Minification bails out for rollup-plugin-commonjs #485

Open
osdevisnot opened this issue Nov 8, 2019 · 2 comments
Open

Minification bails out for rollup-plugin-commonjs #485

osdevisnot opened this issue Nov 8, 2019 · 2 comments

Comments

@osdevisnot
Copy link

While working on https://github.com/osdevisnot/klap, I noticed that final bundle is not minified, resulting in larger payloads on install.

Digging this deeper, I narrowed the problem down to rollup-plugin-commonjs. The moment this package is used, the final bundle is unminified for some reason.

I was able to produce minimal repro of the problem here:
https://github.com/osdevisnot/ncc-minify-repro

I am digging deeper to solve this, but wanted to open issue in case someone else has this figured out already.

@osdevisnot
Copy link
Author

ok, I was able to narrow this minification problem down. For some reason, when @zeit/ncc encounters a token with \0 in template literals used in getProxyId and getExternalProxyId functions in rollup-plugin-commonjs, the minification seem to bailout.

The fix for rollup-plugin-commonjs is simple as highlighted in rollup/rollup-plugin-commonjs#421

However, I suspect this might be a general problem that we should try to fix in ncc instead.

thoughts/opinions/concerns?

@cedx
Copy link

cedx commented Oct 19, 2020

Same problem here when the generated bundle includes the iconv-lite package: no minification occurs.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants