-
-
Notifications
You must be signed in to change notification settings - Fork 6
feat: rolldown vite full bundle mode #107
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
base: rolldown-vite
Are you sure you want to change the base?
Conversation
f46540b
to
744fe8b
Compare
c580d0c
to
191a670
Compare
commit: |
'\t...typeof m === "object" && !Array.isArray(m) || typeof m === "function" ? m : {},\n' + | ||
'\tdefault: m\n' + | ||
'})(__vite__cjsImport0_react)', | ||
'const react = ((m) => m?.__esModule ? m : { ...typeof m === "object" && !Array.isArray(m) || typeof m === "function" ? m : {}, default: m })(__vite__cjsImport0_react)', |
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.
It is wired for it coudle be success at rolldown-vite branch.
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.
It's probably caused by the "vitest>vite"
overrides. Vitest uses Vite to process the files and that changes the Function::toString
result.
function importModuleWithFullBundleMode() { | ||
const importPromise = import(base + url) | ||
return importPromise.then(() => | ||
// @ts-expect-error globalThis.__rolldown_runtime__ |
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.
In the future, I think it's good to have the types exposed from rolldown so that we can use it like:
declare var __rolldown_runtime__: RolldownHmrRuntime
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.
Yeah.
'\t...typeof m === "object" && !Array.isArray(m) || typeof m === "function" ? m : {},\n' + | ||
'\tdefault: m\n' + | ||
'})(__vite__cjsImport0_react)', | ||
'const react = ((m) => m?.__esModule ? m : { ...typeof m === "object" && !Array.isArray(m) || typeof m === "function" ? m : {}, default: m })(__vite__cjsImport0_react)', |
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.
It's probably caused by the "vitest>vite"
overrides. Vitest uses Vite to process the files and that changes the Function::toString
result.
if (!server.httpServer) { | ||
throw new Error('HTTP server not available') | ||
} |
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.
We should probably support middleware mode (it does not have server.httpServer
) in the future.
Co-authored-by: 翠 / green <[email protected]>
Co-authored-by: 翠 / green <[email protected]>
Make dev build could be work. You could pass
npx vite --fullBundleMode
atdefine/hmr-root
to see the initial build success and visit the url at browser.The HMR has issues, i will work for it at next.