diff --git a/build/gulpfile.compile.js b/build/gulpfile.compile.js index d10a87f9f8a..c3049784fe4 100644 --- a/build/gulpfile.compile.js +++ b/build/gulpfile.compile.js @@ -14,6 +14,7 @@ const compilation = require('./lib/compilation'); const compileBuildTask = task.define('compile-build', task.series( util.rimraf('out-build'), + util.buildWebNodePaths('out-build'), compilation.compileTask('src', 'out-build', true) ) ); diff --git a/build/gulpfile.js b/build/gulpfile.js index ca00206281e..efb00f69481 100644 --- a/build/gulpfile.js +++ b/build/gulpfile.js @@ -16,10 +16,10 @@ const { monacoTypecheckTask/* , monacoTypecheckWatchTask */ } = require('./gulpf const { compileExtensionsTask, watchExtensionsTask, compileExtensionMediaTask } = require('./gulpfile.extensions'); // Fast compile for development time -const compileClientTask = task.define('compile-client', task.series(util.rimraf('out'), util.buildWebNodePaths(), compilation.compileTask('src', 'out', false))); +const compileClientTask = task.define('compile-client', task.series(util.rimraf('out'), util.buildWebNodePaths('out'), compilation.compileTask('src', 'out', false))); gulp.task(compileClientTask); -const watchClientTask = task.define('watch-client', task.series(util.rimraf('out'), util.buildWebNodePaths(), compilation.watchTask('out', false))); +const watchClientTask = task.define('watch-client', task.series(util.rimraf('out'), util.buildWebNodePaths('out'), compilation.watchTask('out', false))); gulp.task(watchClientTask); // All diff --git a/build/lib/util.js b/build/lib/util.js index acc96f901f3..6821ff165b0 100644 --- a/build/lib/util.js +++ b/build/lib/util.js @@ -274,7 +274,7 @@ function getElectronVersion() { return target; } exports.getElectronVersion = getElectronVersion; -function buildWebNodePaths() { +function buildWebNodePaths(outDir) { const result = () => new Promise((resolve, _) => { var _a; const root = path.join(__dirname, '..', '..'); @@ -300,7 +300,7 @@ function buildWebNodePaths() { nodePaths[key] = entryPoint; } // Now we write the node paths to out/vs - const outDirectory = path.join(root, 'out', 'vs'); + const outDirectory = path.join(root, outDir, 'vs'); fs.mkdirSync(outDirectory, { recursive: true }); const headerWithGeneratedFileWarning = `/*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. diff --git a/build/lib/util.ts b/build/lib/util.ts index 940dd22865d..8b702b33bf6 100644 --- a/build/lib/util.ts +++ b/build/lib/util.ts @@ -341,32 +341,37 @@ export function getElectronVersion(): string { return target; } -export function buildWebNodePaths() { +export function acquireWebNodePaths() { + const root = path.join(__dirname, '..', '..'); + const webPackageJSON = path.join(root, '/remote/web', 'package.json'); + const webPackages = JSON.parse(fs.readFileSync(webPackageJSON, 'utf8')).dependencies; + const nodePaths: { [key: string]: string } = {}; + for (const key of Object.keys(webPackages)) { + const packageJSON = path.join(root, 'node_modules', key, 'package.json'); + const packageData = JSON.parse(fs.readFileSync(packageJSON, 'utf8')); + let entryPoint = packageData.browser ?? packageData.main; + // On rare cases a package doesn't have an entrypoint so we assume it has a dist folder with a min.js + if (!entryPoint) { + console.warn(`No entry point for ${key} assuming dist/${key}.min.js`); + entryPoint = `dist/${key}.min.js`; + } + // Remove any starting path information so it's all relative info + if (entryPoint.startsWith('./')) { + entryPoint = entryPoint.substr(2); + } else if (entryPoint.startsWith('/')) { + entryPoint = entryPoint.substr(1); + } + nodePaths[key] = entryPoint; + } + return nodePaths; +} + +export function buildWebNodePaths(outDir: string) { const result = () => new Promise((resolve, _) => { const root = path.join(__dirname, '..', '..'); - const webPackageJSON = path.join(root, '/remote/web', 'package.json'); - const webPackages = JSON.parse(fs.readFileSync(webPackageJSON, 'utf8')).dependencies; - const nodePaths: { [key: string]: string } = {}; - for (const key of Object.keys(webPackages)) { - const packageJSON = path.join(root, 'node_modules', key, 'package.json'); - const packageData = JSON.parse(fs.readFileSync(packageJSON, 'utf8')); - let entryPoint = packageData.browser ?? packageData.main; - // On rare cases a package doesn't have an entrypoint so we assume it has a dist folder with a min.js - if (!entryPoint) { - console.warn(`No entry point for ${key} assuming dist/${key}.min.js`); - entryPoint = `dist/${key}.min.js`; - } - // Remove any starting path information so it's all relative info - if (entryPoint.startsWith('./')) { - entryPoint = entryPoint.substr(2); - } else if (entryPoint.startsWith('/')) { - entryPoint = entryPoint.substr(1); - } - nodePaths[key] = entryPoint; - } - + const nodePaths = acquireWebNodePaths(); // Now we write the node paths to out/vs - const outDirectory = path.join(root, 'out', 'vs'); + const outDirectory = path.join(root, outDir, 'vs'); fs.mkdirSync(outDirectory, { recursive: true }); const headerWithGeneratedFileWarning = `/*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. diff --git a/package.json b/package.json index 8a92bfd10cb..5cad0172fe9 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "code-oss-dev", "version": "1.60.0", - "distro": "1a48bc9e1d4b74944a0721212e078bf24b2cbf79", + "distro": "0daa48b9b8ac455e8d47a401b305cbd093b8c375", "author": { "name": "Microsoft Corporation" }, diff --git a/src/vs/code/browser/workbench/workbench-dev.html b/src/vs/code/browser/workbench/workbench-dev.html index 39ccebd6fb7..21a099e5465 100644 --- a/src/vs/code/browser/workbench/workbench-dev.html +++ b/src/vs/code/browser/workbench/workbench-dev.html @@ -28,7 +28,11 @@ + diff --git a/src/vs/code/browser/workbench/workbench.html b/src/vs/code/browser/workbench/workbench.html index db0077a905b..f3918456759 100644 --- a/src/vs/code/browser/workbench/workbench.html +++ b/src/vs/code/browser/workbench/workbench.html @@ -27,7 +27,11 @@ +