Skip to content

Commit

Permalink
Remove polyfills from view.js block scripts (#35038)
Browse files Browse the repository at this point in the history
* Remove polyfills from block view scripts

* prettier fix

* Remove duplicate plugins
  • Loading branch information
aristath authored Oct 5, 2021
1 parent 67eab29 commit 573cf8d
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
6 changes: 6 additions & 0 deletions tools/webpack/blocks.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@ const { escapeRegExp } = require( 'lodash' );
const { join, sep } = require( 'path' );
const fastGlob = require( 'fast-glob' );

/**
* WordPress dependencies
*/
const DependencyExtractionWebpackPlugin = require( '@wordpress/dependency-extraction-webpack-plugin' );

/**
* Internal dependencies
*/
Expand Down Expand Up @@ -54,6 +59,7 @@ module.exports = {
},
plugins: [
...plugins,
new DependencyExtractionWebpackPlugin( { injectPolyfill: false } ),
new CopyWebpackPlugin( {
patterns: [].concat(
[
Expand Down
2 changes: 2 additions & 0 deletions tools/webpack/packages.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ const { join } = require( 'path' );
const {
camelCaseDash,
} = require( '@wordpress/dependency-extraction-webpack-plugin/lib/util' );
const DependencyExtractionWebpackPlugin = require( '@wordpress/dependency-extraction-webpack-plugin' );

/**
* Internal dependencies
Expand Down Expand Up @@ -65,6 +66,7 @@ module.exports = {
},
plugins: [
...plugins,
new DependencyExtractionWebpackPlugin( { injectPolyfill: true } ),
new CopyWebpackPlugin( {
patterns: gutenbergPackages.map( ( packageName ) => ( {
from: '*.css',
Expand Down
2 changes: 0 additions & 2 deletions tools/webpack/shared.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ const postcss = require( 'postcss' );
/**
* WordPress dependencies
*/
const DependencyExtractionWebpackPlugin = require( '@wordpress/dependency-extraction-webpack-plugin' );
const ReadableJsAssetsWebpackPlugin = require( '@wordpress/readable-js-assets-webpack-plugin' );

const {
Expand Down Expand Up @@ -72,7 +71,6 @@ const plugins = [
parseInt( process.env.npm_package_config_GUTENBERG_PHASE, 10 ) || 1
),
} ),
new DependencyExtractionWebpackPlugin( { injectPolyfill: true } ),
mode === 'production' && new ReadableJsAssetsWebpackPlugin(),
];

Expand Down

0 comments on commit 573cf8d

Please sign in to comment.