Open lucien-perouze opened 2 years ago
Same here, but with Rollup 3.1.0
npm ERR! code ERESOLVE npm ERR! ERESOLVE could not resolve npm ERR! npm ERR! While resolving: rollup-plugin-terser@7.0.2 npm ERR! Found: rollup@3.1.0 npm ERR! node_modules/rollup npm ERR! dev rollup@"^3.1.0" from the root project npm ERR! peerOptional rollup@"^1.20.0||^2.0.0||^3.0.0" from @rollup/plugin-image@3.0.0 npm ERR! node_modules/@rollup/plugin-image npm ERR! dev @rollup/plugin-image@"^3.0.0" from the root project npm ERR! 4 more (@rollup/plugin-node-resolve, rollup-plugin-cleaner, ...) npm ERR! npm ERR! Could not resolve dependency: npm ERR! peer rollup@"^2.0.0" from rollup-plugin-terser@7.0.2 npm ERR! node_modules/rollup-plugin-terser npm ERR! dev rollup-plugin-terser@"^7.0.2" from the root project npm ERR! npm ERR! Conflicting peer dependency: rollup@2.79.1 npm ERR! node_modules/rollup npm ERR! peer rollup@"^2.0.0" from rollup-plugin-terser@7.0.2 npm ERR! node_modules/rollup-plugin-terser npm ERR! dev rollup-plugin-terser@"^7.0.2" from the root project
Use:
npm i rollup-plugin-minification -D
as a replacement.
rollup config:
//import { terser } from "rollup-plugin-terser";
import { terser } from "rollup-plugin-minification";
While waiting for the upgrade I was stuck with a development which depends on this plugin. I decided to hack together a workaround until this is up to date.
Install vanilla terser and rollup-plugin-your-function :
npm i terser -D
npm i rollup-plugin-your-function -D
Adjust the rollup config:
//import { terser } from "rollup-plugin-terser";
import { minify } from "terser";
import { yourFunction } from "rollup-plugin-your-function";
const terser = () => yourFunction({ output: true, name: "terser", fn: async (source, options) => minify( source, { module: (/^esm?$/).test(options.outputOptions.format), toplevel: options.outputOptions.format === "cjs", sourceMap: true } ) });
Maybe this is useful for anyone else besides me.
</del>
While waiting for the upgrade I was stuck with a development which depends on this plugin. I decided to hack together a workaround until this is up to date.
- Install vanilla terser and rollup-plugin-your-function :
npm i terser -D npm i rollup-plugin-your-function -D
- Adjust the rollup config:
//import { terser } from "rollup-plugin-terser"; import { minify } from "terser"; import { yourFunction } from "rollup-plugin-your-function"; const terser = () => yourFunction({ output: true, name: "terser", fn: async (source, options) => minify( source, { module: (/^esm?$/).test(options.outputOptions.format), toplevel: options.outputOptions.format === "cjs", sourceMap: true } ) });
Maybe this is useful for anyone else besides me.
Thanks!
I don't think, that there will be much progress here at the moment. So, I decided to step in for a replacement. If have created rollup-plugin-minification, which you can use as a 1:1 replacement. Right now it is just the packed code I mentioned above .
I don't think, that there will be much progress here at the moment. So, I decided to step in for a replacement. If have created rollup-plugin-minification, which you can use as a 1:1 replacement. Right now it is just the packed code I mentioned above .
Wow ! The real captain ! 💯 Thank you for your time.
Wow ! The real captain
Ahoy! ⚓😁
See you on the other bank.
Just so everybody is aware, @tada5hi is contributing a Terser plugin to the official repo of Rollup plugins: https://github.com/rollup/plugins/pull/1323
That is good to know.
The official plugin with Rollup v3 support has been released: https://npmjs.com/package/@rollup/plugin-terser 🎉
That is good news. My replacement repository is now archived. I'll leave the npm package for a while for an easier transition. Cheers everyone.
That is good news. My replacement repository is now archived. I'll leave the npm package for a while for an easier transition. Cheers everyone.
I'd also recommend npm deprecate rollup-plugin-minification "use @rollup/plugin-terser instead"
True and done.
rollup-plugin-minification has been obsoleted use @rollup/plugin-terser npm i -D @rollup/plugin-terser
This plugin isn't compatible with Rollup 3.0.0.
Do you intend on updating it ?
Thanks.