Skip to content

Commit 315a829

Browse files
authored
feat(build): Create minified UMD build (#443)
1 parent cb78de1 commit 315a829

File tree

3 files changed

+781
-1111
lines changed

3 files changed

+781
-1111
lines changed

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
"@rollup/plugin-json": "^6.1.0",
3838
"@rollup/plugin-node-resolve": "^15.2.3",
3939
"@rollup/plugin-replace": "^6.0.1",
40+
"@rollup/plugin-terser": "^0.4.4",
4041
"acorn": "^7.1.0",
4142
"acorn-jsx": "^5.2.0",
4243
"eslint": "^8.17.0",

rollup.config.mjs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import commonjs from "@rollup/plugin-commonjs";
66
// import babelRuntime from "@rollup/plugin-transform-runtime"
77
import json from "@rollup/plugin-json";
88
import replace from "@rollup/plugin-replace";
9+
import terser from "@rollup/plugin-terser";
910
import { readFileSync } from "fs";
1011

1112
const pkg = JSON.parse(
@@ -21,6 +22,13 @@ export default {
2122
name: "dcmjs",
2223
sourcemap: true
2324
},
25+
{
26+
file: pkg.main.replace(/\.js$/, ".min.js"),
27+
format: "umd",
28+
name: "dcmjs",
29+
sourcemap: true,
30+
plugins: [terser()]
31+
},
2432
{
2533
file: pkg.module,
2634
format: "es",

0 commit comments

Comments
 (0)