Build Tools: Minify the package CSS when building.
CSS coming from the `@wordpress` packages wasn't being minified in the build. This had the noteable side effect of causing RTL CSS to not be loaded when `SCRIPT_DEBUG` was set to `false`. Props websupporter. Merges [43905] to trunk. Fixes #45330. git-svn-id: https://develop.svn.wordpress.org/trunk@44252 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
e03dee4e87
commit
2b8464c5e5
10
Gruntfile.js
10
Gruntfile.js
|
@ -393,6 +393,15 @@ module.exports = function(grunt) {
|
||||||
'wp-includes/js/mediaelement/wp-mediaelement.css'
|
'wp-includes/js/mediaelement/wp-mediaelement.css'
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
dist: {
|
||||||
|
expand: true,
|
||||||
|
cwd: BUILD_DIR,
|
||||||
|
dest: BUILD_DIR,
|
||||||
|
ext: '.min.css',
|
||||||
|
src: [
|
||||||
|
'wp-includes/css/dist/*/*.css'
|
||||||
|
]
|
||||||
|
},
|
||||||
rtl: {
|
rtl: {
|
||||||
expand: true,
|
expand: true,
|
||||||
cwd: BUILD_DIR,
|
cwd: BUILD_DIR,
|
||||||
|
@ -1364,6 +1373,7 @@ module.exports = function(grunt) {
|
||||||
'usebanner',
|
'usebanner',
|
||||||
'webpack:prod',
|
'webpack:prod',
|
||||||
'webpack:devProdTarget',
|
'webpack:devProdTarget',
|
||||||
|
'cssmin:dist',
|
||||||
'jsvalidate:build'
|
'jsvalidate:build'
|
||||||
] );
|
] );
|
||||||
|
|
||||||
|
|
|
@ -1852,12 +1852,12 @@ function wp_default_styles( &$styles ) {
|
||||||
}
|
}
|
||||||
$styles->add( 'wp-editor-font', $fonts_url );
|
$styles->add( 'wp-editor-font', $fonts_url );
|
||||||
|
|
||||||
$styles->add( 'wp-block-library-theme', '/wp-includes/css/dist/block-library/theme.css' );
|
$styles->add( 'wp-block-library-theme', "/wp-includes/css/dist/block-library/theme$suffix.css" );
|
||||||
$styles->add_data( 'wp-block-library-theme', 'rtl', 'replace' );
|
$styles->add_data( 'wp-block-library-theme', 'rtl', 'replace' );
|
||||||
|
|
||||||
$styles->add(
|
$styles->add(
|
||||||
'wp-edit-blocks',
|
'wp-edit-blocks',
|
||||||
'/wp-includes/css/dist/block-library/editor.css',
|
"/wp-includes/css/dist/block-library/editor$suffix.css",
|
||||||
array(
|
array(
|
||||||
'wp-components',
|
'wp-components',
|
||||||
'wp-editor',
|
'wp-editor',
|
||||||
|
@ -1879,7 +1879,7 @@ function wp_default_styles( &$styles ) {
|
||||||
|
|
||||||
foreach ( $package_styles as $package => $dependencies ) {
|
foreach ( $package_styles as $package => $dependencies ) {
|
||||||
$handle = 'wp-' . $package;
|
$handle = 'wp-' . $package;
|
||||||
$path = '/wp-includes/css/dist/' . $package . '/style.css';
|
$path = "/wp-includes/css/dist/$package/style$suffix.css";
|
||||||
|
|
||||||
$styles->add( $handle, $path, $dependencies );
|
$styles->add( $handle, $path, $dependencies );
|
||||||
$styles->add_data( $handle, 'rtl', 'replace' );
|
$styles->add_data( $handle, 'rtl', 'replace' );
|
||||||
|
|
Loading…
Reference in New Issue