@@ -10,7 +10,7 @@ import { copyFile, mkdir } from 'fs/promises';
1010import { glob } from 'glob' ;
1111import * as path from 'path' ;
1212
13- const REPO_ROOT = path . join ( __dirname ) ;
13+ const REPO_ROOT = import . meta . dirname ;
1414const isWatch = process . argv . includes ( '--watch' ) ;
1515const isDev = process . argv . includes ( '--dev' ) ;
1616const isPreRelease = process . argv . includes ( '--prerelease' ) ;
@@ -251,8 +251,8 @@ const nodeSimulationWorkbenchUIBuildOptions = {
251251
252252async 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
371371function 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 = {
0 commit comments