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. Merges [43931] and [43932] to trunk. See #45201. git-svn-id: https://develop.svn.wordpress.org/trunk@44282 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
dd9db2bf0d
commit
62a5cd343c
@ -105,7 +105,11 @@ module.exports = function(grunt) {
|
|||||||
clean: {
|
clean: {
|
||||||
plugins: [BUILD_DIR + 'wp-content/plugins'],
|
plugins: [BUILD_DIR + 'wp-content/plugins'],
|
||||||
themes: [BUILD_DIR + 'wp-content/themes'],
|
themes: [BUILD_DIR + 'wp-content/themes'],
|
||||||
all: cleanFiles,
|
all: [
|
||||||
|
cleanFiles,
|
||||||
|
SOURCE_DIR + 'wp-includes/js/dist',
|
||||||
|
SOURCE_DIR + 'wp-includes/css/dist'
|
||||||
|
],
|
||||||
js: [BUILD_DIR + 'wp-admin/js/', BUILD_DIR + 'wp-includes/js/'],
|
js: [BUILD_DIR + 'wp-admin/js/', BUILD_DIR + 'wp-includes/js/'],
|
||||||
dynamic: {
|
dynamic: {
|
||||||
dot: true,
|
dot: true,
|
||||||
@ -138,6 +142,7 @@ module.exports = function(grunt) {
|
|||||||
'!js/**', // JavaScript is extracted into separate copy tasks.
|
'!js/**', // JavaScript is extracted into separate copy tasks.
|
||||||
'!.{svn,git}', // Exclude version control folders.
|
'!.{svn,git}', // Exclude version control folders.
|
||||||
'!wp-includes/version.php', // Exclude version.php
|
'!wp-includes/version.php', // Exclude version.php
|
||||||
|
'!**/*.map', // The build doesn't need .map files.
|
||||||
'!index.php', '!wp-admin/index.php',
|
'!index.php', '!wp-admin/index.php',
|
||||||
'!_index.php', '!wp-admin/_index.php'
|
'!_index.php', '!wp-admin/_index.php'
|
||||||
] ),
|
] ),
|
||||||
|
@ -268,6 +268,14 @@ module.exports = function( env = { environment: 'production', watch: false, forc
|
|||||||
config.devtool = process.env.SOURCEMAP || 'source-map';
|
config.devtool = process.env.SOURCEMAP || 'source-map';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ( env.forceBuildTarget ) {
|
||||||
|
delete config.devtool;
|
||||||
|
config.mode = 'production';
|
||||||
|
config.optimization = {
|
||||||
|
minimize: false
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
if ( config.mode === 'development' ) {
|
if ( config.mode === 'development' ) {
|
||||||
config.plugins.push( new LiveReloadPlugin( { port: process.env.WORDPRESS_LIVE_RELOAD_PORT || 35729 } ) );
|
config.plugins.push( new LiveReloadPlugin( { port: process.env.WORDPRESS_LIVE_RELOAD_PORT || 35729 } ) );
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user