diff --git a/webpack.config.js b/webpack.config.js index 009b0d942b..ff9901f2dd 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -415,7 +415,14 @@ function requestToExternal(request) { if (wcDepMap[request]) { return wcDepMap[request]; } - return undefined; + // DependencyExtractionWebpackPlugin has native handling for @wordpress/* + // packages, for that handling to kick in, we must not return anything from + // function. + /* eslint-disable consistent-return */ + /* eslint-disable no-useless-return */ + return; + /* eslint-enable consistent-return */ + /* eslint-enable no-useless-return */ } function requestToHandle(request) { @@ -426,7 +433,14 @@ function requestToHandle(request) { if (wcHandleMap[request]) { return wcHandleMap[request]; } - return undefined; + // DependencyExtractionWebpackPlugin has native handling for @wordpress/* + // packages, for that handling to kick in, we must not return anything from + // function. + /* eslint-disable consistent-return */ + /* eslint-disable no-useless-return */ + return; + /* eslint-enable consistent-return */ + /* eslint-enable no-useless-return */ } const marketingOptinBlock = Object.assign({}, wpScriptConfig, {