-
-
Notifications
You must be signed in to change notification settings - Fork 375
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
Include CSS from node_modules in Preact build #1368
Comments
Can you provide a repo? Not entirely sure what I'm doing with Swiper, but styles seem to be there just fine. All I did was copy/paste the demo found here.
Could you possibly add your entire
By default, stylesheets in |
It's the same repo we had a talk about last time(about routing). Here. It's a basic example, I haven't included much new stuff. Just playing around with existing stuff. |
What CSS seems to be missing? Seems to match your hosted and running version if I go to I'll need a bit more direction as that is quite the large app for a bug reproduction. |
Slider is component inside Apps page. Currently I movde styles out of swiper node module into Slider.css |
Doing that and running prod seems to work just fine for me, unless I'm missing something. Odd. |
Alright, well, debugging process. Can you clone this repo and see if it works? It's a super cut down default Preact app. If it does work, that means it's something in your project, and there's a lot there that could be causing this. If not, then we know it's something on your system and we can go from there. |
Hello there! Sorry to hijack this open issue, but I'm facing an identical issue. I'm importing a package css file in one of my components, like this:
Since I'm using tailwindcss in my project, I have this code in
I also had to modify my scripts to build tailwindcss's as a separate step and append that step to my
I don't have a |
Can you provide a repo that can reproduce this? |
@rschristian Thanks Ryan, I found the solution, disabling css modules was what I needed to do, here's the link to the solution in case someone is struggling with this https://stackoverflow.com/questions/59813174/how-to-do-a-simple-import-of-a-style-in-preact-as-you-would-do-in-react This is what my
|
Ah, yeah, if you just want to disable CSS modules that's how you do it. |
Do you want to request a feature or report a bug?
Hi guys, I believe i need your help again. I don't think it's a bug, but I can't find where I should set it up.
What is the current behaviour?
I'm using css from node module in my app(importing to a component):
import 'swiper/swiper-bundle.css'
or with node-sass:
import 'swiper/swiper.scss'
Made no difference.
If the current behaviour is a bug, please provide the steps to reproduce.
It's working just fine while development. But in built version(with pre-rendering) I don't see this CSS file(styles related to this module are not applying at all)
Here are my css-loader options from preact.config.js(I believe it's not configured properly):
And sass-loader:
I also noted some interesting input:
Why does it include and exclude the same?
What is the expected behaviour?
Anyway, I want to have css files from npm imported in build, what I should do? And why it isn't configured from scratch?
Sorry if it's silly question, I'm knew to Preact and I want to figure everything out. Thank you
The text was updated successfully, but these errors were encountered: