diff --git a/packages/block-library/package.json b/packages/block-library/package.json index 1353ef24c77d89..10d8e34e100ca5 100644 --- a/packages/block-library/package.json +++ b/packages/block-library/package.json @@ -31,6 +31,7 @@ "{src,build,build-module}/*/init.js" ], "wpScriptModuleExports": { + "./accordion-group/view": "./build-module/accordion-group/view.js", "./file/view": "./build-module/file/view.js", "./image/view": "./build-module/image/view.js", "./navigation/view": "./build-module/navigation/view.js", diff --git a/packages/block-library/src/accordion-group/index.php b/packages/block-library/src/accordion-group/index.php index 35c2767a29ea6e..281d5b873f1e70 100644 --- a/packages/block-library/src/accordion-group/index.php +++ b/packages/block-library/src/accordion-group/index.php @@ -17,7 +17,7 @@ function render_block_core_accordion_group( $attributes, $content ) { $suffix = wp_scripts_get_suffix(); if ( defined( 'IS_GUTENBERG_PLUGIN' ) && IS_GUTENBERG_PLUGIN ) { - $module_url = gutenberg_url( '/build/interactivity/accordionGroup.min.js' ); + $module_url = gutenberg_url( '/build-module/block-library/accordion-group/view.min.js' ); } wp_register_script_module( diff --git a/tools/webpack/interactivity.js b/tools/webpack/interactivity.js deleted file mode 100644 index 67d5879f738ad4..00000000000000 --- a/tools/webpack/interactivity.js +++ /dev/null @@ -1,87 +0,0 @@ -/** - * External dependencies - */ -const { join } = require( 'path' ); -const CopyWebpackPlugin = require( 'copy-webpack-plugin' ); -/** - * WordPress dependencies - */ -const DependencyExtractionWebpackPlugin = require( '@wordpress/dependency-extraction-webpack-plugin' ); - -/** - * Internal dependencies - */ -const { baseConfig, plugins } = require( './shared' ); - -module.exports = { - ...baseConfig, - name: 'interactivity', - entry: { - index: './packages/interactivity', - debug: './packages/interactivity/src/debug', - router: './packages/interactivity-router', - navigation: './packages/block-library/src/navigation/view.js', - query: './packages/block-library/src/query/view.js', - image: './packages/block-library/src/image/view.js', - file: './packages/block-library/src/file/view.js', - search: './packages/block-library/src/search/view.js', - accordionGroup: './packages/block-library/src/accordion-group/view.js', - }, - experiments: { - outputModule: true, - }, - output: { - devtoolNamespace: 'wp', - filename: './build/interactivity/[name].min.js', - library: { - type: 'module', - }, - path: join( __dirname, '..', '..' ), - environment: { module: true }, - module: true, - chunkFormat: 'module', - }, - resolve: { - extensions: [ '.js', '.ts', '.tsx' ], - }, - module: { - rules: [ - { - test: /\.(j|t)sx?$/, - exclude: /node_modules/, - use: [ - { - loader: require.resolve( 'babel-loader' ), - options: { - cacheDirectory: - process.env.BABEL_CACHE_DIRECTORY || true, - babelrc: false, - configFile: false, - presets: [ - '@babel/preset-typescript', - '@babel/preset-react', - ], - }, - }, - ], - }, - ], - }, - plugins: [ - ...plugins, - // TODO: Move it to a different Webpack file. - new CopyWebpackPlugin( { - patterns: [ - { - from: './node_modules/es-module-shims/dist/es-module-shims.wasm.js', - to: './build/modules/importmap-polyfill.min.js', - }, - ], - } ), - new DependencyExtractionWebpackPlugin(), - ], - watchOptions: { - ignored: [ '**/node_modules' ], - aggregateTimeout: 500, - }, -};