fix: solve the problem of not finding the package during packaging (#4179)

This commit is contained in:
wuyiping 2026-04-16 09:24:10 +08:00 committed by GitHub
parent 5cec715ece
commit a5c2f506ba
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 6 additions and 1 deletions

View File

@ -41,7 +41,9 @@ import { twMerge } from 'tailwind-merge'
const isOpenPlaywright = navigator.webdriver
if (!isOpenPlaywright) {
import('@opentiny/vue-theme/responsive-index.css')
// 确保 Vite 能静态分析到文件
const modules = import.meta.glob('@opentiny/vue-theme/responsive-index.css')
Object.values(modules).forEach((loadModule) => loadModule())
}
// 适配层集成twMerge能力
if (isSaas) {

View File

@ -27,6 +27,9 @@ const getAlias = (vueVersion: string | number, theme = '', design?: string) => {
'@opentiny/vue-theme/dark-theme-index.css': pathFromWorkspaceRoot(
`packages/theme${ns(design || theme)}/src/base/dark-theme.less`
),
'@opentiny/vue-theme/responsive-index.css': pathFromWorkspaceRoot(
`packages/theme${ns(design || theme)}/src/responsive-index.less`
),
'@opentiny/vue-theme': pathFromWorkspaceRoot(`packages/theme${ns(design || theme)}/src`),
'@opentiny/vue-theme-saas': pathFromWorkspaceRoot('packages/theme-saas/src'),
'@opentiny/vue-common': pathFromWorkspaceRoot('packages/vue-common/src/index-dev'),