-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathwebpack.config.js
41 lines (39 loc) · 1015 Bytes
/
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
const path = require('path');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const CopyPlugin = require('copy-webpack-plugin');
const { CleanWebpackPlugin } = require('clean-webpack-plugin');
//const { GenerateSW } = require('workbox-webpack-plugin');
module.exports = {
output: {
path: path.resolve(__dirname, 'www'),
filename: 'js/game.js',
},
entry: {
main: './src/index.js',
},
module: {
rules: [
{
test: /\.js$/,
exclude: /node_modules/,
loader: "babel-loader"
}
]
},
plugins: [
new CleanWebpackPlugin(),
new HtmlWebpackPlugin({
filename: 'index.html',
template: 'src/index.html',
}),
new CopyPlugin({
patterns: [
{ from: 'src/phaser.min.js', to: 'js/phaser.min.js' },
{ from: 'src/site.webmanifest', to: 'site.webmanifest' },
{ from: 'src/images', to: 'images' },
{ from: 'src/sounds', to: 'sounds' },
{ from: 'icons', to: '.' },
],
}),
]
}