windicss / windicss-webpack-plugin

🍃 Windi CSS for webpack ⚡
https://windicss.org/integrations/webpack.html
79 stars 19 forks source link

can't use mfsu #92

Open transtone opened 3 years ago

transtone commented 3 years ago

Describe the bug

AssertionError [ERR_ASSERTION]: [MFSU] package.json not found for dep windi.css which is imported from @/app.js

umi3 项目配置开启 msfu 时,会报找不到 windi.css 的错误。

harlan-zw commented 3 years ago

Hey @transtone

Guessing this is the same issue as https://github.com/windicss/vue-cli-plugin-windicss/issues/26 ?

So either add the ignore for windi or you can try import virtual:windi.css instead

transtone commented 3 years ago

virtual:windi.css

webpack5's mfsu not use .eslintrc.js, and import 'virtual:windi.css' not worked either.

harlan-zw commented 3 years ago

Are yu able to provide a reproduction repo for me

transtone commented 3 years ago

this is a reproduction repo: https://github.com/transtone/umijs-windicss

harlan-zw commented 3 years ago

Hey @transtone

Thanks for the reproduction link. I've looked into it, it seems like an issue with the MFSU and virtual modules. I've made an issue on the umi repo https://github.com/umijs/umi/issues/7303, will sort out a proper fix if they get back to me.

For now, if you really want to get it running, you can disable mfsu:

mfsu: false,

You will also need to import windi as windi.css instead of virtual:windi.css as well

import 'windi.css';
LanJamRom commented 2 years ago

now, umi4 has provided tailwind plugin that work in msfu mode as well. I tried to write a windicss plugin referring to this tailwind plugin, but failed.