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
System: OS: Windows 11 10.0.22631 CPU: (32) x64 Intel(R) Core(TM) i9-14900HX Memory: 1.79 GB / 15.63 GB Browsers: Edge: Chromium (127.0.2651.74) Internet Explorer: 11.0.22621.3527 npmPackages: @modern-js/app-tools: 2.59.0 => 2.59.0 @modern-js/eslint-config: 2.59.0 => 2.59.0 @modern-js/runtime: 2.59.0 => 2.59.0 @modern-js/tsconfig: 2.59.0 => 2.59.0
在config.js文件中设置了server.baseUrl = '/sec'后执行npm run dev 在控制台输出 localhost:8080/sec 在浏览器打开该链接发现无法正常展示页面
server.baseUrl = '/sec'
npm run dev
localhost:8080/sec
// config.js 完全配置 export default defineConfig({ server: { baseUrl: '/sec', }, runtime: { router: { supportHtml5History: false, }, }, output: { assetPrefix: '/sec', enableCssModuleTSDeclaration: true, distPath: { js: 'assets', css: 'assets', html: '', }, }, html: { disableHtmlFolder: true, }, plugins: [ appTools({ bundler: 'rspack', // Set to 'webpack' to enable webpack }), ], });
network中页面虽然请求成功但显示了空白页
none
The text was updated successfully, but these errors were encountered:
supportHtml5History 设置为 false 和 server.baseUrl 不支持同时使用,因为 supportHtml5History 设置为 false 时,会使用 hashRouter,同时传递 server.baseUrl 的 basename 会造成路由冲突,如果一定要使用 hash 路由,可以参考这个 issue 调整一下代码实现 remix-run/react-router#8427 (comment)
Sorry, something went wrong.
No branches or pull requests
Version
Details
在config.js文件中设置了
server.baseUrl = '/sec'
后执行npm run dev
在控制台输出localhost:8080/sec
在浏览器打开该链接发现无法正常展示页面network中页面虽然请求成功但显示了空白页
Reproduce link
none
Reproduce Steps
The text was updated successfully, but these errors were encountered: