Build Tools: Tweak the webpack config for unminified files.

[43931] unintentionally caused the unminified files to wrap the code in an `eval()` call. 

See #45201.



git-svn-id: https://develop.svn.wordpress.org/branches/5.0@43932 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Gary Pendergast 2018-11-22 03:11:22 +00:00
parent 2a0319b577
commit edbb865da0

View File

@ -264,10 +264,18 @@ module.exports = function( env = { environment: 'production', watch: false, forc
watch: env.watch,
};
if ( config.mode !== 'production' && ! env.forceBuildTarget ) {
if ( config.mode !== 'production' ) {
config.devtool = process.env.SOURCEMAP || 'source-map';
}
if ( env.forceBuildTarget ) {
delete config.devtool;
config.mode = 'production';
config.optimization = {
minimize: false
};
}
if ( config.mode === 'development' ) {
config.plugins.push( new LiveReloadPlugin( { port: process.env.WORDPRESS_LIVE_RELOAD_PORT || 35729 } ) );
}