-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
vite 打包之后 动态生成index[x].css 和本地css路径不匹配,导致样式丢失。 #5318
Comments
能否提供一个最小可复现代码 |
@waittingbar 参考下 issue #4818 配置下 cssChunkNames |
|
就是 issue #4818 里面提到的问题。 |
@waittingbar 通过提供的 cssChunkNames 解决 {
"vite": true,
"cssChunkNames": "index-main.css"
} |
@ClarkXia 目前通过这个方法可以修改入口css名称,实际问题没解决。只能现在通过不使用分包加载css,js避免发布的问题了。非常感谢你的解答。 |
What is the current behavior? 发生了什么?
项目发布到线上后,如果在浏览器上打开项目,在此期间重新发布项目;此时再点击项目中其他菜单,会存在请求不到样式的情况;刷新页面可恢复正常。
目前猜测是由于重新发布后原来引用的index[x].css更名发生了变化,html去资源中找不到需要的样式。
What is the expected behavior? 期望的结果是什么?
期望客户如果在使用过程中,如果发布了版本,能继续使用。目前会出现样式错乱问题!
Any additional comments? 相关环境信息?
ice.js Version:2.0.0
build.json Configuration:
{
"vite": {
"build": {
"chunkSizeWarningLimit": 500,
}
},
// "publicPath": "/hotata",
"plugins": [
[
"build-plugin-moment-locales",
{
"locales": [
"zh-cn"
]
}
],
[
"build-plugin-ignore-style",
{
"libraryName": "@alifd/next"
}
]
],
"proxy": {
"/api": {
"enable": true,
"target": "http://192.168.7.201"
"pathRewrite": {
"^/api": ""
}
}
}
}
Node Version: 14.17.0
Platform: windows 11
The text was updated successfully, but these errors were encountered: