-
Notifications
You must be signed in to change notification settings - Fork 0
/
rollup.config.js
38 lines (36 loc) · 989 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
38
import copy from "rollup-plugin-copy";
import html from "@rollup/plugin-html";
import nodeResolve from "@rollup/plugin-node-resolve";
import ts from "@wessberg/rollup-plugin-ts";
import postcss from "rollup-plugin-postcss";
import { terser } from "rollup-plugin-terser";
import livereload from "rollup-plugin-livereload";
import serve from "rollup-plugin-serve";
const production = !process.env.ROLLUP_WATCH;
export default [
{
input: "web/index.ts",
output: {
dir: "dist",
format: "esm",
sourcemap: true
},
plugins: [
copy({
targets: [{ src: ["pkg/poxels_bg.wasm"], dest: "dist" }],
verbose: true
}),
html({ title: "Poxels" }),
nodeResolve({ modulesOnly: true }),
ts(),
postcss({
sourceMap: true,
minimize: production
}),
production && terser(),
!production && livereload("dist"),
!production && serve("dist")
],
watch: { clearScreen: false }
}
];