-
-
Notifications
You must be signed in to change notification settings - Fork 129
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: avoid patching global webpack require #707
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. |
@@ -79,10 +77,13 @@ ${opts.htmlHead} | |||
}, | |||
transformIndexHtml() { | |||
return [ | |||
// HACK: vite won't inject __vite__injectQuery anymore |
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.
@Aslemammad What does it mean???
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.
Vite optimizes import()
so it adds ?import
to imported urls. That'd cause double module hazard!
This way, I hack it to use a global function so it does not get optimized.
if (id === 'waku' || id.startsWith('waku/')) { | ||
// HACK I don't know why this is necessary. | ||
// `external: ['waku']` doesn't somehow work? | ||
return import(id); |
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.
Tbh, it does not feel right! I'd rather figure out how we can move default handler to use ssrLoadModule, that'd be way more robust, I guess.
But this can work too.
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.
move default handler to use ssrLoadModule
@Aslemammad Do you have time to try it?
I will merge this PR, so please open a new PR.
close #579