-
Notifications
You must be signed in to change notification settings - Fork 164
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: support server.base
configuration
#3542
Conversation
✅ Deploy Preview for rsbuild ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
not so sure about this setup, especially its link with output.assetPrefix. Looks like server and output should be split. If it is just for processing publicDir, this also needs to affect copyOnBuild. Should you consider placing it in publicDir, such as publicDir.base? |
Configuring And
Not just for processing public Dir. You can read related discussions #1242 |
I think this should be something output.assetPrefix controls, and when I have a problem I'll check it first, rather than some config I might be overlooking. Judging from #1242, I think the core requirement is still that server.publicDir needs to support specifying additional directories when copying. It's also worth mentioning that I don't like dev.assetPrefix either. Using |
I am neutral about In most projects I've encountered, the |
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.
Since base
is a new option, I propose to make it stricter:
- A
base
value should always end with a trailing slash: '/foo/'. - We do not need to remove the tailing slash in
process.env.BASE_URL
I think this configuration is necessary because I also encountered this problem when migrating old projects |
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: neverland <chenjiahan.jait@bytedance.com>
Summary
Support modifying the base path of the server through
server.base
configuration.By default, the base path of the server is
/
, and users can access output files such asindex.html
and public folder assets through http://localhost:3000/.When we want to access these files through http://localhost:3000/foo/, we can configure the following:
Related Links
#1242
Checklist