-
Notifications
You must be signed in to change notification settings - Fork 56
Breaks with multiple outputs #5
Comments
Could you try to use multiple configs instead of multiple outputs? Like this import { terser } from 'rollup-plugin-terser'
export default [
{
input: "index.js",
output: {
format: "umd",
file: "index.umd.min.js",
name: "index",
},
plugins: [ terser() ],
},
{
input: "index.js",
output: {
format: "es",
file: "index.module.min.js",
},
plugins: [ terser() ],
}
] |
Sure, that works, but the original config should too. |
Yes, sure. Just temporary workaround. Thinking on solving this issue. |
[rpt]: TrySound/rollup-plugin-terser#5 Due to a bug in [`rollup-plugin-terser`][rpt], the version is now locked at v2.0.2 until that's resolved. I checked the other deps, though, and there's no reason they can't update to their latest versions. This should simultaneously satisfy dependabot's recommendations. Signed-off-by: Jonathan Sifuentes <jayands.dev@gmail.com>
Confirmed, the issue is surfacing for me with a multiple output config as well. |
[rpt]: TrySound/rollup-plugin-terser#5 Due to a bug in [`rollup-plugin-terser`][rpt], the version is now locked at v2.0.2 until that's resolved. I checked the other deps, though, and there's no reason they can't update to their latest versions. This should simultaneously satisfy dependabot's recommendations. Signed-off-by: Jonathan Sifuentes <jayands.dev@gmail.com>
Facing the same issue after new release of Rollup |
Same here. |
same here too. |
Also rolling back / downgrading to 2.0.2 works will work with the array of outputs as a short term solution. |
@visormatt Multiple configs instead of multiple outputs also work. |
Thanks for the suggestion @TrySound. Unfortunately we're using it in a |
multiple configuration is used instead of multiple output temporary TrySound/rollup-plugin-terser#5
I've made a PR that should fix this. 😉 |
Mark here to get notifications when this issue is fixed. |
Any update on this? I have the same error |
@TrySound thanks for your explanation. Do you mean v1 of terser plugin ? I've fixed by using multiconfig: // this was commented
// if (prod) plugins.push(uglify(), visualizer({ filename: './bundle-stats.html' }));
// if (prod) plugins.push(terser(), visualizer({ filename: './bundle-stats.html' }));
export default [{
input: 'src/index.js',
external,
output: output.filter((o) => o.format !== 'es'),
// does not work ?
// plugins: prod ? plugins.concat([uglify(), visualizer({ filename: './bundle-stats.html' })]) : plugins,
plugins,
}, {
input: 'src/index.js',
external,
output: output.filter((o) => o.format === 'es'),
plugins: prod ? plugins.concat([terser(), visualizer({ filename: './bundle-stats.html' })]) : plugins,
}]; I am able to build but as you can see, I have lost the uglify step except for the es module. I have tried to used both plugin uglify and terser, this give me the error:
Do you also have a solution for that ? |
Nevermind, I have found that uglify plugin also need to be called once per instance. export default output.map((output) => {
return {
input: 'src/index.js',
external,
output,
plugins: prod ? plugins.concat([terser(), visualizer({ filename: './bundle-stats.html' })]) : plugins,
}
}); |
I have the same error 😢 |
This fixes an error that occurs when multiple outputs are specified for bundling. Reason: - jest-worker was not cleaned up properly Fixes TrySound#5
Is this fixed? |
@kopax Yep. Should be fixed in v4 |
No changes were required in our configuration other than bumping the version. Great work and thanks for the wonderful package @TrySound and contributors 🙇 |
rollup.config.js
index.js
versions
Expected output: should work
Commenting out either output config prevents errors.
The text was updated successfully, but these errors were encountered: