Skip to content

Commit 56eeb1b

Browse files
committed
Delete output folder before building
1 parent d547f81 commit 56eeb1b

5 files changed

Lines changed: 130 additions & 11 deletions

File tree

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,18 @@
11
import * as gulp from 'gulp';
2-
import { compileTypeScript, watchTypeScript, copyViewCss } from './typescript';
2+
import { compileTypeScript, watchTypeScript, copyViewCss, cleanOutput } from './typescript';
33
import { compileTextMateGrammar } from './textmate';
44
import { copyTestData } from './tests';
55
import { compileView } from './webpack';
66
import { packageExtension } from './package';
77
import { injectAppInsightsKey } from './appInsights';
88

99
export const buildWithoutPackage =
10-
gulp.parallel(
11-
compileTypeScript, compileTextMateGrammar, compileView, copyTestData, copyViewCss
10+
gulp.series(
11+
cleanOutput,
12+
gulp.parallel(
13+
compileTypeScript, compileTextMateGrammar, compileView, copyTestData, copyViewCss
14+
)
1215
);
1316

14-
export { compileTextMateGrammar, watchTypeScript, compileTypeScript, copyTestData, injectAppInsightsKey };
17+
export { cleanOutput, compileTextMateGrammar, watchTypeScript, compileTypeScript, copyTestData, injectAppInsightsKey };
1518
export default gulp.series(buildWithoutPackage, injectAppInsightsKey, packageExtension);

extensions/ql-vscode/gulpfile.ts/typescript.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import * as colors from 'ansi-colors';
22
import * as gulp from 'gulp';
33
import * as sourcemaps from 'gulp-sourcemaps';
44
import * as ts from 'gulp-typescript';
5+
import * as del from 'del';
56

67
function goodReporter(): ts.reporter.Reporter {
78
return {
@@ -20,6 +21,10 @@ function goodReporter(): ts.reporter.Reporter {
2021

2122
const tsProject = ts.createProject('tsconfig.json');
2223

24+
export function cleanOutput() {
25+
return tsProject.projectDirectory ? del(tsProject.projectDirectory + '/out/*') : Promise.resolve();
26+
}
27+
2328
export function compileTypeScript() {
2429
return tsProject.src()
2530
.pipe(sourcemaps.init())

extensions/ql-vscode/package-lock.json

Lines changed: 116 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

extensions/ql-vscode/package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1016,6 +1016,7 @@
10161016
"@types/chai-as-promised": "~7.1.2",
10171017
"@types/child-process-promise": "^2.2.1",
10181018
"@types/classnames": "~2.2.9",
1019+
"@types/del": "^4.0.0",
10191020
"@types/fs-extra": "^9.0.6",
10201021
"@types/glob": "^7.1.1",
10211022
"@types/google-protobuf": "^3.2.7",
@@ -1049,6 +1050,7 @@
10491050
"chai": "^4.2.0",
10501051
"chai-as-promised": "~7.1.1",
10511052
"css-loader": "~3.1.0",
1053+
"del": "^6.0.0",
10521054
"eslint": "~6.8.0",
10531055
"eslint-plugin-react": "~7.19.0",
10541056
"glob": "^7.1.4",

package-lock.json

Lines changed: 0 additions & 6 deletions
This file was deleted.

0 commit comments

Comments
 (0)