Skip to content
This repository was archived by the owner on Aug 30, 2024. It is now read-only.

vite2.6.x和2.7.x版本Build后输出文件内容空白 #14

Open
huan713 opened this issue Dec 15, 2021 · 3 comments
Open

vite2.6.x和2.7.x版本Build后输出文件内容空白 #14

huan713 opened this issue Dec 15, 2021 · 3 comments

Comments

@huan713
Copy link

huan713 commented Dec 15, 2021

vite2.6.x和2.7.x版本build后输出的文件内容空白(导致生成环境下换肤失效),2.5.x是正常的。

开发环境下是正常的。

@Jenniferyingni
Copy link

问题:build 时生成空白的 app-theme-style.css 文件

定位了下是在 vite 2.6.0-beta.0 这个版本出的问题

应该是这一版本的 CHANGELOG 中的一些修改影响了插件的功能:2.6.0-beta.0

插件中出问题的一行是 钩子函数 transform, 对于css类文件拿到的code,也就是源代码是空的。

  async transform(code, id) {
        if (!cssLangRE.test(id)) {
          return null;
        }
}

在同样的 vite 版本下试了另外一个也有 transform 钩子的插件 vite-plugin-vue2 是能拿到css文件的code。

不知道这个问题和官网换肤失效的问题是不是同一个原因导致的

@anncwb

@rex-ll
Copy link

rex-ll commented Jul 31, 2022

遇到同样的问题,看了一下源码,文件为空是因为默认主题和primaryColor一样,所以就没有第三主题

@zhangcheng1164
Copy link

参考这个可以解决 vbenjs/vue-vben-admin#2087

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants