From 4fd47b00d40b173f52a108a08b0b84901d6200a5 Mon Sep 17 00:00:00 2001 From: mgechev Date: Sat, 20 Aug 2016 17:44:30 -0700 Subject: [PATCH] fix(build.dev): set proper sourceRoot Fix #1220 --- tools/config/seed.config.ts | 1 + tools/tasks/seed/build.js.dev.ts | 10 +++++++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/tools/config/seed.config.ts b/tools/config/seed.config.ts index cf73f101e..3516f2ee2 100644 --- a/tools/config/seed.config.ts +++ b/tools/config/seed.config.ts @@ -435,6 +435,7 @@ export class SeedConfig { server: { baseDir: `${this.DIST_DIR}/empty/`, routes: { + [`${this.APP_BASE}${this.APP_SRC}`]: this.APP_SRC, [`${this.APP_BASE}${this.APP_DEST}`]: this.APP_DEST, [`${this.APP_BASE}node_modules`]: 'node_modules', [`${this.APP_BASE.replace(/\/$/, '')}`]: this.APP_DEST diff --git a/tools/tasks/seed/build.js.dev.ts b/tools/tasks/seed/build.js.dev.ts index 2aa0768f7..486ed87d3 100644 --- a/tools/tasks/seed/build.js.dev.ts +++ b/tools/tasks/seed/build.js.dev.ts @@ -2,9 +2,9 @@ import * as gulp from 'gulp'; import * as gulpLoadPlugins from 'gulp-load-plugins'; import * as merge from 'merge-stream'; import * as util from 'gulp-util'; -import { join } from 'path'; +import { join, sep, relative } from 'path'; -import { APP_DEST, APP_SRC, TOOLS_DIR, TYPED_COMPILE_INTERVAL } from '../../config'; +import { APP_DEST, APP_SRC, PROJECT_ROOT, TOOLS_DIR, TYPED_COMPILE_INTERVAL } from '../../config'; import { makeTsProject, templateLocals } from '../../utils'; const plugins = gulpLoadPlugins(); @@ -57,7 +57,11 @@ export = () => { } return result.js - .pipe(plugins.sourcemaps.write()) + .pipe(plugins.sourcemaps.write('.', { + includeContent: false, + sourceRoot: (file: any) => + relative(file.path, PROJECT_ROOT + '/' + APP_SRC).replace(sep, '/') + '/' + APP_SRC + })) .pipe(plugins.template(templateLocals())) .pipe(gulp.dest(APP_DEST)); };