-
Notifications
You must be signed in to change notification settings - Fork 31
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
Example with minification #6
Comments
@guybedford thanks for the suggestion - sadly it fails on a chunk import when outputting to /private/var/folders/1z/z7j597t12d182tv_n80x6sq458d1h_/T/5ea703e1-1d91-4a90-835f-faa90525f15b:1: ERROR - Failed to load module "./chunk-7b6e0b9b.js"
import { b as baseEach } from './chunk-7b6e0b9b.js';
^
1 error(s), 0 warning(s) |
@danielnaab While I would certainly not call this "bulletproof" (I still run into problems here and there), terser({
compress: {
unused: false,
collapse_vars: false
},
output: {
comments: false
},
sourceMap: false
}) |
The I just tested a local copy of this repo and it appears to work. // rollup.config.js
import compiler from '@ampproject/rollup-plugin-closure-compiler';
export default {
input: ["src/main-a.js", "src/main-b.js"],
output: [
// ES module version, for modern browsers
{
dir: "public/module",
format: "es",
sourcemap: true
},
// SystemJS version, for older browsers
{
dir: "public/nomodule",
format: "system",
sourcemap: true
}
],
plugins: [
compiler(),
],
experimentalCodeSplitting: true
}; |
We adjust the minifier based on the output format:
|
It would be useful to demonstrate a bulletproof way to minify output bundles with code-splitting. I'm having trouble on certain edge cases, after working through multiple methods.
The text was updated successfully, but these errors were encountered: