-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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(remix-dev/vite): use /@fs/
path to support default server/client entry outside of app root
#7913
Conversation
🦋 Changeset detectedLatest commit: 60665ff The changes in this PR will be included in the next version bump. This PR includes changesets to release 16 packages
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 |
/@fs/
path to support default server/client entry outside of app root/@fs/
path to support default server/client entry outside of app root
c8636e0
to
01536bd
Compare
01536bd
to
9ef2f64
Compare
By default, Vite prevents access to files outside the workspace root (when using workspaces) or outside of the project root (when not using workspaces) unless user explicitly opts into it via Vite's `server.fs.allow`.
9ef2f64
to
60665ff
Compare
@hi-ogawa thanks for your contribution! I extended your solution to work for any files outside of the Remix project root, not just the entry client/server files since |
@pcattori Sounds good! Thanks for adjusting the code. |
🤖 Hello there, We just published version Thanks! |
🤖 Hello there, We just published version Thanks! |
Closes: #7722
While looking at devtools network tab, I just spotted vite itself seems to be using
/@fs/
url to define globals (the url is something likehttp://localhost:5173/@fs/home/hiroshi/code/tmp/remix-pnpm-workspace/node_modules/.pnpm/vite@4.5.0/node_modules/vite/dist/client/env.mjs
cf. vitejs/vite#12471).So, I came to this idea of doing something similar to support default entries outside of remix app root.
Testing Strategy:
I created a simpler reproduction in https://github.com/hi-ogawa/demo-remix-vite-pnpm-workspace and verified this fix using
pnpm patch
hi-ogawa/demo-remix-vite-pnpm-workspace@6d18e91