Skip to content

Commit 6b6acb6

Browse files
build(rollup): replace rollup plugin uglify with terser
Fix error when installing with npm 7: ```sh $ npm install npm ERR! code ERESOLVE npm ERR! ERESOLVE unable to resolve dependency tree npm ERR! npm ERR! Found: rollup@2.32.1 npm ERR! node_modules/rollup npm ERR! dev rollup@"^2.12.1" from the root project npm ERR! npm ERR! Could not resolve dependency: npm ERR! peer rollup@">=0.66.0 <2" from rollup-plugin-uglify@6.0.4 npm ERR! node_modules/rollup-plugin-uglify npm ERR! dev rollup-plugin-uglify@"^6.0.4" from the root project npm ERR! npm ERR! Fix the upstream dependency conflict, or retry npm ERR! this command with --force, or --legacy-peer-deps npm ERR! to accept an incorrect (and potentially broken) dependency resolution. ```
1 parent f5ff1d2 commit 6b6acb6

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@
5757
"react-dom": "^16",
5858
"rimraf": "^3.0.2",
5959
"rollup": "^2.12.1",
60-
"rollup-plugin-uglify": "^6.0.4",
60+
"rollup-plugin-terser": "^7.0.2",
6161
"standard-version": "5",
6262
"typescript": "^3.9.3"
6363
},

rollup.config.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import commonjs from '@rollup/plugin-commonjs';
22
import resolve from '@rollup/plugin-node-resolve';
3-
import { uglify } from 'rollup-plugin-uglify';
3+
import { terser } from 'rollup-plugin-terser';
44

55
/**
66
* Build rollup config for development (default) or production (minify = true).
@@ -20,7 +20,7 @@ const getConfig = (minify = false) => ({
2020
name: 'HTMLReactParser',
2121
sourcemap: true
2222
},
23-
plugins: [commonjs(), resolve({ browser: true }), minify && uglify()]
23+
plugins: [commonjs(), resolve({ browser: true }), minify && terser()]
2424
});
2525

2626
export default [getConfig(), getConfig(true)];

0 commit comments

Comments
 (0)