-
Notifications
You must be signed in to change notification settings - Fork 20
/
webpack.common.js
34 lines (32 loc) · 1.15 KB
/
webpack.common.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')
const pixi = path.join(phaserModule, 'build/custom/pixi.js')
const p2 = path.join(phaserModule, 'build/custom/p2.js')
module.exports = {
target: "web",
output: {
path: path.resolve(__dirname, 'dist'),
filename: 'renjs.js',
library: 'RenJS',
libraryTarget: "var",
globalObject: "this"
},
module: {
rules: [
{ test: /\.ts?$/, loader: 'ts-loader', exclude: /node_modules/ },
// { test: /\.js$/, loader: 'babel-loader', include: path.join(__dirname, 'src') },
{ test: /pixi\.js/, loader: 'expose-loader', options: { exposes: ['PIXI'] } },
{ test: /phaser-split\.js$/, loader: 'expose-loader', options: { exposes: ['Phaser'] } },
{ test: /p2\.js/, loader: 'expose-loader', options: { exposes: ['p2'] } }
]
},
resolve: {
extensions: ['.js', '.ts'],
alias: {
'phaser-ce': phaser,
'pixi': pixi,
'p2': p2
}
}
};