-
Notifications
You must be signed in to change notification settings - Fork 3
/
rollup.config.js
60 lines (59 loc) · 1.4 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
import commonjs from "@rollup/plugin-commonjs";
import { nodeResolve } from "@rollup/plugin-node-resolve";
import replace from "@rollup/plugin-replace";
import json from "@rollup/plugin-json";
import terser from "@rollup/plugin-terser";
import postcss from "rollup-plugin-postcss";
import postcssImport from "postcss-import";
import watch from 'rollup-plugin-watch';
import copy from "rollup-plugin-copy";
import del from 'rollup-plugin-delete';
export default {
input: "src/bs5dialog.js",
output: [
{
file: "dist/bs5dialog.js",
format: "umd",
name: "bs5dialog",
sourcemap: false
},
{
file: "dist/bs5dialog.cjs.js",
format: "cjs",
sourcemap: false
},
{
file: "dist/bs5dialog.esm.js",
format: "esm",
sourcemap: false
}
],
plugins: [
del({ targets: 'dist/*' }),
nodeResolve(),
commonjs(),
json(),
replace({
preventAssignment: true,
"process.browser": true,
"process.env.NODE_ENV": JSON.stringify("production")
}),
postcss({
plugins: [postcssImport()],
extract: true
}),
terser(),
watch({
dir: "src"
}),
copy({
targets: [
{ src: "src/index.html", dest: "dist" },
{ src: "src/form.html", dest: "dist" },
{ src: "src/examples", dest: "dist" },
{ src: "src/docs", dest: "dist" }
],
hook: "buildStart"
})
]
};