Skip to content

Commit

Permalink
Add wp-polyfill dependency via webpack plugin
Browse files Browse the repository at this point in the history
Enable `injectPolyfill` option in the webpack plugin instead of manually
injecting the dependency via PHP on script registration.

This will enable the polyfill for consumers of wp-scripts default
webpack config.
  • Loading branch information
sirreal committed Apr 24, 2019
1 parent 1fd8613 commit 9a9cba1
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/client-assets.php
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ function gutenberg_register_packages_scripts() {
gutenberg_override_script(
$handle,
gutenberg_url( $gutenberg_path ),
array_merge( $dependencies, array( 'wp-polyfill' ) ),
$dependencies,
filemtime( $path ),
true
);
Expand Down
2 changes: 1 addition & 1 deletion packages/scripts/config/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ const config = {
// WP_LIVE_RELOAD_PORT global variable changes port on which live reload works
// when running watch mode.
! isProduction && new LiveReloadPlugin( { port: process.env.WP_LIVE_RELOAD_PORT || 35729 } ),
new DependencyExtractionWebpackPlugin(),
new DependencyExtractionWebpackPlugin( { injectPolyfill: true } ),
].filter( Boolean ),
stats: {
children: false,
Expand Down

0 comments on commit 9a9cba1

Please sign in to comment.