Build Tools: Copy package JavaScript and CSS into wp-includes.

- `grunt webpack:dev` now copies packages JS into `/src/wp-includes/js/dist`, and CSS into `/src/wp-includes/css/dist`.
- `grunt webpack:prod` does the same, but into `/build` instead of `/src`.
- `grunt build` now runs the `webpack:prod` task.

Merges [43760] from the 5.0 branch to trunk.

Props atimmer, pento.
Fixes #45119.



git-svn-id: https://develop.svn.wordpress.org/trunk@44159 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Gary Pendergast
2018-12-14 04:10:26 +00:00
parent 67f54c4696
commit 934f0ca2b8
4 changed files with 21 additions and 17 deletions

View File

@@ -96,7 +96,7 @@ function wp_default_packages_vendor( &$scripts ) {
$dependencies = array();
}
$path = "/js/dist/vendor/$handle$dev_suffix.js";
$path = "/wp-includes/js/dist/vendor/$handle$dev_suffix.js";
$scripts->add( $handle, $path, $dependencies, false, 1 );
}
@@ -336,8 +336,8 @@ function wp_default_packages_scripts( &$scripts ) {
);
foreach ( $packages_dependencies as $package => $dependencies ) {
$handle = 'wp-' . $package;
$path = "/js/dist/$package$suffix.js";
$handle = 'wp-' . $package;
$path = "/wp-includes/js/dist/$package$suffix.js";
$scripts->add( $handle, $path, $dependencies, false, 1 );
}
@@ -1800,12 +1800,12 @@ function wp_default_styles( &$styles ) {
}
$styles->add( 'wp-editor-font', $fonts_url );
$styles->add( 'wp-block-library-theme', '/styles/dist/block-library/theme.css' );
$styles->add( 'wp-block-library-theme', '/wp-includes/css/dist/block-library/theme.css' );
$styles->add_data( 'wp-block-library-theme', 'rtl', 'replace' );
$styles->add(
'wp-edit-blocks',
'/styles/dist/block-library/editor.css',
'/wp-includes/css/dist/block-library/editor.css',
array(
'wp-components',
'wp-editor',
@@ -1825,8 +1825,8 @@ function wp_default_styles( &$styles ) {
);
foreach ( $package_styles as $package => $dependencies ) {
$handle = 'wp-' . $package;
$path = '/styles/dist/' . $package . '/style.css';
$handle = 'wp-' . $package;
$path = '/wp-includes/css/dist/' . $package . '/style.css';
$styles->add( $handle, $path, $dependencies );
$styles->add_data( $handle, 'rtl', 'replace' );