-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathwebpack.common.js
38 lines (35 loc) · 1.09 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
35
36
37
38
const path = require('path');
const phaser = path.join(__dirname, './node_modules/phaser/dist/phaser.js');
const howler = path.join(__dirname,'./node_modules/howler/dist/howler.min.js');
const phaserMatterPlugin = path.join(__dirname, './node_modules/phaser-matter-collision-plugin/dist/phaser-matter-collision-plugin.js');
const CopyPlugin = require('copy-webpack-plugin');
const { CleanWebpackPlugin } = require('clean-webpack-plugin');
const HtmlWebpackPlugin = require('html-webpack-plugin');
module.exports = {
entry: './src/main-game.ts',
output: {
path: path.resolve(__dirname, 'dist'),
filename: 'bundle.js',
},
module: {
rules: [
{ test: /\.ts$/, loader: 'ts-loader', exclude: '/node_modules/' },
{ test: /phaser\.js$/, loader: 'expose-loader?Phaser' }
]
},
plugins: [
new CopyPlugin([
{ from: 'resources', to: 'resources' },
{ from: 'src/index.html', to: '' },
]),
new CleanWebpackPlugin()
],
resolve: {
extensions: ['.ts', '.js'],
alias: {
howler: howler,
phaser: phaser,
phaserMatterPlugin : phaserMatterPlugin
}
}
};