mirror of
https://github.com/photonstorm/phaser
synced 2024-11-21 12:13:19 +00:00
Create webpack-nospector.config.js
This commit is contained in:
parent
353459a838
commit
53a0408b64
1 changed files with 60 additions and 0 deletions
60
config/webpack-nospector.config.js
Normal file
60
config/webpack-nospector.config.js
Normal file
|
@ -0,0 +1,60 @@
|
|||
'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(false),
|
||||
"typeof EXPERIMENTAL": JSON.stringify(true),
|
||||
"typeof PLUGIN_3D": JSON.stringify(false),
|
||||
"typeof PLUGIN_CAMERA3D": JSON.stringify(false),
|
||||
"typeof PLUGIN_FBINSTANT": JSON.stringify(false),
|
||||
"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'
|
||||
}
|
||||
];
|
Loading…
Reference in a new issue