-
Notifications
You must be signed in to change notification settings - Fork 67
/
rollup.config.js
59 lines (55 loc) · 1.45 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
/**
* rollup.config.js
* Stripe Billing demo. Created by Michael Glukhovsky (@mglukhovsky).
*
* Rollup bundles our frontend Vue components into a single JavaScript file
* that can be distributed to the browser.
*/
'use strict';
import vue from 'rollup-plugin-vue';
import commonjs from 'rollup-plugin-commonjs';
import resolve from 'rollup-plugin-node-resolve';
import builtins from 'rollup-plugin-node-builtins';
import globals from 'rollup-plugin-node-globals';
import replace from 'rollup-plugin-replace';
import json from 'rollup-plugin-json';
import uglify from 'rollup-plugin-uglify';
import {minify} from 'uglify-es';
const production = !process.env.ROLLUP_WATCH;
export default {
input: 'client/src/main.js',
output: {
file: 'client/assets/bundle.js',
// Use an immediately-invoked function expression, since we're loading our
// bundle via a <script> tag
format: 'iife',
sourcemap: true,
},
plugins: [
resolve({
jsnext: true,
browser: true,
preferBuiltins: true,
}),
commonjs({
include: 'node_modules/**',
}),
globals(),
builtins(),
json(),
replace({
'process.env.NODE_ENV': JSON.stringify('development'),
'process.env.VUE_ENV': JSON.stringify('browser'),
}),
vue({
compileTemplate: true,
css: true,
}),
// Minify in production
production && uglify({}, minify),
],
watch: {
chokidar: true,
exclude: ['node_modules/**'],
},
};