diff --git a/build/gulpfile.cli.mjs b/build/gulpfile.cli.mjs index 637bd30cbe7..fadd9274b58 100644 --- a/build/gulpfile.cli.mjs +++ b/build/gulpfile.cli.mjs @@ -21,7 +21,7 @@ import { fileURLToPath } from 'url'; const { debounce } = utilModule; const { createReporter } = reporterModule; -const __dirname = fileURLToPath(new URL('.', import.meta.url)); +const __dirname = import.meta.dirname const root = 'cli'; const rootAbs = path.resolve(__dirname, '..', root); diff --git a/build/gulpfile.compile.mjs b/build/gulpfile.compile.mjs index b5773fcd9aa..0a55cd26d13 100644 --- a/build/gulpfile.compile.mjs +++ b/build/gulpfile.compile.mjs @@ -2,9 +2,7 @@ * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ - //@ts-check - import gulp from 'gulp'; import util from './lib/util.js'; import date from './lib/date.js'; diff --git a/build/gulpfile.editor.mjs b/build/gulpfile.editor.mjs index 599deff2c9f..78efe4890f5 100644 --- a/build/gulpfile.editor.mjs +++ b/build/gulpfile.editor.mjs @@ -2,9 +2,7 @@ * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ - //@ts-check - import gulp from 'gulp'; import * as path from 'path'; import util from './lib/util.js'; @@ -20,10 +18,9 @@ import monacoapi from './lib/monaco-api.js'; import * as fs from 'fs'; import filter from 'gulp-filter'; import reporterModule from './lib/reporter.js'; -import { fileURLToPath } from 'url'; import monacoPackage from './monaco/package.json' with { type: 'json' }; -const __dirname = fileURLToPath(new URL('.', import.meta.url)); +const __dirname = import.meta.dirname const { getVersion } = getVersionModule; const { createReporter } = reporterModule; const root = path.dirname(__dirname); diff --git a/build/gulpfile.extensions.mjs b/build/gulpfile.extensions.mjs index 78e59464d77..0c4f29b2141 100644 --- a/build/gulpfile.extensions.mjs +++ b/build/gulpfile.extensions.mjs @@ -23,7 +23,7 @@ import { fileURLToPath } from 'url'; EventEmitter.defaultMaxListeners = 100; -const __dirname = fileURLToPath(new URL('.', import.meta.url)); +const __dirname = import.meta.dirname const { getVersion } = getVersionModule; const { createReporter } = reporterModule; const root = path.dirname(__dirname); diff --git a/build/gulpfile.mjs b/build/gulpfile.mjs index 03195b93c8c..2b9ded125e8 100644 --- a/build/gulpfile.mjs +++ b/build/gulpfile.mjs @@ -17,7 +17,7 @@ import util from './lib/util.js'; EventEmitter.defaultMaxListeners = 100; const require = createRequire(import.meta.url); -const __dirname = fileURLToPath(new URL('.', import.meta.url)); +const __dirname = import.meta.dirname const { transpileTask, compileTask, watchTask, compileApiProposalNamesTask, watchApiProposalNamesTask } = compilation; diff --git a/build/gulpfile.reh.mjs b/build/gulpfile.reh.mjs index fd2ada5d163..5a047557119 100644 --- a/build/gulpfile.reh.mjs +++ b/build/gulpfile.reh.mjs @@ -40,7 +40,7 @@ const { getVersion } = getVersionModule; const { getProductionDependencies } = dependenciesModule; const { readISODate } = dateModule; const { fetchUrls, fetchGithub } = fetchModule; -const __dirname = fileURLToPath(new URL('.', import.meta.url)); +const __dirname = import.meta.dirname const REPO_ROOT = path.dirname(__dirname); const commit = getVersion(REPO_ROOT); diff --git a/build/gulpfile.scan.mjs b/build/gulpfile.scan.mjs index 7669cac499e..2680b000e8e 100644 --- a/build/gulpfile.scan.mjs +++ b/build/gulpfile.scan.mjs @@ -16,7 +16,7 @@ import { fileURLToPath } from 'url'; const { config } = electronConfigModule; -const __dirname = fileURLToPath(new URL('.', import.meta.url)); +const __dirname = import.meta.dirname const root = path.dirname(__dirname); const BUILD_TARGETS = [ diff --git a/build/gulpfile.vscode.linux.mjs b/build/gulpfile.vscode.linux.mjs index c87975335ab..68a45c99d39 100644 --- a/build/gulpfile.vscode.linux.mjs +++ b/build/gulpfile.vscode.linux.mjs @@ -23,7 +23,7 @@ import { fileURLToPath } from 'url'; const { rimraf } = utilModule; const { getVersion } = getVersionModule; const { recommendedDeps: debianRecommendedDependencies } = depLists; -const __dirname = fileURLToPath(new URL('.', import.meta.url)); +const __dirname = import.meta.dirname const exec = promisify(cp.exec); const root = path.dirname(__dirname); const commit = getVersion(root); diff --git a/build/gulpfile.vscode.mjs b/build/gulpfile.vscode.mjs index 5bcef49513e..1f36875522c 100644 --- a/build/gulpfile.vscode.mjs +++ b/build/gulpfile.vscode.mjs @@ -43,7 +43,7 @@ const { config } = electronModule; const { createAsar } = asarModule; const glob = promisify(globCallback); const rcedit = promisify(rceditCallback); -const __dirname = fileURLToPath(new URL('.', import.meta.url)); +const __dirname = import.meta.dirname const root = path.dirname(__dirname); const commit = getVersion(root); diff --git a/build/gulpfile.vscode.web.mjs b/build/gulpfile.vscode.web.mjs index 5dc9838e5b8..6efdd94e216 100644 --- a/build/gulpfile.vscode.web.mjs +++ b/build/gulpfile.vscode.web.mjs @@ -27,7 +27,7 @@ import { fileURLToPath } from 'url'; const { getVersion } = getVersionModule; const { readISODate } = dateModule; const { getProductionDependencies } = dependenciesModule; -const __dirname = fileURLToPath(new URL('.', import.meta.url)); +const __dirname = import.meta.dirname const REPO_ROOT = path.dirname(__dirname); const BUILD_ROOT = path.dirname(REPO_ROOT); diff --git a/build/gulpfile.vscode.win32.mjs b/build/gulpfile.vscode.win32.mjs index 0d38d1c1647..b844baf730a 100644 --- a/build/gulpfile.vscode.win32.mjs +++ b/build/gulpfile.vscode.win32.mjs @@ -16,7 +16,7 @@ import rcedit from 'rcedit'; import { createRequire } from 'module'; import { fileURLToPath } from 'url'; -const __dirname = fileURLToPath(new URL('.', import.meta.url)); +const __dirname = import.meta.dirname; const repoPath = path.dirname(__dirname); const buildPath = (/** @type {string} */ arch) => path.join(path.dirname(repoPath), `VSCode-win32-${arch}`); const setupDir = (/** @type {string} */ arch, /** @type {string} */ target) => path.join(repoPath, '.build', `win32-${arch}`, `${target}-setup`);