-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.config.js
34 lines (31 loc) · 1022 Bytes
/
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
const path = require('path')
const phaserModule = path.join(__dirname, '/node_modules/phaser-ce/')
const phaser = path.join(phaserModule, 'build/custom/phaser-split.js'),
pixi = path.join(phaserModule, 'build/custom/pixi.js'),
p2 = path.join(phaserModule, 'build/custom/p2.js')
const assets = path.join(__dirname, 'assets/')
module.exports = {
devtool: 'inline-source-map',
entry: './src/scripts/app.ts',
output: {
filename: 'app.js',
path: path.resolve(__dirname, 'dist')
},
resolve: {
alias: {
'phaser': phaser,
'pixi': pixi,
'p2': p2,
'assets': assets
},
extensions: ['.ts', '.tsx', '.js']
},
module: {
loaders: [{ test: /\.tsx?$/, exclude: /node_modules/, loader: 'ts-loader' },
{ test: /pixi\.js/, use: ['expose-loader?PIXI'] },
{ test: /phaser-split\.js$/, use: ['expose-loader?Phaser'] },
{ test: /p2\.js/, use: ['expose-loader?p2']},
{ test: /assets(\/|\\)/, loader: 'file-loader?name=assets/[hash].[ext]' },
]
}
}