rust-dominator/examples/async/rollup.config.js

32 lines
683 B
JavaScript
Raw Permalink Normal View History

2020-03-20 23:00:56 -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";
2021-05-28 07:29:17 -04:00
import { terser } from "rollup-plugin-terser";
2020-04-25 23:24:34 -04:00
const is_watch = !!process.env.ROLLUP_WATCH;
2020-03-20 23:00:56 -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
}),
is_watch && serve({
contentBase: "dist",
open: true,
2020-03-20 23:00:56 -04:00
}),
2020-04-25 23:24:34 -04:00
is_watch && livereload("dist"),
2021-05-28 07:29:17 -04:00
!is_watch && terser(),
2020-03-20 23:00:56 -04:00
],
};