Skip to content

Commit

Permalink
Dependency extraction webpack plugin: Change option name consistent w…
Browse files Browse the repository at this point in the history
…ith docs (#15260)

In the docs, an option name was provided as `requestToHandle`, but the
actual option in use was `requestToDependency`.

Update the code and related tests to use `requestToHandle` as described
in the documentation instead of `requestToDependency`.
  • Loading branch information
sirreal authored Apr 30, 2019
1 parent 506827e commit 0b2eb1c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions packages/dependency-extraction-webpack-plugin/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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';
}
Expand Down

0 comments on commit 0b2eb1c

Please sign in to comment.