forked from microsoft/rushstack
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPostProcessSourceMaps.ts
More file actions
30 lines (24 loc) · 966 Bytes
/
PostProcessSourceMaps.ts
File metadata and controls
30 lines (24 loc) · 966 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.
// See LICENSE in the project root for license information.
import { GulpTask } from '@microsoft/gulp-core-build';
import gulpType = require('gulp');
export class PostProcessSourceMaps extends GulpTask<void> {
public constructor() {
super('post-process');
}
public executeTask(gulp: gulpType.Gulp): NodeJS.ReadWriteStream | void {
if (this.buildConfig.args.hasOwnProperty('vscode')) {
// eslint-disable-next-line
const replace = require('gulp-replace');
return gulp.src(['dist/*!(.min).js.map'])
.pipe(replace('webpack:///./', ''))
.pipe(replace('webpack:////source/', ''))
.pipe(replace('webpack:////src/', ''))
.pipe(replace('webpack:///../~/', '../node_modules/'))
.pipe(replace('"sourceRoot":""', '"sourceRoot":"/"'))
.pipe(gulp.dest('dist/'));
} else {
return;
}
}
}