-
Notifications
You must be signed in to change notification settings - Fork 55
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
css module hangs when file doesn't exist #25
Comments
Do you have a way of determining (through some configuration) if the css module should be loaded prior to attempting to load it? Or do you want to just always try to load and see if there is a 404? Do you need notification for when the CSS was loaded? If you just need to request a stylesheet, you can do so like this: https://github.com/kriszyp/xstyle/blob/master/core/load-css.js#L103 |
I don't care if it is loaded, but if it is loaded, I want it to wait until it is parsed. Thanks for the link to the code, I was looking for that before I created the issue. I see you have a !nowait option. Looks like that option is working for me. I'm doing this. "xstyle/css!./useroverrides.css!nowait", So, maybe I'm good. But an option that would act like nowait and continue on after it times out, might be the only way to be sure. How does "!optional" sound? Right now, if I don't use the !nowait, I see the 404 and the timeout in the console but my code never gets called. Jeff From: Kris Zyp [email protected] Do you have a way of determining (through some configuration) if the css module should be loaded prior to attempting to load it? Or do you want to just always try to load and see if there is a 404? Do you need notification for when the CSS was loaded? If you just need to request a stylesheet, you can do so like this: https://github.com/kriszyp/xstyle/blob/master/core/load-css.js#L103 |
I want to load a css module only if it exists. This is to allow end users to create an overrides.css if they want to override what I deliver. I think this is better than them modifying my css or modifying the markup to include theirs, because an update will wipe out their changes. Is there a way to conditionally load the file?
The text was updated successfully, but these errors were encountered: