Skip to content

Commit

Permalink
Replace uglify with terser
Browse files Browse the repository at this point in the history
  • Loading branch information
Mark committed Apr 1, 2020
1 parent fcd0953 commit fa7e995
Show file tree
Hide file tree
Showing 3 changed files with 85 additions and 28 deletions.
101 changes: 78 additions & 23 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
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,7 @@
"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/content-editable.js -o dist/content-editable.min.js",
"build-dist": "rm -rf dist/* && rollup -c && npm run minify",
"build-dist": "rm -rf dist/* && rollup -c",
"version": "npm run build-dist && banner-cli dist/*.js && git add -A dist",
"postversion": "git push && git push --tags",
"start": "rollup -c --watch",
Expand All @@ -62,12 +61,12 @@
"rollup": "^2.1.0",
"rollup-plugin-commonjs": "^10.1.0",
"rollup-plugin-node-resolve": "^5.2.0",
"rollup-plugin-terser": "^5.3.0",
"rollup-plugin-typescript2": "^0.26.0",
"sinon": "^9.0.1",
"tslint": "^6.1.0",
"tslint-config-prettier": "^1.15.0",
"typescript": "^3.2.2",
"uglify-es": "^3.3.9"
"typescript": "^3.2.2"
},
"dependencies": {
"anchorme": "^1.1.2"
Expand Down
5 changes: 4 additions & 1 deletion rollup.config.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
import typescript from 'rollup-plugin-typescript2';
import resolve from 'rollup-plugin-node-resolve';
import commonjs from 'rollup-plugin-commonjs';
import { terser } from "rollup-plugin-terser";

const { ROLLUP_WATCH } = process.env;

export default {
input: 'src/content-editable.ts',
output: {
format: 'esm',
file: 'dist/content-editable.js'
},
plugins: [resolve(), typescript(), commonjs()],
plugins: [resolve(), typescript(), commonjs(), !ROLLUP_WATCH && terser()],
watch: {
include: 'src/**'
}
Expand Down

0 comments on commit fa7e995

Please sign in to comment.