Skip to content

Commit

Permalink
Replace uglify-es with terser
Browse files Browse the repository at this point in the history
  • Loading branch information
Mark committed Apr 5, 2020
1 parent 0d4d6b5 commit 5bc8487
Show file tree
Hide file tree
Showing 3 changed files with 70 additions and 29 deletions.
81 changes: 57 additions & 24 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 3 additions & 4 deletions package.json
Expand Up @@ -63,17 +63,16 @@
"prettier": "^2.0.2",
"pretty-quick": "^2.0.1",
"rollup": "^2.3.3",
"rollup-plugin-terser": "^5.3.0",
"rollup-plugin-typescript2": "^0.27.0",
"sinon": "^9.0.1",
"typescript": "^3.7.2",
"uglify-es": "^3.3.9"
"typescript": "^3.7.2"
},
"scripts": {
"test": "karma start karma.conf.js && npm run lint",
"test-server": "karma start karma.conf.js --single-run=false",
"preversion": "npm test",
"minify": "uglifyjs dist/router-component.js -o dist/router-component.min.js",
"build": "rm -rf dist/* && rollup -c && npm run minify && npm run banner",
"build": "rm -rf dist/* && rollup -c && npm run banner",
"banner": "banner-cli dist/**/*.js",
"start": "rollup -c --watch",
"lint": "eslint '**/*.{js,ts}'",
Expand Down
11 changes: 10 additions & 1 deletion rollup.config.js
@@ -1,5 +1,6 @@
import typescript from 'rollup-plugin-typescript2';
import resolve from '@rollup/plugin-node-resolve';
import { terser } from 'rollup-plugin-terser';

export default {
input: 'src/router-component.ts',
Expand All @@ -13,7 +14,15 @@ export default {
file: 'dist/router-component.js',
},
],
plugins: [resolve(), typescript()],
plugins: [
resolve(),
typescript(),
!process.env.ROLLUP_WATCH &&
terser({
compress: true,
mangle: true,
}),
],
watch: {
include: 'src/**',
},
Expand Down

0 comments on commit 5bc8487

Please sign in to comment.