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 |
chenjiahan
left a comment
There was a problem hiding this comment.
Since base is a new option, I propose to make it stricter:
- A
basevalue 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.baseconfiguration.By default, the base path of the server is
/, and users can access output files such asindex.htmland 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