-
-
Notifications
You must be signed in to change notification settings - Fork 19
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
Module not found: Error: Can't resolve 'windi.css' #34
Comments
Hey @mkhennoussi Thanks for the issue and apologies for the delay in getting back to you. Could you try upgrading your package to v0.4.1 and try again. Otherwise please share a reproduction repo and I'll do my best to fix it. |
This problem still exists |
@harlan-zw I also met this issue, // before
import 'windi.css'
// after bundle
import windiStyleSheet from 'windi.css';
var _styleSheet = windiStyleSheet; shouldn't the virtual module be replaced w/ something real? |
Hey guys, happy to look into this but I'll need a reproduction repo. You can also try The module is indeed virtual, a webpack loader will match the name and inject the styles |
@harlan-zw I am building a component library w/ windicss and webapack
and the components are written in
in my opinion, the virtual import statement should get removed and generate the demand class in the common css chunk so I wonder can windicss be used for a library not just application |
Hey @HomyeeKing That is correct in theory, the virtual module should be replaced. I haven't really had much experience with this setup, if you are able to provide the repo you're working from I can take a look and maybe find a solution |
@harlan-zw import styles from 'windi.css;
<View className={[styles.absolute, styles.inset0, styles.p4, styles.bgBlue500]} /> looks a bit verbose, the build plugin generate the real css file so they can be imported like module-css, what do you think? |
💩 First, remove WindiCSS from your project, using 💪 Let's start from scratch! When you add WindiCSS to your project if you see this warning appear:
🙉 DON'T IGNORE IT! Please commit or stash uncommitted changes first, then add WindiCSS, using After that, when running the project, you may continue to get the error
Now you need to install that package. Use 😚 That's all. I did it this way and it worked. Thanks! |
I find the solution by chinese: https://juejin.cn/post/7028522304350978061。 |
Hi guys,
Thanks for your work on windicss.
I tried to add windicss in a Phoenix App. I've modified the webpack.config.js file by adding the WindiCSSWebpackPlugin.
When I add the
import "windi.css";
in the app.js entry file, I get this error :Module not found: Error: Can't resolve 'windi.css'
Where does this windi.css comes from ? (Sorry I'm not a webpack expert)
It seems to be a virtual module generated by the plugin, right ?
Is there a way to tell webpack to not look for it ?
Thanks !
The text was updated successfully, but these errors were encountered: