-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrollup.config.js
64 lines (63 loc) · 1.14 KB
/
rollup.config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
const resolve = require("@rollup/plugin-node-resolve");
const babel = require("@rollup/plugin-babel");
const commonjs = require("@rollup/plugin-commonjs");
const terser = require("@rollup/plugin-terser");
const postcss = require("rollup-plugin-postcss");
const del = require("rollup-plugin-delete");
const cssnano = require("cssnano");
module.exports = [{
input: "src/index.js",
plugins: [
del({
targets: "dist/*"
}),
resolve(),
commonjs(),
babel({
exclude: ["node_modules/**"],
babelHelpers: "bundled"
})
],
output: [
{
file: "dist/cjs.js",
format: "cjs",
exports: "named",
footer: "module.exports = Object.assign(exports.default, exports);",
sourcemap: true
},
{
file: "dist/es.js",
format: "es"
},
{
file: "dist/umd.js",
format: "umd",
name: "PaperCheckboxTree",
sourcemap: true,
plugins: [
terser()
]
},
],
}, {
input: "src/index.pcss",
output: {
file: "dist/style.js",
format: "cjs"
},
plugins: [
del({
targets: "dist/style.js",
hook: "writeBundle"
}),
postcss({
extract: "style.css",
plugins: [
cssnano({
preset: "default"
})
],
})
]
}]