-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
rollup.config.js
35 lines (32 loc) 路 1.01 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
import copy from "rollup-plugin-copy"
import serve from "rollup-plugin-serve"
import svelte from "rollup-plugin-svelte"
import replace from "rollup-plugin-replace"
import {terser} from "rollup-plugin-terser"
import commonjs from "@rollup/plugin-commonjs"
import resolve from "@rollup/plugin-node-resolve"
import livereload from "rollup-plugin-livereload"
const path = "dist"
const config = {
input: "src/index.js",
output: {
file: `${path}/bundle.js`,
sourcemap: process.env.ROLLUP_WATCH,
},
plugins: [
svelte({dev: process.env.ROLLUP_WATCH}),
resolve({browser: true}),
// replace({}),
commonjs(),
copy({targets: [{src: "static/*", dest: path}]}),
!process.env.ROLLUP_WATCH && terser(),
process.env.ROLLUP_WATCH &&
serve({
contentBase: path,
port: 5000,
historyApiFallback: true,
}),
process.env.ROLLUP_WATCH && livereload(path),
],
}
export default config