Skip to content
This repository was archived by the owner on Aug 7, 2021. It is now read-only.

Commit 3fccf86

Browse files
fix: lazy-ngmodule-hot-loader breaks the sourceMaps (#770)
The `lazy-ngmodule-hot-loader` breaks sourceMaps as it does not pass them to the next loaders. This breaks debugging with `--bundle` in VSCode extension as the files included in the `sourcesContent` cannot be mapped correctly to local files.
1 parent aca851c commit 3fccf86

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

Diff for: lazy-ngmodule-hot-loader.js

+5-3
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,10 @@ const isLazyLoadedNgModule = resource => {
2121
return issuerContext && issuerContext.endsWith(LAZY_RESOURCE_CONTEXT);
2222
};
2323

24-
module.exports = function (source) {
25-
return isLazyLoadedNgModule(this._module) ?
26-
`${source};${HMR_HANDLER}` :
24+
module.exports = function (source, map) {
25+
const modifiedSource = isLazyLoadedNgModule(this._module) ?
26+
`${source};${HMR_HANDLER}`:
2727
source;
28+
29+
this.callback(null, modifiedSource, map);
2830
};

0 commit comments

Comments
 (0)