mirror of
https://github.com/aspnet/JavaScriptServices.git
synced 2025-12-22 17:47:53 +00:00
Enable inline source maps
This commit is contained in:
@@ -12,7 +12,7 @@ namespace ES2015Example.Controllers
|
|||||||
{
|
{
|
||||||
// TODO: Don't hard-code wwwroot; use proper path conversions
|
// TODO: Don't hard-code wwwroot; use proper path conversions
|
||||||
var fileContents = System.IO.File.ReadAllText("wwwroot/" + filename);
|
var fileContents = System.IO.File.ReadAllText("wwwroot/" + filename);
|
||||||
var transpiledResult = await nodeInstance.Invoke("transpilation.js", fileContents);
|
var transpiledResult = await nodeInstance.Invoke("transpilation.js", fileContents, Request.Path.Value);
|
||||||
return Content(transpiledResult, "application/javascript");
|
return Content(transpiledResult, "application/javascript");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,9 @@
|
|||||||
var babelCore = require('babel-core');
|
var babelCore = require('babel-core');
|
||||||
|
|
||||||
module.exports = function(cb, fileContents) {
|
module.exports = function(cb, fileContents, url) {
|
||||||
var result = babelCore.transform(fileContents, {});
|
var result = babelCore.transform(fileContents, {
|
||||||
|
sourceMaps: 'inline',
|
||||||
|
sourceFileName: '/sourcemapped/' + url
|
||||||
|
});
|
||||||
cb(null, result.code);
|
cb(null, result.code);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user