-
-
Notifications
You must be signed in to change notification settings - Fork 257
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
Version
System:
OS: macOS 14.5
CPU: (8) arm64 Apple M1
Memory: 494.88 MB / 16.00 GB
Shell: 5.9 - /bin/zsh
Browsers:
Brave Browser: 109.1.47.186
Chrome: 126.0.6478.127
Edge: 126.0.2592.87
Safari: 17.5
npmPackages:
@rsbuild/core: 1.0.0-alpha.4 => 1.0.0-alpha.4
@rsbuild/plugin-node-polyfill: ^1.0.1 => 1.0.1
@rsbuild/plugin-react: 1.0.0-alpha.4 => 1.0.0-alpha.4
@rsbuild/plugin-svgr: ^1.0.0-alpha.4 => 1.0.0-alpha.4
@rsbuild/plugin-type-check: ^1.0.0-alpha.4 => 1.0.0-alpha.4Details
Given the following config:
export default defineConfig({
html: {
template({ entryName }) {
const templates = {
foo: './public/index.html',
bar: './public/bar.html',
};
return templates[entryName] || './public/index.html';
},
},
source: {
entry: {
foo: './src/index.tsx',
bar: './src/bar/index.tsx',
},
}
...Then rsbuild will correctly display the http://localhost:3000/foo page.
But http://localhost:3000/bar will show a blank page.
It appears rsbuild is able to render a page in the public folder if the template file is called index.html
However, any other name such as bar.html will result in a blank page.
Does rsbuild support the public folder or is it necessary to migrate from public to static for it to work as expected ?
Reproduce link
https://github.com/Romej/rsbuild-public-entries
Reproduce Steps
- install deps with
yarn - run
yarn dev - go to
http://localhost:3000/foo(should render because template is called index.html) - go to
http://localhost:3000/bar(should see blank page because template is called bar.html)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working