-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathgulpfile.js
42 lines (37 loc) · 1.22 KB
/
gulpfile.js
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
/*-----------------------------------------------------------------------------------------------
* Copyright (c) Kamesh Sampath<[email protected]>. All rights reserved.
* Licensed under the MIT License. See LICENSE file in the project root for license information.
*-----------------------------------------------------------------------------------------------*/
const { src, dest, series } = require("gulp");
const { createGulpEsbuild } = require("gulp-esbuild");
const gulpEsbuild = createGulpEsbuild({
incremental: true,
pipe: true,
});
const rimraf = require("rimraf");
const vsce = require("vsce");
const buildOpts = {
bundle: true,
external: ["vscode", "shelljs", "bufferutil", "utf-8-validate", "spawn-sync"],
platform: "node",
format: "cjs",
outfile: "extension.js",
write: true,
};
function clean(cb) {
rimraf.sync("./out");
cb();
}
function build() {
const prodBuildOpts = Object.assign({ minify: true }, buildOpts);
return src("./src/extension.ts")
.pipe(gulpEsbuild(prodBuildOpts))
.pipe(dest("./out"));
}
function package() {
return vsce.createVSIX({ useYarn: true });
}
exports.clean = clean;
exports.build = build;
exports.package = package;
exports.default = series(clean, build);