forked from PCs4KIDS/round-the-world
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.config.js
48 lines (45 loc) · 1.34 KB
/
webpack.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
var path = require('path');
// Phaser webpack config
var phaserModule = path.join(__dirname, '/node_modules/phaser-ce/');
var phaser = path.join(phaserModule, 'build/custom/phaser-split.js');
var pixi = path.join(phaserModule, 'build/custom/pixi.js');
var p2 = path.join(phaserModule, 'build/custom/p2.js');
var phaserInput = path.join(__dirname, '/node_modules/@orange-games/phaser-input/build/phaser-input.js');
module.exports = {
entry: './src/index.js',
module: {
rules: [
{ test: /\.js$/, use: ['babel-loader'], include: path.join(__dirname, 'client/src') },
{ test: /pixi\.js/, use: ['expose-loader?PIXI'] },
{ test: /phaser-split\.js$/, use: ['expose-loader?Phaser'] },
{ test: /p2\.js/, use: ['expose-loader?p2'] },
{ test: /phaser-input\.js$/, use: ['exports-loader?PhaserInput=true'] }, {
test: /\.(png|jpg|gif|ogg)$/,
use: [
{
loader: 'file-loader',
options: {
emitFile: false
}
}
]
}
]
},
resolve: {
alias: {
phaser,
pixi,
p2,
'phaser-input': phaserInput,
},
},
output: {
path: path.resolve(__dirname, 'dist'),
filename: 'round-the-world-game.min.js',
libraryTarget:'umd',
library: 'roundTheWorldGame',
umdNamedDefine: true
},
devtool: 'source-map'
};