-
Notifications
You must be signed in to change notification settings - Fork 40
/
webpack.config.js
63 lines (61 loc) · 1.65 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
var path = require('path');
var phaserModule = path.join(__dirname, '/node_modules/phaser/');
var phaser = path.join(phaserModule, 'build/custom/phaser-split.js'),
pixi = path.join(phaserModule, 'build/custom/pixi.js');
module.exports = {
entry: './main',
output: {
filename: 'bundle.js'
},
devtool: 'source-map',
module: {
loaders: [
{
test: /\.js$/,
loader: 'babel-loader',
exclude: /(node_modules|bower_components)/,
query: {
presets: ['es2015']
}
},
{
test: /\.sass$/,
loaders: [
'style',
'css',
'autoprefixer?browsers=last 3 versions',
'sass?outputStyle=expanded'
]
},
{
test: /\.json$/,
loaders: ['json']
},
{ test: /p2\.js/, loader: 'expose?p2' },
{ test: /pixi\.js/, loader: 'expose?PIXI' },
{ test: /phaser-split\.js$/, loaders: [
'imports?p2=p2&PIXI=pixi',
'expose?Phaser'
]}
]
},
resolve: {
extensions: ['', '.js', '.sass'],
modulesDirectories: ['node_modules'],
alias: {
'pixi': pixi,
'phaser': phaser,
'p2': path.resolve(__dirname, './node_modules/p2/src/p2.js'),
'app': path.resolve('./app'),
'data': path.resolve('./data'),
'debug': path.resolve('./app/debug'),
'util': path.resolve('./app/util.js'),
'config': path.resolve('./app/config.js'),
'game': path.resolve('./app/game'),
'views': path.resolve('./app/views'),
'office': path.resolve('./app/office'),
'states': path.resolve('./app/states'),
'market': path.resolve('./app/market')
}
}
};