-
Notifications
You must be signed in to change notification settings - Fork 1
/
esbuild.js
31 lines (29 loc) · 1008 Bytes
/
esbuild.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
/**
* Copyright (c) 2023, salesforce.com, inc.
* All rights reserved.
* Licensed under the BSD 3-Clause license.
* For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
**/
/* eslint-disable @typescript-eslint/no-var-requires */
const { build } = require('esbuild');
const production = process.argv.includes('--production');
/**
* TODO: We have entryPoints and outfile to be the same since runTests looks for the extension's main to be at
* 'out/' as defined in package.json.We should refactor the tests not to rely on package.json and until then,
* the entryPoints and outfile will be the same with allowOverwrite set ti true.
*/
build({
entryPoints: ['out/extension.js'],
bundle: true,
platform: 'node',
target: 'es2020',
outfile: 'out/extension.js',
format: 'cjs',
external: ['vscode'],
sourcemap: !production,
minify: production,
allowOverwrite: true
}).catch((e) => {
console.error(e);
NodeJS.process.exit(1);
});