mirror of
https://github.com/photonstorm/phaser
synced 2024-12-21 02:23:29 +00:00
57 lines
1.7 KiB
JavaScript
57 lines
1.7 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'
|
|
},
|
|
|
|
devtool: 'source-map',
|
|
|
|
output: {
|
|
path: `${__dirname}/../build/`,
|
|
globalObject: 'this',
|
|
sourceMapFilename: '[file].map',
|
|
devtoolModuleFilenameTemplate: 'webpack:///[resource-path]', // string
|
|
devtoolFallbackModuleFilenameTemplate: 'webpack:///[resource-path]?[hash]', // string
|
|
filename: '[name].js',
|
|
library: {
|
|
name: 'Phaser',
|
|
type: 'umd',
|
|
umdNamedDefine: true,
|
|
}
|
|
},
|
|
|
|
performance: { hints: false },
|
|
|
|
plugins: [
|
|
new webpack.DefinePlugin({
|
|
"typeof CANVAS_RENDERER": JSON.stringify(true),
|
|
"typeof WEBGL_RENDERER": JSON.stringify(true),
|
|
"typeof WEBGL_DEBUG": JSON.stringify(true),
|
|
"typeof EXPERIMENTAL": JSON.stringify(true),
|
|
"typeof FEATURE_SOUND": JSON.stringify(true)
|
|
}),
|
|
{
|
|
apply: (compiler) => {
|
|
compiler.hooks.afterEmit.tap('AfterEmitPlugin', (compilation) => {
|
|
exec('node scripts/copy-to-examples-watch.js', (err, stdout, stderr) => {
|
|
if (stdout) process.stdout.write(stdout);
|
|
if (stderr) process.stderr.write(stderr);
|
|
});
|
|
});
|
|
}
|
|
}
|
|
],
|
|
|
|
devtool: 'source-map'
|
|
}
|
|
];
|