Skip to content
Permalink
Browse files

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
  • Loading branch information...
pento committed Nov 22, 2018
1 parent 2a0319b commit edbb865da0410182a36695160abecb35885a4f4c
Showing with 9 additions and 1 deletion.
  1. +9 −1 tools/webpack/packages.js
@@ -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 } ) );
}

0 comments on commit edbb865

Please sign in to comment.
You can’t perform that action at this time.