@wordpress/dependency-extraction-webpack-plugin 4.16.0 → 4.18.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/lib/index.js +10 -0
  2. package/package.json +2 -2
package/lib/index.js CHANGED
@@ -27,6 +27,7 @@ class DependencyExtractionWebpackPlugin {
27
27
  combinedOutputFile: null,
28
28
  externalizedReport: false,
29
29
  injectPolyfill: false,
30
+ __experimentalInjectInteractivityRuntime: false,
30
31
  outputFormat: 'php',
31
32
  outputFilename: null,
32
33
  useDefaults: true,
@@ -142,6 +143,7 @@ class DependencyExtractionWebpackPlugin {
142
143
  combinedOutputFile,
143
144
  externalizedReport,
144
145
  injectPolyfill,
146
+ __experimentalInjectInteractivityRuntime,
145
147
  outputFormat,
146
148
  outputFilename,
147
149
  } = this.options;
@@ -184,6 +186,14 @@ class DependencyExtractionWebpackPlugin {
184
186
  if ( injectPolyfill ) {
185
187
  chunkDeps.add( 'wp-polyfill' );
186
188
  }
189
+ // Temporary fix for Interactivity API until it gets moved to its package.
190
+ if ( __experimentalInjectInteractivityRuntime ) {
191
+ if ( ! chunkJSFile.startsWith( './interactivity/' ) ) {
192
+ chunkDeps.add( 'wp-interactivity-runtime' );
193
+ } else if ( './interactivity/runtime.min.js' === chunkJSFile ) {
194
+ chunkDeps.add( 'wp-interactivity-vendors' );
195
+ }
196
+ }
187
197
 
188
198
  const processModule = ( { userRequest } ) => {
189
199
  if ( this.externalizedDeps.has( userRequest ) ) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wordpress/dependency-extraction-webpack-plugin",
3
- "version": "4.16.0",
3
+ "version": "4.18.0",
4
4
  "description": "Extract WordPress script dependencies from webpack bundles.",
5
5
  "author": "The WordPress Contributors",
6
6
  "license": "GPL-2.0-or-later",
@@ -38,5 +38,5 @@
38
38
  "publishConfig": {
39
39
  "access": "public"
40
40
  },
41
- "gitHead": "e936127e1e13881f1a940b7bd1593a9e500147f3"
41
+ "gitHead": "a92f606309b1541b834ff9b0a76ed2a466fc45ed"
42
42
  }