Build Tools: Don't include .map files in the build.

These files are fairly large, and while they're useful in development, they're not needed in the final build.

Props pento, mcsf.
See #45201.



git-svn-id: https://develop.svn.wordpress.org/branches/5.0@43931 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Gary Pendergast 2018-11-22 02:04:51 +00:00
parent e55da18ea2
commit 2a0319b577
2 changed files with 8 additions and 3 deletions

View File

@ -71,7 +71,11 @@ module.exports = function(grunt) {
}
},
clean: {
all: [BUILD_DIR],
all: [
BUILD_DIR,
SOURCE_DIR + 'wp-includes/js/dist',
SOURCE_DIR + 'wp-includes/css/dist'
],
dynamic: {
dot: true,
expand: true,
@ -98,7 +102,8 @@ module.exports = function(grunt) {
'!wp-includes/js/jquery/jquery.masonry.js',
'!wp-includes/js/jquery/ui/*.js',
'!wp-includes/js/tinymce/tinymce.js',
'!wp-includes/version.php' // Exclude version.php
'!wp-includes/version.php', // Exclude version.php
'!**/*.map' // The build doesn't need .map files.
],
dest: BUILD_DIR
},

View File

@ -264,7 +264,7 @@ module.exports = function( env = { environment: 'production', watch: false, forc
watch: env.watch,
};
if ( config.mode !== 'production' ) {
if ( config.mode !== 'production' && ! env.forceBuildTarget ) {
config.devtool = process.env.SOURCEMAP || 'source-map';
}