-
Notifications
You must be signed in to change notification settings - Fork 0
/
rollup.config.js
46 lines (42 loc) · 1.26 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
import buble from 'rollup-plugin-buble';
import resolve from 'rollup-plugin-node-resolve'
import commonjs from 'rollup-plugin-commonjs'
import livereload from 'rollup-plugin-livereload'
import { terser } from 'rollup-plugin-terser'
import json from '@rollup/plugin-json';
import replace from '@rollup/plugin-replace';
import postcss from 'rollup-plugin-postcss';
const production = !process.env.ROLLUP_WATCH
export default {
input: 'assets/src/main.js',
output: {
sourcemap: !production,
format: 'iife',
name: 'app',
file: `assets/dist/bundle.js`
},
plugins: [
postcss(),
replace({
"process.env.NODE_ENV": JSON.stringify(!production? "development" : 'production')
}),
json(),
resolve({ preferBuiltins: true, browser: true }),
buble({
jsx: 'h',objectAssign: 'Object.assign', transforms: { asyncAwait: false }
}),
commonjs({
include: 'node_modules/**'
}),
// postcss({ extract: true }),
// Watch the `public` directory and refresh the
// browser on changes when not in production
!production && livereload('assets/dist/'),
// If we're building for production (npm run build
// instead of npm run dev), minify
production && terser(),
],
watch: {
clearScreen: false
}
}