-
Notifications
You must be signed in to change notification settings - Fork 6
/
rollup.config.js
61 lines (56 loc) · 1.47 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
60
import resolve from '@rollup/plugin-node-resolve';
import commonjs from '@rollup/plugin-commonjs';
import copy from 'rollup-plugin-copy';
import pkg from './package.json' assert { type: "json" };
export const build = [
{
input: 'kiigame.js',
output: {
name: 'kiigame',
file: pkg.browser,
format: 'umd'
},
plugins: [
resolve(),
commonjs()
]
},
{
input: 'kiigame.js',
external: ['konva'],
output: [
{ file: pkg.main, format: 'cjs' },
{ file: pkg.module, format: 'es' }
]
}
];
export const dev = {
input: 'latkazombit.js',
output: {
name: 'kiigame',
file: 'public/latkazombit.js',
format: 'iife',
sourcemap: true
},
plugins: [
resolve(),
commonjs(),
copy({
targets: [
{ src: 'kiigame.html', dest: 'public/' },
{ src: 'data/*.json', dest: 'public/data/' },
{ src: 'data/audio/**/*', dest: 'public/data/audio/' },
{ src: 'data/images/**/*', dest: 'public/data/images/' },
{ src: 'model/**/*', dest: 'public/model/'},
{ src: 'util/**/*', dest: 'public/util/' },
{ src: 'view/**/*', dest: 'public/view/' }
]
})
]
}
export default cli => {
if (cli.configBuild === true) {
return build;
}
return dev;
}