Skip to content

Commit a3da67f

Browse files
authored
Fix 'core/interface' registration error (#725)
1 parent b821bb5 commit a3da67f

File tree

2 files changed

+20
-1
lines changed

2 files changed

+20
-1
lines changed

public_html/wp-content/plugins/pattern-creator/pattern-creator.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,6 @@ function pattern_creator_init() {
182182
'after'
183183
);
184184

185-
wp_enqueue_script( 'wp-edit-site' );
186185
wp_enqueue_script( 'wp-format-library' );
187186
wp_enqueue_style( 'wp-edit-site' );
188187
wp_enqueue_style( 'wp-format-library' );

public_html/wp-content/plugins/pattern-creator/webpack.config.js

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
const defaultConfig = require( '@wordpress/scripts/config/webpack.config' );
2+
const DependencyExtractionWebpackPlugin = require( '@wordpress/dependency-extraction-webpack-plugin' );
23

34
const config = {
45
...defaultConfig,
@@ -7,6 +8,25 @@ const config = {
78
library: [ 'wp', 'patternCreator' ],
89
libraryTarget: 'window',
910
},
11+
12+
plugins: [
13+
...defaultConfig.plugins.filter(
14+
( plugin ) => plugin.constructor.name !== 'DependencyExtractionWebpackPlugin'
15+
),
16+
new DependencyExtractionWebpackPlugin( {
17+
requestToExternal( request ) {
18+
if (
19+
request === '@wordpress/editor' ||
20+
request === '@wordpress/icons' ||
21+
request === '@wordpress/interface' ||
22+
request === '@wordpress/fields' ||
23+
request === '@wordpress/dataviews'
24+
) {
25+
return false;
26+
}
27+
},
28+
} ),
29+
],
1030
};
1131

1232
module.exports = config;

0 commit comments

Comments
 (0)