2020-04-07 23:51:27 +02:00
|
|
|
import resolve from "@rollup/plugin-node-resolve";
|
|
|
|
import commonjs from "@rollup/plugin-commonjs";
|
|
|
|
import { terser } from "rollup-plugin-terser";
|
2020-04-08 11:44:18 +02:00
|
|
|
import css from "rollup-plugin-scss";
|
2020-04-08 12:02:05 +02:00
|
|
|
import copy from "rollup-plugin-copy";
|
2020-04-07 23:51:27 +02:00
|
|
|
|
|
|
|
const production = process.env.NODE_ENV === "production";
|
|
|
|
|
2020-04-08 11:44:18 +02:00
|
|
|
const config = {
|
2020-04-07 23:51:27 +02:00
|
|
|
input: "wetter/static/wetter/js/wetter.js",
|
|
|
|
output: {
|
2020-04-08 12:12:31 +02:00
|
|
|
dir: "wetter/static/bundle",
|
2020-04-07 23:51:27 +02:00
|
|
|
format: "iife",
|
|
|
|
sourcemap: !production
|
|
|
|
},
|
2020-04-08 11:44:18 +02:00
|
|
|
plugins: [
|
2020-04-08 12:02:05 +02:00
|
|
|
copy({
|
|
|
|
targets: [
|
|
|
|
{
|
|
|
|
src: "node_modules/leaflet/dist/images/*",
|
2020-04-08 12:12:31 +02:00
|
|
|
dest: "wetter/static/bundle/images"
|
2020-04-08 12:02:05 +02:00
|
|
|
}
|
|
|
|
]
|
|
|
|
}),
|
2020-04-08 11:44:18 +02:00
|
|
|
css({
|
2020-04-08 12:12:31 +02:00
|
|
|
output: "wetter/static/bundle/bundle.css",
|
|
|
|
outFile: "wetter/static/bundle/bundle.css",
|
2020-04-08 11:44:18 +02:00
|
|
|
outputStyle: production ? "compressed" : "expanded",
|
|
|
|
sourceMap: !production
|
|
|
|
}),
|
|
|
|
resolve(),
|
|
|
|
commonjs(),
|
|
|
|
production && terser()
|
|
|
|
]
|
2020-04-07 23:51:27 +02:00
|
|
|
};
|
2020-04-08 11:44:18 +02:00
|
|
|
|
|
|
|
export default [config];
|