-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathrollup.config.js
49 lines (46 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
import babel from "@rollup/plugin-babel";
import resolve from "@rollup/plugin-node-resolve";
import replace from "@rollup/plugin-replace";
import { terser } from "rollup-plugin-terser";
// Plugins to only include during production builds
const prodPlugins = [terser()];
const plugins = [
resolve(),
replace({
"process.env.NODE_ENV": JSON.stringify(process.env.NODE_ENV),
}),
babel({ babelHelpers: "bundled", presets: ["@babel/preset-env"] }),
...(process.env.NODE_ENV === "production" ? prodPlugins : []),
];
export default [
{
input: "manager/static/js/src/index.js",
output: {
file: "manager/static/js/index.js",
sourcemap: true,
name: "manager",
format: "iife",
},
plugins,
},
{
input: "manager/static/js/src/libs.js",
output: {
file: "manager/static/js/libs.js",
sourcemap: true,
name: "managerLibs",
format: "iife",
},
plugins,
},
{
input: "manager/static/js/src/errorHandler.js",
output: {
file: "manager/static/js/errorHandler.js",
sourcemap: true,
name: "ERAerrorHandler",
format: "iife",
},
plugins,
},
];