-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrollup.config.js
45 lines (43 loc) · 1.25 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
import commonjs from 'rollup-plugin-commonjs';
import htmlBundle from 'rollup-plugin-html-bundle';
import livereload from 'rollup-plugin-livereload';
import nodeResolve from 'rollup-plugin-node-resolve';
import serve from 'rollup-plugin-serve';
import styles from 'rollup-plugin-styles';
import { terser } from 'rollup-plugin-terser';
const production = !process.env.ROLLUP_WATCH;
const outputDir = production ? 'dist' : 'out';
export default {
input: 'playground/index.js',
output: {
file: `${outputDir}/playground.js`,
name: 'GameToolsJS',
format: 'iife',
},
plugins: [
nodeResolve(),
commonjs(),
styles(),
production &&
terser({
/*mangle: {
properties: {
keep_quoted: true,
},
},*/
compress: {
booleans_as_integers: true,
drop_console: true,
},
}),
htmlBundle({
template: 'playground/index.html',
target: `${outputDir}/index.html`,
}),
!production && serve({ contentBase: outputDir, open: true }),
!production && livereload(outputDir),
],
watch: {
exclude: ['node_modules/**'],
},
};