-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathrollup.config.js
More file actions
31 lines (27 loc) · 1.03 KB
/
rollup.config.js
File metadata and controls
31 lines (27 loc) · 1.03 KB
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
//copied from https://github.com/rollup/rollup-starter-app/blob/master/rollup.config.js
import resolve from '@rollup/plugin-node-resolve';
import commonjs from '@rollup/plugin-commonjs';
import { terser } from 'rollup-plugin-terser';
import json from '@rollup/plugin-json';
import nodePolyfills from 'rollup-plugin-node-polyfills';
//import livereload from 'rollup-plugin-livereload';
// `npm run build` -> `production` is true
// `npm run dev` -> `production` is false
const production = !process.env.ROLLUP_WATCH;
export default {
input: 'src/main.js',
output: {
file: 'public/bundle.js',
format: 'iife', // immediately-invoked function expression — suitable for <script> tags
sourcemap: true
},
plugins: [
resolve({ preferBuiltins: true}),
commonjs(), // converts date-fns to ES modules
json(), // trying to fix error pointing at json module
nodePolyfills(),
// production && livereload({delay : 200}), //didn't work
//livereload({delay : 200}),
production && terser() // minify, but only in production
]
};