-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
fix: monaco editor types resolution #1342
Conversation
@@ -43,19 +43,20 @@ export function createMonacoTypesLoader({ userRoot }: ResolvedSlidevOptions): Pl | |||
].join('\n') | |||
} | |||
|
|||
const matchLoad = id.match(/^\/\@slidev-monaco-types\/load(\/.*?)&name=(.*)$/) | |||
const matchLoad = id.match(/^\/\@slidev-monaco-types\/load\/(.*?)&name=(.*)$/) |
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.
Not very sure about this change. (Reverting a85ac6a)
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.
Some resolution add leading slash some are not, you will see paths like:
/@slidev-monaco-types/load//Users/xx...
and
/@slidev-monaco-types/load/Users/xx...
We should probably unify them on generation. We just need to make sure the root
passed to fg
is absolute.
(and this might have some issues on Windows? 👀)
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.
Yes. This is broken on Windows.
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.
I've changed the URL format to
/@slidev-monaco-types/resolve?pkg=...&importer=...
/@slidev-monaco-types/load?root=...&name=...
Also, raw imports are now like ...?monaco-types&raw
, so that manualChunk
can work correctly.
This PR fixes:
omit duplicate dependencies
declaration files searching