Skip to content

Commit

Permalink
Update build and minification system
Browse files Browse the repository at this point in the history
  • Loading branch information
zz85 committed May 18, 2020
1 parent 621215b commit 4ba6fcd
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
"devDependencies": {
"do.js": "^1.0.0",
"rollup": "^2.10.2",
"rollup-plugin-uglify": "^6.0.4"
"rollup-plugin-terser": "^5.3.0"
},
"dependencies": {
"eslint": "^7.0.0"
Expand Down
23 changes: 23 additions & 0 deletions rollup.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
/*
import commonjs from '@rollup/plugin-commonjs';
export default {
input: 'src/timeliner.js',
output: {
dir: 'build',
format: 'cjs'
},
plugins: [commonjs()]
};
*/

import { terser } from "rollup-plugin-terser";

export default {
input: 'src/timeliner.js',
output: [
{ file: "build/lib.js", format: "cjs" },
{ file: "build/timeliner.min.js", plugins: [terser()] },
{ file: "build/timeliner.js", format: "esm" }
]
};
2 changes: 1 addition & 1 deletion test.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<div id="box"></div>
<script type="module">

import { Timeliner } from './build/timeliner.js'
import { Timeliner } from './build/timeliner.min.js'

var target = {
x: 0,
Expand Down

0 comments on commit 4ba6fcd

Please sign in to comment.