2018-09-20 13:13:59 +00:00
|
|
|
'use strict';
|
|
|
|
|
|
|
|
const webpack = require('webpack');
|
|
|
|
const exec = require('child_process').exec;
|
|
|
|
|
|
|
|
module.exports = {
|
|
|
|
mode: 'development',
|
|
|
|
|
2019-05-08 21:38:02 +00:00
|
|
|
context: `${__dirname}/../src/`,
|
2018-09-20 13:13:59 +00:00
|
|
|
|
|
|
|
entry: {
|
|
|
|
phaser: './phaser.js'
|
|
|
|
},
|
|
|
|
|
|
|
|
output: {
|
2019-05-08 21:38:02 +00:00
|
|
|
path: `${__dirname}/../build/`,
|
2018-09-20 13:13:59 +00:00
|
|
|
filename: 'phaser-facebook-instant-games.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 EXPERIMENTAL": JSON.stringify(false),
|
|
|
|
"typeof PLUGIN_CAMERA3D": JSON.stringify(false),
|
2019-04-24 11:23:21 +00:00
|
|
|
"typeof PLUGIN_FBINSTANT": JSON.stringify(true),
|
|
|
|
"typeof FEATURE_SOUND": JSON.stringify(true)
|
2018-09-20 13:13:59 +00:00
|
|
|
}),
|
|
|
|
{
|
|
|
|
apply: (compiler) => {
|
|
|
|
compiler.hooks.afterEmit.tap('AfterEmitPlugin', (compilation) => {
|
|
|
|
exec('node scripts/copy-to-examples-fb.js', (err, stdout, stderr) => {
|
|
|
|
if (stdout) process.stdout.write(stdout);
|
|
|
|
if (stderr) process.stderr.write(stderr);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
],
|
|
|
|
|
|
|
|
devtool: 'source-map'
|
|
|
|
};
|