-
-
Notifications
You must be signed in to change notification settings - Fork 200
♻️ Replace fileURLToPath patterns with import.meta.filename/dirname #6437
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
Co-authored-by: dubzzz <[email protected]>
Co-authored-by: dubzzz <[email protected]>
Co-authored-by: dubzzz <[email protected]>
|
|
||
| const execFile = promisify(_execFile); | ||
| // @ts-expect-error --module must be higher | ||
| const __dirname = url.fileURLToPath(new URL('.', import.meta.url)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@copilot no need for intermediate variables, the new version bring simpler we could directly online it. Same for all files
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done. Inlined import.meta.dirname and import.meta.filename directly instead of using intermediate variables throughout all affected files. (10cd690)
…variables Co-authored-by: dubzzz <[email protected]>
fileURLToPath(new URL('.', import.meta.url))withimport.meta.dirnamein code filesfileURLToPath(import.meta.url)withimport.meta.filenamein code filesimport.meta.dirnameandimport.meta.filenamedirectly instead of using intermediate variables__filename(not available as import.meta.* in CJS)fileURLToPathandurlmodulesOriginal prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.