diff --git a/packages/dependency-extraction-webpack-plugin/index.js b/packages/dependency-extraction-webpack-plugin/index.js index 5e067856671cd4..f99ec61fa27baf 100644 --- a/packages/dependency-extraction-webpack-plugin/index.js +++ b/packages/dependency-extraction-webpack-plugin/index.js @@ -54,9 +54,9 @@ class DependencyExtractionWebpackPlugin { } mapRequestToDependency( request ) { - // Handle via options.requestToDependency first - if ( typeof this.options.requestToDependency === 'function' ) { - const scriptDependency = this.options.requestToDependency( request ); + // Handle via options.requestToHandle first + if ( typeof this.options.requestToHandle === 'function' ) { + const scriptDependency = this.options.requestToHandle( request ); if ( scriptDependency ) { return scriptDependency; } diff --git a/packages/dependency-extraction-webpack-plugin/test/fixtures/overrides/webpack.config.js b/packages/dependency-extraction-webpack-plugin/test/fixtures/overrides/webpack.config.js index e72c63ad010a25..f61163ae384602 100644 --- a/packages/dependency-extraction-webpack-plugin/test/fixtures/overrides/webpack.config.js +++ b/packages/dependency-extraction-webpack-plugin/test/fixtures/overrides/webpack.config.js @@ -12,7 +12,7 @@ module.exports = { return [ 'rxjs', 'operators' ]; } }, - requestToDependency( request ) { + requestToHandle( request ) { if ( request === 'rxjs' || request === 'rxjs/operators' ) { return 'wp-script-handle-for-rxjs'; }