From 96283c86ee7870ab0312cd011819eb65e1bcafb7 Mon Sep 17 00:00:00 2001 From: Jon Surrell Date: Tue, 26 Dec 2023 14:18:27 +0100 Subject: [PATCH] Try using DEWP for interactivity build --- tools/webpack/interactivity.js | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/tools/webpack/interactivity.js b/tools/webpack/interactivity.js index 03bb1f576cb78..cb05152da1b12 100644 --- a/tools/webpack/interactivity.js +++ b/tools/webpack/interactivity.js @@ -4,6 +4,11 @@ const { join } = require( 'path' ); const CopyWebpackPlugin = require( 'copy-webpack-plugin' ); +/** + * WordPress dependencies + */ +const DependencyExtractionWebpackPlugin = require( '@wordpress/dependency-extraction-webpack-plugin' ); + /** * Internal dependencies */ @@ -30,12 +35,9 @@ module.exports = { type: 'module', }, path: join( __dirname, '..', '..' ), + module: true, environment: { module: true }, }, - externalsType: 'module', - externals: { - '@wordpress/interactivity': '@wordpress/interactivity', - }, resolve: { extensions: [ '.js', '.ts', '.tsx' ], }, @@ -79,6 +81,8 @@ module.exports = { }, ], } ), + + new DependencyExtractionWebpackPlugin(), ], watchOptions: { ignored: [ '**/node_modules' ],