forked from github/vscode-codeql
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathview.ts
More file actions
43 lines (37 loc) · 1.14 KB
/
view.ts
File metadata and controls
43 lines (37 loc) · 1.14 KB
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
31
32
33
34
35
36
37
38
39
40
41
42
43
import { dest, src, watch } from "gulp";
import esbuild from "gulp-esbuild";
import { createProject } from "gulp-typescript";
import { goodReporter } from "./typescript";
import { pipeline } from "stream/promises";
import chromiumVersion from "./chromium-version.json";
const tsProject = createProject("src/view/tsconfig.json");
export function compileViewEsbuild() {
return pipeline(
src("./src/view/webview.tsx"),
esbuild({
outfile: "webview.js",
bundle: true,
format: "iife",
platform: "browser",
target: `chrome${chromiumVersion.chromiumVersion}`,
jsx: "automatic",
sourcemap: "linked",
sourceRoot: "..",
loader: {
".ttf": "file",
},
}),
dest("out"),
);
}
export function watchViewEsbuild() {
watch(["src/**/*.{ts,tsx}"], compileViewEsbuild);
}
export function checkViewTypeScript() {
// This doesn't actually output the TypeScript files, it just
// runs the TypeScript compiler and reports any errors.
return tsProject.src().pipe(tsProject(goodReporter()));
}
export function watchViewCheckTypeScript() {
watch(["src/**/*.{ts,tsx}"], checkViewTypeScript);
}