We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
本地有http://localhost:3000/app/train/a 路由,在本地热更新或者刷新后会导致页面404
当前虽然这个配置可以解决 http://localhost:3000/app/train/ 按如上形式运行,但是多了一些冗余代码,希望可以增加属性支持直接按/结尾运行。
let publicPath = '' let outputDir = '' let entry: any = {} if (process.env.mode?.includes('hotel')) { publicPath = process.env.NODE_ENV !== 'development' ? '/trip/app/' : '/app/' outputDir = 'app' entry.index = './src/main.ts' } else if (process.env.mode?.includes('train')) { publicPath = process.env.NODE_ENV !== 'development' ? '/trip/app/train/' : '/app/train/' outputDir = 'app/train' if (process.env.NODE_ENV === 'development') { entry.index = './src/train.ts' } else { entry.train = './src/train.ts' } } export default defineConfig({ source: { entry, }, html: { template: 'public/index.html' }, output: { assetPrefix: publicPath, distPath: { root: outputDir } }, dev: { assetPrefix: publicPath }, server: { base: process.env.mode === 'train' ? '/app/train/' : '/app/', } })
html 配置中新增属性?
The text was updated successfully, but these errors were encountered:
Hi, you can try this:
export default { html: { outputStructure: 'nested', }, };
See: https://rsbuild.dev/config/html/output-structure
Sorry, something went wrong.
Hi, you can try this: export default { html: { outputStructure: 'nested', }, }; See: https://rsbuild.dev/config/html/output-structure
export default { html: { outputStructure: 'nested', }, }; See: https://rsbuild.dev/config/html/output-structure
let publicPath = '' let outputDir = '' let entry: any = {} if (process.env.mode?.includes('hotel')) { publicPath = process.env.NODE_ENV !== 'development' ? '/trip/app/' : '/app/' outputDir = 'app' entry.index = './src/main.ts' } else if (process.env.mode?.includes('train')) { publicPath = process.env.NODE_ENV !== 'development' ? '/trip/app/train/' : '/app/train/' outputDir = 'app/train' entry.train= './src/train.ts' } export default defineConfig({ source: { entry, }, html: { template: 'public/index.html', outputStructure: 'nested', }, output: { assetPrefix: publicPath, distPath: { root: outputDir } }, dev: { assetPrefix: publicPath }, server: { base: '/app/, } })
thank you for your reply. I tried it, but it cant't work fine.
Local: http://localhost:3000/fcapp/train
Hello @akbq2008. Please provide a reproduction repository or online demo. For background, see Why reproductions are required. Thanks ❤️
No branches or pull requests
What problem does this feature solve?
为啥需要要按/结尾的原因
本地有http://localhost:3000/app/train/a 路由,在本地热更新或者刷新后会导致页面404
当前虽然这个配置可以解决 http://localhost:3000/app/train/
按如上形式运行,但是多了一些冗余代码,希望可以增加属性支持直接按/结尾运行。
What does the proposed API look like?
html 配置中新增属性?
The text was updated successfully, but these errors were encountered: