-
Notifications
You must be signed in to change notification settings - Fork 1
/
rollup.config.js
37 lines (34 loc) · 915 Bytes
/
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
import resolve from "@rollup/plugin-node-resolve";
import commonjs from "@rollup/plugin-commonjs";
import { terser } from "rollup-plugin-terser";
import css from "rollup-plugin-scss";
import copy from "rollup-plugin-copy";
const production = process.env.NODE_ENV === "production";
const config = {
input: "wetter/static/wetter/js/wetter.js",
output: {
dir: "wetter/static/bundle",
format: "iife",
sourcemap: !production
},
plugins: [
copy({
targets: [
{
src: "node_modules/leaflet/dist/images/*",
dest: "wetter/static/bundle/images"
}
]
}),
css({
output: "wetter/static/bundle/bundle.css",
outFile: "wetter/static/bundle/bundle.css",
outputStyle: production ? "compressed" : "expanded",
sourceMap: !production
}),
resolve(),
commonjs(),
production && terser()
]
};
export default [config];