-
-
Notifications
You must be signed in to change notification settings - Fork 124
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: waku build will bundle browser files in server side #900
base: main
Are you sure you want to change the base?
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 1 Skipped Deployment
|
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. |
@@ -374,6 +380,9 @@ const buildClientBundle = async ( | |||
rscTransformPlugin({ isClient: true, isBuild: true, serverEntryFiles }), | |||
...deployPlugins(config), | |||
], | |||
resolve: { | |||
conditions: ['import', 'module', 'default', 'browser', 'production'], |
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.
Is it intentional to have 'default' before 'browser'?
f7ef259
to
3c2e0fa
Compare
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.
Can we avoid committing dist
? It's listed in .gitignore
.
@@ -112,6 +112,9 @@ const createMainViteServer = ( | |||
rscHmrPlugin(), | |||
fsRouterTypegenPlugin(config), | |||
], | |||
resolve: { | |||
conditions: ['import', 'module', 'default'], |
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.
MainViteServer is used to bundle for browsers.
It should be in ssr.resolve.conditions
.
Do we need to change RscViteServer?
Now I wonder if build.ts
change is correct.
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 tested, ssrLoadModule
won't use browser
condition by default
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.
So, what's the original problem?
This MainViteServer it to for browsers, so browser
condition should be appropriate.
Default options for vite includes
browser
, whch might cause some bundler issueRef: https://v2.vitejs.dev/config/#resolve-conditions
Downstream: run-llama/LlamaIndexTS#1256