Skip to content

Commit 816a109

Browse files
committed
Fix #4. Proper work with chained sourcemaps
1 parent 820b6e5 commit 816a109

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

loader.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ function loadPlugins(pluginNames) {
1010
});
1111
}
1212

13-
function getOptions(sourceMapEnabled) {
13+
function getOptions(sourceMapEnabled, filename) {
1414
var options = utils.parseQuery(this.query);
1515

1616
//"add" should be a default option if not overrided in query
@@ -19,7 +19,6 @@ function getOptions(sourceMapEnabled) {
1919
}
2020

2121
if (sourceMapEnabled && options.sourcemap === undefined) {
22-
var filename = utils.getCurrentRequest(this);
2322
options.sourcemap = {
2423
inline: false,
2524
inFile: filename,
@@ -37,9 +36,10 @@ function getOptions(sourceMapEnabled) {
3736
module.exports = function(source, sm) {
3837
var mergeMap;
3938
var sourceMapEnabled = this.sourceMap;
39+
var filename = utils.getCurrentRequest(this);
4040
this.cacheable && this.cacheable();
4141

42-
var res = ngAnnotate(source, getOptions.call(this, sourceMapEnabled));
42+
var res = ngAnnotate(source, getOptions.call(this, sourceMapEnabled, filename));
4343

4444
if (sourceMapEnabled && sm) {
4545
var generator = SourceMapGenerator.fromSourceMap(new SourceMapConsumer(sm));

0 commit comments

Comments
 (0)