Skip to content

Commit

Permalink
Build: Fix chunk name generation for babel-runtime group
Browse files Browse the repository at this point in the history
  • Loading branch information
gziolo committed Aug 29, 2018
1 parent f4b834c commit 9a90705
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
8 changes: 4 additions & 4 deletions lib/client-assets.php
Original file line number Diff line number Diff line change
Expand Up @@ -101,9 +101,9 @@ function gutenberg_register_scripts_and_styles() {

wp_register_script(
'wp-babel-runtime',
gutenberg_url( 'build/babel-runtime/0.index.js' ),
gutenberg_url( 'build/babel-runtime/babel-runtime.index.js' ),
array(),
filemtime( gutenberg_dir_path() . 'build/babel-runtime/0.index.js' ),
filemtime( gutenberg_dir_path() . 'build/babel-runtime/babel-runtime.index.js' ),
true
);

Expand Down Expand Up @@ -145,7 +145,7 @@ function gutenberg_register_scripts_and_styles() {
wp_register_script(
'wp-hooks',
gutenberg_url( 'build/hooks/index.js' ),
array(),
array( 'wp-babel-runtime' ),
filemtime( gutenberg_dir_path() . 'build/hooks/index.js' ),
true
);
Expand Down Expand Up @@ -237,7 +237,7 @@ function gutenberg_register_scripts_and_styles() {
wp_register_script(
'wp-html-entities',
gutenberg_url( 'build/html-entities/index.js' ),
array(),
array( 'wp-babel-runtime' ),
filemtime( gutenberg_dir_path() . 'build/html-entities/index.js' ),
true
);
Expand Down
3 changes: 2 additions & 1 deletion webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -210,10 +210,11 @@ const config = {
],
},
optimization: {
namedChunks: true,
splitChunks: {
cacheGroups: {
'babel-runtime': {
test: /[\\/]node_modules[\\/](core-js|@babel)[\\/]/,
test: /[\\/]node_modules[\\/](@babel|core-js|regenerator-runtime)[\\/]/,
name: 'babel-runtime',
chunks: 'all',
},
Expand Down

0 comments on commit 9a90705

Please sign in to comment.