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.
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 https://github.com/rollup/rollup-plugin-commonjs/pull/421
However, I suspect this might be a general problem that we should try to fix in ncc instead.
thoughts/opinions/concerns?
Same problem here when the generated bundle includes the iconv-lite package: no minification occurs.
Most helpful comment
ok, I was able to narrow this minification problem down. For some reason, when
@zeit/nccencounters a token with\0in template literals used ingetProxyIdandgetExternalProxyIdfunctions in rollup-plugin-commonjs, the minification seem to bailout.The fix for rollup-plugin-commonjs is simple as highlighted in https://github.com/rollup/rollup-plugin-commonjs/pull/421
However, I suspect this might be a general problem that we should try to fix in ncc instead.
thoughts/opinions/concerns?