Skip to content
Permalink
Browse files

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
  • Loading branch information...
pento committed Nov 22, 2018
1 parent e55da18 commit 2a0319b577cb04d6512d3e590e6bdd9c5259349c
Showing with 8 additions and 3 deletions.
  1. +7 −2 Gruntfile.js
  2. +1 −1 tools/webpack/packages.js
@@ -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
},
@@ -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';
}

0 comments on commit 2a0319b

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