Open F1LT3R opened 9 months ago
I don't think we'd be able to support arbitrary loaders -- running untrusted code here is a security boundary violation.
You probably would be able to use https://www.typescriptlang.org/tsconfig#customConditions in a jsconfig file assuming the loader has some reasonably-standardish behavior. What does this loader you have actually do?
The loader does the following:
.mjs
file imports across http://
and file://
index.mjs
files across http://
and file://
Should a loader still be considered untrusted if the loader is run from within the loaded project, specifically after the user has already selected "Trust Authors" or "Trust Workspace?
I would like VS Code to be able to use a custom Node.js loader for Intellisense.
For example, if I remove the
.mjs
extension from my code, I can no longer see the Intellisense formime-types.mjs
.But my custom loader does not require the extension.
Here is what I am hoping to see: (without the
.mjs
extension on the import)I can see the
.html
reference in the Intellisense drop down.But here is what I actually see:
I think that now Node.js loaders are going through the normalization process - heading out of experimental, it is a good time for VS Code to start working on respecting loaders.
Perhaps this could live in
.vscode/settings.json
:It would be important to provide different loaders for different directories for more complex projects/monorepos, etc: