Skip to content
New issue

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

当base配置项和ssrManifest同时使用时,生成ssr-manifest.json中部分css url地址不正确并未加上base前缀 #7682

Closed
7 tasks done
yuntian001 opened this issue Apr 12, 2022 · 4 comments · Fixed by #8371
Labels
p3-minor-bug An edge case that only affects very specific usage (priority)

Comments

@yuntian001
Copy link

Describe the bug

复现方法:
使用官方提供 的ssr-vue示例 https://github.com/vitejs/vite/tree/main/packages/playground/ssr-vue,vite.config.js中加入base:'test/',配置项
运行npm run build命令
可以看到ssr-manifest.json中的.vue文件内联的style标签生成的css文件都没有加上base前缀

Reproduction

https://github.com/vitejs/vite/tree/main/packages/playground/ssr-vue

System Info

System:
    OS: Windows 10 10.0.17763
    CPU: (16) x64 Intel(R) Core(TM) i7-10700 CPU @ 2.90GHz
    Memory: 7.85 GB / 15.86 GB
  Binaries:
    Node: 16.13.1 - D:\Program Files\nodejs\node.EXE
    Yarn: 1.22.17 - ~\AppData\Roaming\npm\yarn.CMD
    npm: 8.5.0 - D:\Program Files\nodejs\npm.CMD
  Browsers:
    Internet Explorer: 11.0.17763.771

Used Package Manager

npm

Logs

No response

Validations

@haoqunjiang haoqunjiang added p3-minor-bug An edge case that only affects very specific usage (priority) bug and removed feat: ssr labels Apr 29, 2022
@poyoho
Copy link
Member

poyoho commented May 11, 2022

@yuntian001 now is seems to resolved?
I set base: 'ssr-vue/' and the ssr-manifest.json will had base

  "src/pages/Home.vue": [
    "/ssr-vue/assets/Home.a4a13dc6.js",
    "/ssr-vue/assets/Home.9df5e2cf.css",
    "/ssr-vue/assets/logo.03d6d6da.png"
  ],

but js no base

  "Foo.600b7f27.js": [
    "/assets/Foo.a8752494.css",
    "/assets/index.4a20a016.css"
  ],

@yuntian001
Copy link
Author

@poyoho

"Foo.600b7f27.js": [
  "/assets/Foo.a8752494.css",
  "/assets/index.4a20a016.css"
]

应该也带着base才对。正确的结果应该为

  "Foo.600b7f27.js": [
    "/ssr-vue/assets/Foo.a8752494.css",
    "/ssr-vue/assets/index.4a20a016.css"
  ]

@yuntian001
Copy link
Author

@poyoho 这个问题有修复计划么,大约什么时候可以完成

@poyoho poyoho mentioned this issue May 28, 2022
9 tasks
@poyoho
Copy link
Member

poyoho commented May 28, 2022

@yuntian001 I fix it now, would you have time to test this?

@github-actions github-actions bot locked and limited conversation to collaborators Jun 12, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
p3-minor-bug An edge case that only affects very specific usage (priority)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants