-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrollup.config.dist.js
69 lines (61 loc) · 2.34 KB
/
rollup.config.dist.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
61
62
63
64
65
66
67
68
69
import commonjs from '@rollup/plugin-commonjs';
import resolve from '@rollup/plugin-node-resolve';
import replace from '@rollup/plugin-replace';
import copy from 'rollup-plugin-copy'
import { terser } from 'rollup-plugin-terser';
import typescript from 'rollup-plugin-typescript2';
export default {
input: [
'./src/games/launcher.ts'
],
// Where the build file is to be generated.
// Most games being built for distribution can use iife as the module type.
// You can also use 'umd' if you need to ingest your game into another system.
output: {
file: './dist/game.js',
name: 'MyGame',
format: 'iife',
sourcemap: false,
intro: 'var global = window;'
},
plugins: [
// Toggle the booleans here to enable / disable Phaser 3 features:
replace({
preventAssignment: true,
'typeof CANVAS_RENDERER': JSON.stringify(true),
'typeof WEBGL_RENDERER': JSON.stringify(true),
'typeof EXPERIMENTAL': JSON.stringify(true),
'typeof PLUGIN_CAMERA3D': JSON.stringify(false),
'typeof PLUGIN_FBINSTANT': JSON.stringify(false),
'typeof FEATURE_SOUND': JSON.stringify(true)
}),
// Parse our .ts source files
resolve({
extensions: [ '.ts', '.tsx' ]
}),
// We need to convert the Phaser 3 CJS modules into a format Rollup can use:
commonjs({
include: [
'node_modules/eventemitter3/**',
'node_modules/phaser/**'
],
exclude: [
'node_modules/phaser/src/polyfills/requestAnimationFrame.js'
],
sourceMap: false,
ignoreGlobal: true
}),
typescript(),
terser(),
copy({
targets: [
{src: 'src/core/assets/**/*', dest: 'dist/assets/core'},
{src: 'src/games/anagram/assets/**/*', dest: 'dist/assets/anagram'},
{src: 'src/games/bugsequence/assets/**/*', dest: 'dist/assets/bugsequence'},
{src: 'src/games/double/assets/**/*', dest: 'dist/assets/double'},
{src: 'src/games/colors/assets/**/*', dest: 'dist/assets/colors'},
{src: 'src/games/memo/assets/**/*', dest: 'dist/assets/memo'}
]
})
]
};