I have a specific tsconfig.json
setup within an ASP.NET Core project:
{
"compilerOptions": {
"target": "es5",
"module": "commonjs",
"moduleResolution": "node",
"inlineSourceMap": true,
"inlineSources": true,
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"noEmitOnError": false,
"noImplicitAny": false,
"removeComments": false,
"outDir": "wwwroot/client-app"
},
"exclude": [
"node_modules",
"wwwroot",
"typings"
]
}
After building the project in Visual Studio, I noticed that the resulting js files contain inline source maps at the end of the file:
/// <reference path="../typings/index.d.ts" />
"use strict";
var platform_browser_dynamic_1 = require('@angular/platform-browser-dynamic');
var client_application_module_1 = require('./client-application.module');
platform_browser_dynamic_1.platformBrowserDynamic().bootstrapModule(client_application_module_1.ClientApplicationModule);
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYm9vdC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL0NsaWVudEFwcC9ib290LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLDhDQUE4Qzs7QUFFOUMseUNBQXVDLG1DQUFtQyxDQUFDLENBQUE7QUFDM0UsMENBQXdDLDZCQUE2QixDQUFDLENBQUE7QUFFdEUsaURBQXNCLEVBQUUsQ0FBQyxlQUFlLENBQUMsbURBQXVCLENBQUMsQ0FBQyIsInNvdXJjZXNDb250ZW50IjpbIi8vLyA8cmVmZXJlbmNlIHBhdGg9XCIuLi90eXBpbmdzL2luZGV4LmQudHNcIiAvPlxyXG5cclxuaW1wb3J0IHsgcGx...
However, when using Gulp to build the js files, the inline sourcemap is not being generated, as if it's ignoring the tsconfig.json
.
Below is my Gulp task for transpiling TypeScript into JavaScript:
var tsProject = ts.createProject('tsconfig.json');
gulp.task('transpile', function ()
{
var tsResult = gulp.src(["ClientApp/**/*.ts"])
.pipe(ts(tsProject), undefined, ts.reporter.fullReporter()).js
.pipe(gulp.dest('./wwwroot/client-app'));
});
Does additional configuration need to be added to Gulp in order to generate inline sourcemaps?
This project is utilizing TypeScript version 1.8.10.