Skip to content

Commit a507914

Browse files
committed
Expose the full loader options to all overrides hooks.
1 parent ac0c869 commit a507914

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/index.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,10 @@ async function loader(source, inputSourceMap, overrides) {
8383

8484
let customOptions;
8585
if (overrides && overrides.customOptions) {
86-
const result = await overrides.customOptions.call(this, loaderOptions);
86+
const result = await overrides.customOptions.call(this, loaderOptions, {
87+
source,
88+
map: inputSourceMap,
89+
});
8790
customOptions = result.custom;
8891
loaderOptions = result.loader;
8992
}
@@ -154,6 +157,7 @@ async function loader(source, inputSourceMap, overrides) {
154157
if (overrides && overrides.config) {
155158
options = await overrides.config.call(this, config, {
156159
source,
160+
map: inputSourceMap,
157161
customOptions,
158162
});
159163
}
@@ -203,6 +207,7 @@ async function loader(source, inputSourceMap, overrides) {
203207
if (overrides && overrides.result) {
204208
result = await overrides.result.call(this, result, {
205209
source,
210+
map: inputSourceMap,
206211
customOptions,
207212
config,
208213
options,

0 commit comments

Comments
 (0)