diff --git a/src/server-cli.js b/src/server-cli.js index dc7fa459f03..559af5e422c 100644 --- a/src/server-cli.js +++ b/src/server-cli.js @@ -6,6 +6,10 @@ // @ts-check 'use strict'; +// Keep bootstrap-amd.js from redefining 'fs'. +// TODO@esm this needs to be revisited in ESM +delete process.env['ELECTRON_RUN_AS_NODE']; + // ESM-comment-begin const path = require('path'); const bootstrapNode = require('./bootstrap-node'); @@ -26,9 +30,6 @@ const product = require('./bootstrap-meta').product; async function start() { - // Keep bootstrap-amd.js from redefining 'fs'. - delete process.env['ELECTRON_RUN_AS_NODE']; - // NLS const nlsConfiguration = await resolveNLSConfiguration({ userLocale: 'en', osLocale: 'en', commit: product.commit, userDataPath: '', nlsMetadataPath: __dirname }); process.env['VSCODE_NLS_CONFIG'] = JSON.stringify(nlsConfiguration); // required for `bootstrap-amd` to pick up NLS messages diff --git a/src/server-main.js b/src/server-main.js index 141101518b9..bc7c383e587 100644 --- a/src/server-main.js +++ b/src/server-main.js @@ -11,6 +11,10 @@ * @import { IServerAPI } from './vs/server/node/remoteExtensionHostAgentServer' */ +// Keep bootstrap-amd.js from redefining 'fs'. +// TODO@esm this needs to be revisited in ESM +delete process.env['ELECTRON_RUN_AS_NODE']; + // ESM-comment-begin const path = require('path'); const http = require('http'); @@ -279,7 +283,6 @@ async function findFreePort(host, start, end) { */ function loadCode(nlsConfiguration) { return new Promise((resolve, reject) => { - delete process.env['ELECTRON_RUN_AS_NODE']; // Keep bootstrap-amd.js from redefining 'fs'. /** @type {INLSConfiguration} */ process.env['VSCODE_NLS_CONFIG'] = JSON.stringify(nlsConfiguration); // required for `bootstrap-amd` to pick up NLS messages