-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.common.config.js
40 lines (29 loc) · 1.07 KB
/
webpack.common.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
var merge = require("webpack-merge");
var webpack = require('webpack');
var path = require('path');
var phaserModule = path.join(__dirname, '/node_modules/phaser/');
var phaser = path.join(phaserModule, 'build/custom/phaser-split.min.js')
var pixi = path.join(phaserModule, 'build/custom/pixi.min.js');
var p2 = path.join(phaserModule, 'build/custom/p2.min.js');
var config = require('./scalajs.webpack.config');
var globalModules = ["pixi.js","p2","phaser"];
Object.keys(config.entry).forEach(function(key) {
config.entry[key] = globalModules.concat(config.entry[key]);
});
var phaserConfig = {
module: {
loaders: [
{ test: /pixi.min.js/, loader: "expose-loader?PIXI" },
{ test: /phaser-split.min.js/, loader: 'expose-loader?Phaser'},
{ test: /p2.min.js/, loader: "expose-loader?p2"},
]
},
resolve: {
alias: {
'phaser': phaser,
'pixi.js': pixi,
'p2': p2,
}
},
};
module.exports = merge.smart(config,phaserConfig);