alibaba / ice

🚀 ice.js: The Progressive App Framework Based On React(基于 React 的渐进式应用框架)
https://ice.work
MIT License
17.84k stars 2.09k forks source link

codeSplitting 配置不生效 #6988

Closed zhaoyin0226 closed 1 month ago

zhaoyin0226 commented 2 months ago

Describe the bug

将codeSplitting配置为false 还是打包出了多个html文件, image 目前这个情况,会导致如果一个页面存在嵌套页面的话, 刷新当前页面后 重新请求资源 nginx 会找不到目标html 比如 我访问 https://abc.com/foo/foo_page; 但是我foo_page 下有嵌套路由,https://abc.com/foo/foo_page/tmp_page; 这样子会访问不到foo_page,因为构建出来的产物中有 foo_page.html 和 foo_page目录 (foo_page/tmp_page.html)

Expected behavior

解决约定是路由的问题 或者 解决codeSplitting配置失效的问题

Actual behavior

No response

Version of ice.js

v3

Content of build.json or ice.config.mts

export default defineConfig(() => ({
  ssg: false,
  codeSplitting: false,
  minify,
  plugins: [request(), store(), auth()],
  compileDependencies: false,
  routes: {
    ignoreFiles: ['**/components/**', '**/services/**'],
  },
  proxy: {
     xxx
  },
  outputDir: 'dist',
  publicPath: '/face/',
}));

Additional context

No response

ClarkXia commented 1 month ago

提供下复现 demo

ClarkXia commented 1 month ago

html 构建是默认按路由生成的,跟 codeSplitting 没有关系,如果不想生成可以配置 htmlGenerating: false