-
-
Notifications
You must be signed in to change notification settings - Fork 6.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
feat: add ssr.format to force esm output for ssr #6812
Conversation
ESM output can be set today via |
@bluwy I wasn't aware of this option, and I guess I'm not the only one looking at the number of 👍 here. I have an app that is fully ESM except for a single Maybe this need to be better documented in the SSR section? |
Yes, we should definitely document the @manucorporat Are you fine if we close this and document the option instead? |
Great! I was working with Manu when he spotted this apparent problem. I can confirm the config works and I was able to undo my hack (drawveloper/qwik-app-deno-example@6bf27a5#diff-edab6281f770861b1b43fd3fb256f40626f5d9fc79e3feccdac8c3e594241eb1L2) So, yes, documenting this might help. "In case your runtime requires esm, use this option" |
I think that for the most common use cases, we shouldn't need to reach into |
I've been thinking about this recently and discussed with patak. I've concluded that |
I would just not call is |
We discussed the PR in the last team meeting.
|
From the code, one unique part of
|
Good point @bluwy, I think the idea would be that when I think this covers all current cases, no? The last time we talked about the previous PR we ended up deciding to include |
Yeah the automatic So perhaps we could go forward with:
|
I think it would be confusing to have two ways of doing thing. It may be better to simply highlight the existing option in the documentation |
I'll merge this PR, as we're going to use the same option in: Check that PR for reference on related work around defaulting Vite to use ESM for the SSR build by default. We're also removing the externalization heuristics in v3. |
Description
Add new config:
ssr.format
to force an specific module format of the SSR buildAdditional context
Deno, Cloudflare and other platforms might run SSR code, but it needs to be described in ESM format.
This PR solves the same issue as #2157, but takes a more explicit approach, not using package.json.
Closes #2152
What is the purpose of this pull request?
Before submitting the PR, please make sure you do the following
fixes #123
).