From 8ddbbf292a0b7caf784e071a2642a3a4c285f634 Mon Sep 17 00:00:00 2001 From: syuilo Date: Thu, 15 Mar 2018 04:41:05 +0900 Subject: [PATCH] Enable typescript source map --- gulpfile.ts | 3 +++ package.json | 1 + tsconfig.json | 2 +- 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/gulpfile.ts b/gulpfile.ts index aa6712914..df7f7e329 100644 --- a/gulpfile.ts +++ b/gulpfile.ts @@ -8,6 +8,7 @@ import * as Path from 'path'; import * as gulp from 'gulp'; import * as gutil from 'gulp-util'; import * as ts from 'gulp-typescript'; +const sourcemaps = require('gulp-sourcemaps'); import tslint from 'gulp-tslint'; import cssnano = require('gulp-cssnano'); import * as uglifyComposer from 'gulp-uglify/composer'; @@ -60,7 +61,9 @@ gulp.task('build:ts', () => { return tsProject .src() + .pipe(sourcemaps.init()) .pipe(tsProject()) + .pipe(sourcemaps.write('.', { includeContent: false, sourceRoot: '../built' })) .pipe(gulp.dest('./built/')); }); diff --git a/package.json b/package.json index 34870a6eb..b4674c246 100644 --- a/package.json +++ b/package.json @@ -121,6 +121,7 @@ "gulp-pug": "3.3.0", "gulp-rename": "1.2.2", "gulp-replace": "0.6.1", + "gulp-sourcemaps": "^2.6.4", "gulp-stylus": "2.7.0", "gulp-tslint": "8.1.3", "gulp-typescript": "3.2.4", diff --git a/tsconfig.json b/tsconfig.json index 9d26429c5..47aa521bf 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -8,7 +8,7 @@ "noUnusedLocals": true, "noFallthroughCasesInSwitch": true, "declaration": false, - "sourceMap": false, + "sourceMap": true, "target": "es2017", "module": "commonjs", "removeComments": false,