2020-03-11 09:23:41 -04:00
|
|
|
import rust from "@wasm-tool/rollup-plugin-rust";
|
2020-04-25 23:24:34 -04:00
|
|
|
import serve from "rollup-plugin-serve";
|
|
|
|
import livereload from "rollup-plugin-livereload";
|
|
|
|
|
|
|
|
const is_watch = !!process.env.ROLLUP_WATCH;
|
2020-03-11 09:23:41 -04:00
|
|
|
|
|
|
|
export default {
|
|
|
|
input: {
|
|
|
|
index: "./Cargo.toml",
|
|
|
|
},
|
|
|
|
output: {
|
|
|
|
dir: "dist/js",
|
|
|
|
format: "iife",
|
|
|
|
sourcemap: true,
|
|
|
|
},
|
|
|
|
plugins: [
|
|
|
|
rust({
|
|
|
|
serverPath: "js/",
|
2020-04-25 23:24:34 -04:00
|
|
|
debug: false,
|
|
|
|
}),
|
|
|
|
|
|
|
|
is_watch && serve({
|
|
|
|
contentBase: "dist",
|
|
|
|
open: true,
|
2020-03-11 09:23:41 -04:00
|
|
|
}),
|
2020-04-25 23:24:34 -04:00
|
|
|
|
|
|
|
is_watch && livereload("dist"),
|
2020-03-11 09:23:41 -04:00
|
|
|
],
|
|
|
|
};
|