-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.dev.config.js
50 lines (47 loc) · 1.5 KB
/
webpack.dev.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
const path = require('path');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const TSLintPlugin = require('tslint-webpack-plugin');
const phaserModule = path.join(__dirname, '/node_modules/phaser-ce/');
const phaser = path.join(phaserModule, 'build/custom/phaser-arcade-physics.js');
const pixi = path.join(phaserModule, 'build/custom/pixi.js');
const p2 = path.join(phaserModule, 'build/custom/p2.js');
const howler = path.join(__dirname, '/node_modules/howler/dist/howler.min.js');
module.exports = {
entry: {
app: [
path.resolve(__dirname, 'src/app.ts')
]
},
output: {
filename: '[name].bundle.js',
path: path.resolve('./dist'),
publicPath: '/'
},
plugins: [
new TSLintPlugin({
files: ['./src/**/*.ts']
}),
new HtmlWebpackPlugin({
template: './index.html',
inject: 'body'
})
],
module: {
rules: [
{ test: /\.ts?$/, loader: 'ts-loader', exclude: '/node_modules/' },
{ test: /pixi\.js/, loader: 'expose-loader?PIXI' },
{ test: /phaser-arcade-physics\.js/, loader: 'expose-loader?Phaser' },
{ test: /howler\.min\.js/, loader: 'expose-loader?Howler' },
{ test: /p2\.js$/, loader: 'expose-loader?p2' }
]
},
resolve: {
extensions: ['.js', '.ts'],
alias: {
'phaser': phaser,
'pixi': pixi,
'p2': p2,
'howler': howler
}
}
};