From 6a724c085d261d683b43ccbd53df627a62514b5b Mon Sep 17 00:00:00 2001 From: Luigi Teschio Date: Mon, 7 Jul 2025 10:08:23 +0200 Subject: [PATCH] Fix 'core/interface' registration error --- .../pattern-creator/pattern-creator.php | 1 - .../plugins/pattern-creator/webpack.config.js | 20 +++++++++++++++++++ 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/public_html/wp-content/plugins/pattern-creator/pattern-creator.php b/public_html/wp-content/plugins/pattern-creator/pattern-creator.php index d6c7bb5ef..33c1f45be 100644 --- a/public_html/wp-content/plugins/pattern-creator/pattern-creator.php +++ b/public_html/wp-content/plugins/pattern-creator/pattern-creator.php @@ -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' ); diff --git a/public_html/wp-content/plugins/pattern-creator/webpack.config.js b/public_html/wp-content/plugins/pattern-creator/webpack.config.js index 88a4832ea..2de405cb8 100644 --- a/public_html/wp-content/plugins/pattern-creator/webpack.config.js +++ b/public_html/wp-content/plugins/pattern-creator/webpack.config.js @@ -1,4 +1,5 @@ const defaultConfig = require( '@wordpress/scripts/config/webpack.config' ); +const DependencyExtractionWebpackPlugin = require( '@wordpress/dependency-extraction-webpack-plugin' ); const config = { ...defaultConfig, @@ -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;