phaser/webpack.config.js
Richard Davey b25ff9e065 Moved Camera3D to optional plugin
Also included build flag to allow it to be compiled into the standard lib if required (saves a bunch of KB in duplicated classes)
2018-08-23 15:30:21 +01:00

48 lines
1.4 KiB
JavaScript

'use strict';
const webpack = require('webpack');
const exec = require('child_process').exec;
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
},
performance: { hints: false },
plugins: [
new webpack.DefinePlugin({
"typeof CANVAS_RENDERER": JSON.stringify(true),
"typeof WEBGL_RENDERER": JSON.stringify(true),
"typeof PLUGIN_CAMERA3D": JSON.stringify(false)
}),
{
apply: (compiler) => {
compiler.hooks.afterEmit.tap('AfterEmitPlugin', (compilation) => {
exec('node scripts/copy-to-examples.js', (err, stdout, stderr) => {
if (stdout) process.stdout.write(stdout);
if (stderr) process.stderr.write(stderr);
});
});
}
}
],
devtool: 'source-map'
};