Support automatically updating URL import references when using new URL(<file>, import.meta.url)
#43759
Labels
Experience Enhancement
Noncontroversial enhancements
Help Wanted
You can do this
Suggestion
An idea for TypeScript
Milestone
Bug Report
π Search Terms
import.meta.url
π Version & Regression Information
β― Playground Link
Workbench repo
π» Code
Given the following files:
folder/file1.ts
different-folder/file2.ts
sub-folder/
in rootdifferent-folder/
intosub-folder/
so that the layout becomessub-folder/different-folder/file2.ts
π Actual behavior
sub-folder/different-folder/file2.ts
The same is true if
folder/file1.js
is moved to a different location.π Expected behavior
Similar to the dynamic import, a file reference based on
import.meta.url
that points to a different TypeScript file should correctly be renamed accordingly.sub-folder/different-folder/file2.ts
VS Code supports the standard dynamic import to handle file renaming. Since
import.meta.url
andURL
are a standard way of resolving files, I would expect VS Code to natively support it as well. For example, Parcel compatibility is implemented in parcel-bundler/parcel#5473, is implemented in Webpack 5 webpack/webpack#11075 and is scheduled for implementation in ESBuild evanw/esbuild#312 (comment)This issue was originally filed at microsoft/vscode#121391
The text was updated successfully, but these errors were encountered: