Skip to content

Commit

Permalink
Expose the full loader options to all overrides hooks.
Browse files Browse the repository at this point in the history
  • Loading branch information
loganfsmyth committed Sep 27, 2018
1 parent ac0c869 commit a507914
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/index.js
Expand Up @@ -83,7 +83,10 @@ async function loader(source, inputSourceMap, overrides) {

let customOptions;
if (overrides && overrides.customOptions) {
const result = await overrides.customOptions.call(this, loaderOptions);
const result = await overrides.customOptions.call(this, loaderOptions, {
source,
map: inputSourceMap,
});
customOptions = result.custom;
loaderOptions = result.loader;
}
Expand Down Expand Up @@ -154,6 +157,7 @@ async function loader(source, inputSourceMap, overrides) {
if (overrides && overrides.config) {
options = await overrides.config.call(this, config, {
source,
map: inputSourceMap,
customOptions,
});
}
Expand Down Expand Up @@ -203,6 +207,7 @@ async function loader(source, inputSourceMap, overrides) {
if (overrides && overrides.result) {
result = await overrides.result.call(this, result, {
source,
map: inputSourceMap,
customOptions,
config,
options,
Expand Down

0 comments on commit a507914

Please sign in to comment.