Skip to content

Commit 97809ba

Browse files
authored
Run esbuild script directly as typescript (#2445)
1 parent a3e3a13 commit 97809ba

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

.esbuild.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import { copyFile, mkdir } from 'fs/promises';
1010
import { glob } from 'glob';
1111
import * as path from 'path';
1212

13-
const REPO_ROOT = path.join(__dirname);
13+
const REPO_ROOT = import.meta.dirname;
1414
const isWatch = process.argv.includes('--watch');
1515
const isDev = process.argv.includes('--dev');
1616
const isPreRelease = process.argv.includes('--prerelease');
@@ -251,8 +251,8 @@ const nodeSimulationWorkbenchUIBuildOptions = {
251251

252252
async function typeScriptServerPluginPackageJsonInstall(): Promise<void> {
253253
await mkdir('./node_modules/@vscode/copilot-typescript-server-plugin', { recursive: true });
254-
const source = path.join(__dirname, './src/extension/typescriptContext/serverPlugin/package.json');
255-
const destination = path.join(__dirname, './node_modules/@vscode/copilot-typescript-server-plugin/package.json');
254+
const source = path.join(import.meta.dirname, './src/extension/typescriptContext/serverPlugin/package.json');
255+
const destination = path.join(import.meta.dirname, './node_modules/@vscode/copilot-typescript-server-plugin/package.json');
256256
try {
257257
await copyFile(source, destination);
258258
} catch (error) {
@@ -369,7 +369,7 @@ async function main() {
369369
}
370370

371371
function applyPackageJsonPatch(isPreRelease: boolean) {
372-
const packagejsonPath = path.join(__dirname, './package.json');
372+
const packagejsonPath = path.join(import.meta.dirname, './package.json');
373373
const json = JSON.parse(fs.readFileSync(packagejsonPath).toString());
374374

375375
const newProps: any = {

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5071,10 +5071,10 @@
50715071
"prepare": "husky",
50725072
"vscode-dts:dev": "node node_modules/@vscode/dts/index.js dev && mv vscode.proposed.*.ts src/extension",
50735073
"vscode-dts:main": "node node_modules/@vscode/dts/index.js main && mv vscode.d.ts src/extension",
5074-
"build": "tsx .esbuild.ts",
5075-
"compile": "tsx .esbuild.ts --dev",
5074+
"build": "node .esbuild.ts",
5075+
"compile": "node .esbuild.ts --dev",
50765076
"watch": "npm-run-all -p watch:*",
5077-
"watch:esbuild": "tsx .esbuild.ts --watch --dev",
5077+
"watch:esbuild": "node .esbuild.ts --watch --dev",
50785078
"watch:tsc-extension": "tsc --noEmit --watch --project tsconfig.json",
50795079
"watch:tsc-extension-web": "tsc --noEmit --watch --project tsconfig.worker.json",
50805080
"watch:tsc-simulation-workbench": "tsc --noEmit --watch --project test/simulation/workbench/tsconfig.json",

0 commit comments

Comments
 (0)