-
-
Notifications
You must be signed in to change notification settings - Fork 3
/
rollup.config.js
42 lines (36 loc) · 1.09 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
import rust from "@wasm-tool/rollup-plugin-rust";
import serve from "rollup-plugin-serve";
import livereload from "rollup-plugin-livereload";
import { terser } from "rollup-plugin-terser";
import copy from 'rollup-plugin-copy';
const is_watch = !!process.env.ROLLUP_WATCH;
export default {
input: {
index: "./Cargo.toml",
},
output: {
dir: "dist/js",
format: "iife",
sourcemap: true,
},
plugins: [
rust({
serverPath: "js/",
}),
copy({
targets: [
{ src: 'static/css/main.css', dest: 'dist/css/' },
{ src: 'static/img/degiro.svg', dest: 'dist/img/' },
{ src: 'static/img/interactive_brokers.svg', dest: 'dist/img/' },
{ src: 'static/img/favicon.ico', dest: 'dist/img/' },
{ src: 'static/img/burocratin.svg', dest: 'dist/img/' },
]
}),
is_watch && serve({
contentBase: "dist",
open: true,
}),
is_watch && livereload("dist"),
!is_watch && terser(),
],
};