-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrollup.config.js
43 lines (41 loc) · 1.02 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
import resolve from '@rollup/plugin-node-resolve';
import replace from '@rollup/plugin-replace';
import commonjs from '@rollup/plugin-commonjs';
import alias from '@rollup/plugin-alias';
import vue from 'rollup-plugin-vue';
import css from 'rollup-plugin-css-only'
import { terser } from 'rollup-plugin-terser';
let nodeEnv = process.env.ROLLUP_WATCH ? 'development' : 'production';
export default [
{
input: 'js/index.js',
output: [
{
file: "static/bundle.js",
format: 'esm',
sourcemap: true,
}
],
plugins: [
replace({
'process.env.NODE_ENV': JSON.stringify( nodeEnv ),
'__VUE_PROD_DEVTOOLS__': JSON.stringify(true),
'__VUE_OPTIONS_API__': JSON.stringify(true),
}),
alias({
entries: [
{ find: 'vue', replacement: 'vue/dist/vue.esm-bundler.js' }
]
}),
css({
output: "bundle.css"
}),
vue(),
resolve({
browser: true,
}),
commonjs(),
// terser()
]
}
]