Closed dkattan closed 6 months ago
In my environment import.meta.url does not maintain the relative path to the extension in node_modules:
So I added NPM package import-meta-resolve and used their resolve method by replacing
const resolved = await import.meta.resolve!(path, url.pathToFileURL(args.path));
with
const resolved = await resolve(path, url.pathToFileURL(args.path).toString());
But then I had an issue because import.meta.url starts with file://C:/ causing the pathname to be /C:/node_modules which is obviously not correct
This can be mitigated by replacing
const pathname = new URL(req.originalUrl, import.meta.url).pathname;
const pathname = new URL(req.originalUrl, server.resolvedUrls?.local.toString())
This plugin was externalized and used in https://github.com/CodinGame/monaco-vscode-api/pull/329
In my environment import.meta.url does not maintain the relative path to the extension in node_modules:![image](https://github.com/CodinGame/monaco-vscode-api/assets/1424395/1b952a7d-53ac-4955-92d4-0138fa96777b)
So I added NPM package import-meta-resolve and used their resolve method by replacing
with
But then I had an issue because import.meta.url starts with file://C:/ causing the pathname to be /C:/node_modules which is obviously not correct
This can be mitigated by replacing
with