-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.js
71 lines (70 loc) · 2.45 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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
var webpack = require('webpack');
var path = require('path');
var HtmlWebpackPlugin = require('html-webpack-plugin');
var CleanWebpackPlugin = require('clean-webpack-plugin');
var WebpackSynchronizableShellPlugin = require('webpack-synchronizable-shell-plugin');
module.exports = {
entry: path.join(__dirname, 'src/app.ts'),
output: {
path: path.join(__dirname, 'www'),
filename: 'game.js'
},
resolve: {
extensions: ['.ts', '.js'],
alias: {
pixi: path.join(__dirname, 'node_modules/phaser-ce/build/custom/pixi.js'),
phaser: path.join(__dirname, 'node_modules/phaser-ce/build/custom/phaser-split.js'),
p2: path.join(__dirname, 'node_modules/phaser-ce/build/custom/p2.js'),
assets: path.join(__dirname, 'assets/')
}
},
plugins: [
new WebpackSynchronizableShellPlugin({
onBuildStart: {
scripts: [],
blocking: true,
parallel: false
}
}),
new webpack.DefinePlugin({
'DEBUG': true,
'DEFAULT_GAME_WIDTH': 1024,
'DEFAULT_GAME_HEIGHT': 768,
'MAX_GAME_WIDTH': 1420,
'MAX_GAME_HEIGHT': 960,
'SCALE_MODE': JSON.stringify('USER_SCALE'),
'GOOGLE_WEB_FONTS': JSON.stringify([
'Barrio'
]),
'SOUND_EXTENSIONS_PREFERENCE': JSON.stringify([
'webm', 'ogg', 'm4a', 'mp3', 'aac', 'ac3', 'caf', 'flac', 'mp4', 'wav'
])
}),
new HtmlWebpackPlugin({
title: 'DEV MODE: IFR Trainer',
template: path.join(__dirname, 'templates/index.ejs')
})
],
devServer: {
contentBase: path.join(__dirname, 'www'),
compress: true,
port: 9000,
inline: true,
watchOptions: {
aggregateTimeout: 300,
poll: true,
ignored: /node_modules/
}
},
module: {
rules: [
{ test: /\.ts$/, enforce: 'pre', loader: 'tslint-loader' },
{ test: /assets(\/|\\)/, loader: 'file-loader?name=assets/[hash].[ext]' },
{ test: /pixi\.js$/, loader: 'expose-loader?PIXI' },
{ test: /phaser-split\.js$/, loader: 'expose-loader?Phaser' },
{ test: /p2\.js$/, loader: 'expose-loader?p2' },
{ test: /\.ts$/, loader: 'ts-loader', exclude: '/node_modules/' }
]
},
devtool: 'source-map'
};