phaser/webpack.config.js
2018-04-20 01:10:04 +01:00

47 lines
1.2 KiB
JavaScript

'use strict';
const webpack = require('webpack');
const WebpackShellPlugin = require('webpack-shell-plugin');
module.exports = {
mode: 'development',
context: `${__dirname}/src/`,
entry: {
phaser: './phaser.js',
'phaser-core': './phaser-core.js'
},
output: {
path: `${__dirname}/build/`,
filename: '[name].js',
library: 'Phaser',
libraryTarget: 'umd',
sourceMapFilename: '[file].map',
devtoolModuleFilenameTemplate: 'webpack:///[resource-path]', // string
devtoolFallbackModuleFilenameTemplate: 'webpack:///[resource-path]?[hash]', // string
umdNamedDefine: true
},
module: {
rules: [
{
test: [ /\.vert$/, /\.frag$/ ],
use: 'raw-loader'
}
]
},
plugins: [
new webpack.DefinePlugin({
"typeof SHADER_REQUIRE": JSON.stringify(false),
"typeof CANVAS_RENDERER": JSON.stringify(true),
"typeof WEBGL_RENDERER": JSON.stringify(true)
}),
new WebpackShellPlugin({onBuildExit: 'node copy-to-examples.js'})
],
devtool: 'source-map'
};