mirror of
https://github.com/aspnet/JavaScriptServices.git
synced 2025-12-22 17:47:53 +00:00
Switch ES2015 example to use middleware inlined into Startup.cs instead of MVC controller/action
This commit is contained in:
@@ -1,9 +1,11 @@
|
||||
var fs = require('fs');
|
||||
var babelCore = require('babel-core');
|
||||
|
||||
module.exports = function(cb, fileContents, url) {
|
||||
var result = babelCore.transform(fileContents, {
|
||||
module.exports = function(cb, physicalPath, requestPath) {
|
||||
var originalContents = fs.readFileSync(physicalPath);
|
||||
var result = babelCore.transform(originalContents, {
|
||||
sourceMaps: 'inline',
|
||||
sourceFileName: '/sourcemapped/' + url
|
||||
sourceFileName: '/sourcemapped' + requestPath
|
||||
});
|
||||
cb(null, result.code);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user