mirror of
git://develop.git.wordpress.org/
synced 2025-01-17 04:48:25 +01:00
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:
parent
2a0319b577
commit
edbb865da0
@ -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 } ) );
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user