-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Autoconfig Vite improvements #11508
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
Autoconfig Vite improvements #11508
Conversation
🦋 Changeset detectedLatest commit: 698d855 The changes in this PR will be included in the next version bump. Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
create-cloudflare
@cloudflare/kv-asset-handler
miniflare
@cloudflare/pages-shared
@cloudflare/unenv-preset
@cloudflare/vite-plugin
@cloudflare/vitest-pool-workers
@cloudflare/workers-editor-shared
@cloudflare/workers-utils
wrangler
commit: |
da569ae to
e8fda8d
Compare
| return { | ||
| wranglerConfig: { | ||
| assets: { | ||
| directory: outputDir, |
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.
Does this add assets.directory to the Wrangler config? We try to actively discourage users from doing that as it's not necessary and the value is ignored.
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, that's what it does, ok thanks good to know 🙂👍
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.
Thanks. I think what we will need for standard Vite projects is to set assets.not_found_handling to single-page-application.
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.
Right, that's a good call, thanks! 👍
By the way, shall we check the docs for assets.directory? it looks like we include it here and there: https://developers.cloudflare.com/workers/static-assets/routing/single-page-application/#configuration
a4d137e to
c513178
Compare
packages/wrangler/src/autoconfig/frameworks/utils/vite-config.ts
Outdated
Show resolved
Hide resolved
packages/wrangler/src/autoconfig/frameworks/utils/vite-config.ts
Outdated
Show resolved
Hide resolved
Co-authored-by: Somhairle MacLeòid <smacleod@cloudflare.com>
Co-authored-by: Somhairle MacLeòid <smacleod@cloudflare.com>
Co-authored-by: Somhairle MacLeòid <smacleod@cloudflare.com>
cfbe28c to
f5fb88b
Compare
…e the function for react-router projects
Co-authored-by: Matt Kane <m@mk.gg>
Fixes https://jira.cfdata.org/browse/DEVX-2362 and https://jira.cfdata.org/browse/DEVX-2368
This PR updated the wrangler autoconfig logic in regards to Vite projects by: