Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,6 @@ function pattern_creator_init() {
'after'
);

wp_enqueue_script( 'wp-edit-site' );
wp_enqueue_script( 'wp-format-library' );
wp_enqueue_style( 'wp-edit-site' );
wp_enqueue_style( 'wp-format-library' );
Expand Down
20 changes: 20 additions & 0 deletions public_html/wp-content/plugins/pattern-creator/webpack.config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
const defaultConfig = require( '@wordpress/scripts/config/webpack.config' );
const DependencyExtractionWebpackPlugin = require( '@wordpress/dependency-extraction-webpack-plugin' );

const config = {
...defaultConfig,
Expand All @@ -7,6 +8,25 @@ const config = {
library: [ 'wp', 'patternCreator' ],
libraryTarget: 'window',
},

plugins: [
...defaultConfig.plugins.filter(
( plugin ) => plugin.constructor.name !== 'DependencyExtractionWebpackPlugin'
),
new DependencyExtractionWebpackPlugin( {
requestToExternal( request ) {
if (
request === '@wordpress/editor' ||
request === '@wordpress/icons' ||
request === '@wordpress/interface' ||
request === '@wordpress/fields' ||
request === '@wordpress/dataviews'
) {
return false;
}
},
} ),
],
};

module.exports = config;
Loading