Skip to content

Commit 301657a

Browse files
Enable inline source maps
1 parent 60d77e7 commit 301657a

2 files changed

Lines changed: 6 additions & 3 deletions

File tree

samples/misc/ES2015Transpilation/Controllers/ScriptController.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ public async Task<ContentResult> Transpile(string filename)
1212
{
1313
// TODO: Don't hard-code wwwroot; use proper path conversions
1414
var fileContents = System.IO.File.ReadAllText("wwwroot/" + filename);
15-
var transpiledResult = await nodeInstance.Invoke("transpilation.js", fileContents);
15+
var transpiledResult = await nodeInstance.Invoke("transpilation.js", fileContents, Request.Path.Value);
1616
return Content(transpiledResult, "application/javascript");
1717
}
1818
}
Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
var babelCore = require('babel-core');
22

3-
module.exports = function(cb, fileContents) {
4-
var result = babelCore.transform(fileContents, {});
3+
module.exports = function(cb, fileContents, url) {
4+
var result = babelCore.transform(fileContents, {
5+
sourceMaps: 'inline',
6+
sourceFileName: '/sourcemapped/' + url
7+
});
58
cb(null, result.code);
69
}

0 commit comments

Comments
 (0)