2016-11-22 16:25:54 +00:00
|
|
|
'use strict';
|
|
|
|
|
|
|
|
const webpack = require('webpack');
|
2018-05-25 15:43:31 +00:00
|
|
|
const exec = require('child_process').exec;
|
2016-11-22 16:25:54 +00:00
|
|
|
|
2016-11-22 03:32:41 +00:00
|
|
|
module.exports = {
|
2018-03-20 12:24:42 +00:00
|
|
|
mode: 'development',
|
2016-11-22 16:25:54 +00:00
|
|
|
|
2019-05-08 21:38:02 +00:00
|
|
|
context: `${__dirname}/../src/`,
|
2016-11-22 16:25:54 +00:00
|
|
|
|
2018-04-13 16:05:45 +00:00
|
|
|
entry: {
|
2018-09-20 13:14:44 +00:00
|
|
|
phaser: './phaser.js'
|
2018-04-13 16:05:45 +00:00
|
|
|
},
|
2016-11-22 16:25:54 +00:00
|
|
|
|
2022-02-04 14:22:10 +00:00
|
|
|
devtool: 'source-map',
|
|
|
|
|
2016-11-22 03:32:41 +00:00
|
|
|
output: {
|
2019-05-08 21:38:02 +00:00
|
|
|
path: `${__dirname}/../build/`,
|
2016-11-22 16:25:54 +00:00
|
|
|
filename: '[name].js',
|
2016-11-29 15:25:14 +00:00
|
|
|
library: 'Phaser',
|
|
|
|
libraryTarget: 'umd',
|
|
|
|
sourceMapFilename: '[file].map',
|
2018-03-20 12:24:42 +00:00
|
|
|
devtoolModuleFilenameTemplate: 'webpack:///[resource-path]', // string
|
|
|
|
devtoolFallbackModuleFilenameTemplate: 'webpack:///[resource-path]?[hash]', // string
|
2021-01-19 09:41:31 +00:00
|
|
|
umdNamedDefine: true,
|
|
|
|
globalObject: 'this'
|
2016-11-22 16:25:54 +00:00
|
|
|
},
|
|
|
|
|
2018-05-08 22:29:42 +00:00
|
|
|
performance: { hints: false },
|
|
|
|
|
2016-11-24 01:35:02 +00:00
|
|
|
plugins: [
|
2017-09-13 14:27:43 +00:00
|
|
|
new webpack.DefinePlugin({
|
2018-04-19 23:23:24 +00:00
|
|
|
"typeof CANVAS_RENDERER": JSON.stringify(true),
|
2018-08-23 14:30:21 +00:00
|
|
|
"typeof WEBGL_RENDERER": JSON.stringify(true),
|
2018-10-18 13:59:27 +00:00
|
|
|
"typeof EXPERIMENTAL": JSON.stringify(true),
|
2020-10-13 10:04:52 +00:00
|
|
|
"typeof PLUGIN_3D": JSON.stringify(false),
|
2018-08-23 17:09:37 +00:00
|
|
|
"typeof PLUGIN_CAMERA3D": JSON.stringify(false),
|
2019-04-24 11:23:21 +00:00
|
|
|
"typeof PLUGIN_FBINSTANT": JSON.stringify(false),
|
|
|
|
"typeof FEATURE_SOUND": JSON.stringify(true)
|
2017-09-13 14:27:43 +00:00
|
|
|
}),
|
2018-05-25 15:43:31 +00:00
|
|
|
{
|
|
|
|
apply: (compiler) => {
|
|
|
|
compiler.hooks.afterEmit.tap('AfterEmitPlugin', (compilation) => {
|
2021-10-19 17:42:48 +00:00
|
|
|
exec('node scripts/copy-to-examples-watch.js', (err, stdout, stderr) => {
|
2018-05-25 15:43:31 +00:00
|
|
|
if (stdout) process.stdout.write(stdout);
|
|
|
|
if (stderr) process.stderr.write(stderr);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
2016-11-29 15:25:14 +00:00
|
|
|
],
|
|
|
|
|
2018-02-13 03:23:29 +00:00
|
|
|
devtool: 'source-map'
|
2016-11-22 03:32:41 +00:00
|
|
|
};
|