-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwebpack.config.js
More file actions
42 lines (40 loc) · 1 KB
/
webpack.config.js
File metadata and controls
42 lines (40 loc) · 1 KB
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
const path = require('path');
var webpack = require('webpack');
var HtmlWebpackPlugin = require('html-webpack-plugin');
var phaserModule = path.join(__dirname, '/node_modules/phaser/');
var phaser = path.join(phaserModule, 'build/custom/phaser-split.js'),
pixi = path.join(phaserModule, 'build/custom/pixi.js'),
p2 = path.join(phaserModule, 'build/custom/p2.js');
module.exports = {
entry: './js/game.js',
output: {
filename: 'bundle.js',
path: path.resolve(__dirname, 'dist')
},
devServer: {
contentBase: './dist',
port: 3000
},
module: {
loaders: [
{ test: /pixi.js/, use: "script-loader" },
{ test: /p2\.js/, use: 'script-loader' },
{ test: /\.(png|svg|jpg|gif|wav|mp3)$/, use: 'file-loader' }
]
},
resolve: {
alias: {
'phaser': phaser,
'pixi.js': pixi,
'p2': p2,
}
},
plugins: [
new HtmlWebpackPlugin({
title: 'titulo perro',
hash: true,
filename: 'index.html',
template: './index.html'
}),
]
};