Enable typescript source map

This commit is contained in:
syuilo 2018-03-15 04:41:05 +09:00
parent 0e1e9d85e7
commit ad9885cd6c
3 changed files with 5 additions and 1 deletions

View File

@ -8,6 +8,7 @@ import * as Path from 'path';
import * as gulp from 'gulp'; import * as gulp from 'gulp';
import * as gutil from 'gulp-util'; import * as gutil from 'gulp-util';
import * as ts from 'gulp-typescript'; import * as ts from 'gulp-typescript';
const sourcemaps = require('gulp-sourcemaps');
import tslint from 'gulp-tslint'; import tslint from 'gulp-tslint';
import cssnano = require('gulp-cssnano'); import cssnano = require('gulp-cssnano');
import * as uglifyComposer from 'gulp-uglify/composer'; import * as uglifyComposer from 'gulp-uglify/composer';
@ -60,7 +61,9 @@ gulp.task('build:ts', () => {
return tsProject return tsProject
.src() .src()
.pipe(sourcemaps.init())
.pipe(tsProject()) .pipe(tsProject())
.pipe(sourcemaps.write('.', { includeContent: false, sourceRoot: '../built' }))
.pipe(gulp.dest('./built/')); .pipe(gulp.dest('./built/'));
}); });

View File

@ -121,6 +121,7 @@
"gulp-pug": "3.3.0", "gulp-pug": "3.3.0",
"gulp-rename": "1.2.2", "gulp-rename": "1.2.2",
"gulp-replace": "0.6.1", "gulp-replace": "0.6.1",
"gulp-sourcemaps": "^2.6.4",
"gulp-stylus": "2.7.0", "gulp-stylus": "2.7.0",
"gulp-tslint": "8.1.3", "gulp-tslint": "8.1.3",
"gulp-typescript": "3.2.4", "gulp-typescript": "3.2.4",

View File

@ -8,7 +8,7 @@
"noUnusedLocals": true, "noUnusedLocals": true,
"noFallthroughCasesInSwitch": true, "noFallthroughCasesInSwitch": true,
"declaration": false, "declaration": false,
"sourceMap": false, "sourceMap": true,
"target": "es2017", "target": "es2017",
"module": "commonjs", "module": "commonjs",
"removeComments": false, "removeComments": false,