zhangyuang / ssr

A most advanced ssr framework support React17/React18/Vue2/Vue3 on Earth that implemented serverless-side render specification.
http://doc.ssr-fc.com/
MIT License
2.59k stars 283 forks source link

生产环境的antdv ui css 样式和开发环境不一致 #313

Closed hululuuuuu closed 10 months ago

hululuuuuu commented 10 months ago

大前提

我在layout/app.vue 里面引用了 antdv 相关 css

image

并且我在 common.less 对 antdv 的 upload 组件设置了 css border:0;

image

我的问题

本地开发视图展示正常

image

然后是生产环境 执行 npm run prod ("prod": "ssr build --vite && pm2 start pm2.config.js") 访问之后 border:0 这条 css 被覆盖了

image

这是我的 config.ts 的配置

image

期望的结果

开发环境和生产环境效果保持一致即可。我的理解是 同样一份代码打包之后 无论表现出 border:0 还是 border:1 ,生产环境和开发环境效果要一致

当前使用的版本

image antdv 版本:3.2.30

判断

打包过程中怀疑 antdv css 加载顺序降到了 common.less 的下方导致的。

zhangyuang commented 10 months ago

请提供最简复线仓库

发自我的iPhone

------------------ 原始邮件 ------------------ 发件人: Gxs @.> 发送时间: 2023年11月8日 10:43 收件人: zhangyuang/ssr @.> 抄送: Subscribed @.***> 主题: Re: [zhangyuang/ssr] 生产环境的antdv ui css 样式和开发环境不一致 (Issue #313)

大前提

我在layout/app.vue 里面引用了 antdv 相关 css

并且我在 common.less 对 antdv 的 upload 组件设置了 css border:0;

我的问题

本地开发视图展示正常

然后是生产环境 执行 npm run prod ("prod": "ssr build --vite && pm2 start pm2.config.js") 访问之后 border:0 这条 css 被覆盖了

这是我的 config.ts 的配置

期望的结果

开发环境和生产环境效果保持一致即可。我的理解是 同样一份代码打包之后 无论表现出 border:0 还是 border:1 ,生产环境和开发环境效果要一致

当前使用的版本

antdv 版本:3.2.30

判断

打包过程中怀疑 antdv css 加载顺序降到了 common.less 的下方导致的。

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you are subscribed to this thread.Message ID: @.***>

hululuuuuu commented 10 months ago

@zhangyuang 好的 复现仓库等 最晚明天提供给你。这个因为是需要打包的 可能需要在本地运行,我这边直接新开个 git 仓库给你可以吗?

zhangyuang commented 10 months ago

可以

发自我的iPhone

------------------ 原始邮件 ------------------ 发件人: Gxs @.> 发送时间: 2023年11月8日 11:38 收件人: zhangyuang/ssr @.> 抄送: yuuang @.>, Mention @.> 主题: Re: [zhangyuang/ssr] 生产环境的antdv ui css 样式和开发环境不一致 (Issue #313)

@zhangyuang 好的 复现仓库等 最晚明天提供给你。这个因为是需要打包的 可能需要在本地运行,我这边直接新开个 git 仓库给你可以吗?

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you were mentioned.Message ID: @.***>

zhangyuang commented 10 months ago

fix by utils@6.2.112