-
Notifications
You must be signed in to change notification settings - Fork 0
/
rollup.config.js
60 lines (57 loc) · 1.38 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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
import {rollup} from "rollup"
import commonjs from "rollup-plugin-commonjs"
import npm from "rollup-plugin-node-resolve"
import globals from "rollup-plugin-node-globals"
import buble from "rollup-plugin-buble"
import vue from "rollup-plugin-vue2"
import postcss from "rollup-plugin-postcss"
import async from "rollup-plugin-async"
import uglify from "rollup-plugin-uglify"
import livereload from "rollup-plugin-livereload"
import replace from "rollup-plugin-replace"
import filesize from "rollup-plugin-filesize"
import json from "rollup-plugin-json"
const isProduction = process.env.NODE_ENV === "production"
const postcssPlugins = []
const plugins = [
vue({compileTemplate:true}),
postcss({
plugins: postcssPlugins
}),
async(),
json(),
buble({
objectAssign: "Object.assign",
transforms: {
modules: false,
dangerousForOf: true
}
}),
npm({
jsnext: true,
main: true,
browser: true
}),
commonjs(),
replace({
"process.env.NODE_ENV": JSON.stringify(process.env.NODE_ENV)
})
]
if (isProduction) {
plugins.push(
uglify(),
filesize()
)
} else {
plugins.push(
livereload()
)
}
export default {
entry: "./app/entry.js",
dest: "./public/assets/bundle.js",
format: "iife",
sourceMap: false,
useStrict: false,
plugins
}