Skip to content

Commit bebebd6

Browse files
authored
fix: another node 10 fix (#1638)
* fix: another node 10 fix esbuild can minify syntax as well, and by default it targets esnext, which caused it to emit null coaslecing. Set the target explicitly to avoid this. * fix failing in unit tests
1 parent 3414392 commit bebebd6

File tree

2 files changed

+24
-9
lines changed

2 files changed

+24
-9
lines changed

gulpfile.js

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -201,19 +201,31 @@ async function compileTs({
201201
packages = [
202202
...packages,
203203
{ entry: `${srcDir}/common/hash/hash.ts`, library: false },
204-
{ entry: `${srcDir}/targets/node/bootloader.ts`, library: false },
205-
{ entry: `${srcDir}/targets/node/watchdog.ts`, library: false },
206-
{ entry: `${srcDir}/diagnosticTool/diagnosticTool.tsx`, library: false, target: 'browser' },
204+
{ entry: `${srcDir}/targets/node/bootloader.ts`, library: false, target: 'node10' },
205+
{ entry: `${srcDir}/targets/node/watchdog.ts`, library: false, target: 'node10' },
206+
{
207+
entry: `${srcDir}/diagnosticTool/diagnosticTool.tsx`,
208+
library: false,
209+
target: 'chrome102',
210+
platform: 'browser',
211+
},
207212
];
208213

209214
const define = await getConstantDefines();
210215

211216
let todo = [];
212-
for (const { entry, target = 'node', library, isInVsCode, nodePackages } of packages) {
217+
for (const {
218+
entry,
219+
platform = 'node',
220+
library,
221+
isInVsCode,
222+
nodePackages,
223+
target = 'node16',
224+
} of packages) {
213225
todo.push(
214226
incrementalEsbuild({
215227
entryPoints: [entry],
216-
platform: target,
228+
platform,
217229
bundle: true,
218230
outdir: buildSrcDir,
219231
resolveExtensions: isInVsCode
@@ -225,7 +237,8 @@ async function compileTs({
225237
packages: nodePackages,
226238
minify,
227239
define,
228-
alias: target === 'node' ? {} : { path: 'path-browserify' },
240+
target,
241+
alias: platform === 'node' ? {} : { path: 'path-browserify' },
229242
plugins: [
230243
esbuildPlugins.nativeNodeModulesPlugin(),
231244
esbuildPlugins.importGlobLazy(),

src/configuration.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1154,8 +1154,10 @@ declare const EXTENSION_NAME: string;
11541154
declare const EXTENSION_VERSION: string;
11551155
declare const EXTENSION_PUBLISHER: string;
11561156

1157-
export const packageName = EXTENSION_NAME;
1158-
export const packageVersion = EXTENSION_VERSION;
1159-
export const packagePublisher = EXTENSION_PUBLISHER;
1157+
export const packageName = typeof EXTENSION_NAME !== 'undefined' ? EXTENSION_NAME : 'js-debug';
1158+
export const packageVersion =
1159+
typeof EXTENSION_VERSION !== 'undefined' ? EXTENSION_VERSION : '0.0.0';
1160+
export const packagePublisher =
1161+
typeof EXTENSION_PUBLISHER !== 'undefined' ? EXTENSION_PUBLISHER : 'vscode-samples';
11601162
export const isNightly = packageName.includes('nightly');
11611163
export const extensionId = `${packagePublisher}.${packageName}`;

0 commit comments

Comments
 (0)