-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrollup.config.dev.js
56 lines (55 loc) · 1.48 KB
/
rollup.config.dev.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
import htmlTemplate from 'rollup-plugin-generate-html-template';
import commonjs from 'rollup-plugin-commonjs';
import serve from 'rollup-plugin-serve';
import livereload from 'rollup-plugin-livereload';
import image from 'rollup-plugin-img';
import copy from 'rollup-plugin-copy';
import json from 'rollup-plugin-json';
module.exports = {
input: 'src/index.js',
output: {
dir: 'dist',
format: 'es',
compact: false,
},
plugins: [
json({
exclude: ['node_modules/**'],
preferConst: true,
compact: true,
namedExports: true
}),
copy({
targets: [
{ src: 'resources/sounds/*', dest: 'dist/resources/sounds' },
]
}),
commonjs({
include: 'node_modules/**', // Default: undefined
exclude: [], // Default: undefined
extensions: ['.js'], // Default: [ '.js' ]
ignoreGlobal: false, // Default: false
sourceMap: true, // Default: true
}),
image({
output: 'dist/resources', // default the root
extensions: /\.(png|jpg|jpeg|gif|svg)$/, // support png|jpg|jpeg|gif|svg, and it's alse the default value
limit: 8192, // default 8192(8k)
exclude: 'node_modules/**'
}),
htmlTemplate({
template: 'src/index.html',
target: 'dist/index.html',
}),
serve({
host: 'localhost',
contentBase: ['dist'],
verbose: true,
port: 8080,
}),
livereload({
watch: 'dist',
verbose: true, // Disable console output
}),
],
};