Skip to content

Commit

Permalink
fix(build.dev): set proper sourceRoot
Browse files Browse the repository at this point in the history
Fix #1220
  • Loading branch information
mgechev committed Aug 21, 2016
1 parent 55c7359 commit 4fd47b0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
1 change: 1 addition & 0 deletions tools/config/seed.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 7 additions & 3 deletions tools/tasks/seed/build.js.dev.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 = <any>gulpLoadPlugins();
Expand Down Expand Up @@ -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));
};

0 comments on commit 4fd47b0

Please sign in to comment.