Skip to content
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

@imports for missing files are silently ignored #124

Closed
jcoglan opened this issue Aug 7, 2013 · 9 comments
Closed

@imports for missing files are silently ignored #124

jcoglan opened this issue Aug 7, 2013 · 9 comments
Assignees
Milestone

Comments

@jcoglan
Copy link

jcoglan commented Aug 7, 2013

Maybe I'm missing something but it seems like a bad idea to silently skip @import statements that reference files that don't exist, replacing them with the empty string. Wouldn't it be a better idea to either throw an error or leave the unresolvable @import statement in the output, on the assumption it references a file available at runtime but not at compile time?

@GoalSmashers
Copy link
Contributor

Good point James! How about showing a warning and leaving @import as it is?

On 8 Aug 2013, at 01:32, James Coglan notifications@github.com wrote:

Maybe I'm missing something but it seems like a bad idea to silently skip @import statements that reference files that don't exist, replacing them with the empty string. Wouldn't it be a better idea to either throw an error or leave the unresolvable @import statement in the output, on the assumption it references a file available at runtime but not at compile time?


Reply to this email directly or view it on GitHub.

@jcoglan
Copy link
Author

jcoglan commented Aug 8, 2013

Having thought about it some more I can't think of a situation where I would want a missing file to be treated as okay. I think you should throw an error if any referenced file does not exist.

@GoalSmashers
Copy link
Contributor

Broken import means file is no present or a path is broken but throwing an error could break scripts which rely on this feature. I'd go for a warning instead of an error.

@jcoglan
Copy link
Author

jcoglan commented Aug 8, 2013

What I'm saying is I want scripts that try to compile CSS with broken references to crash. A warning is far too easy to ignore. Your CSS compile is something you tend to set up for a project and forget about, rather than something you interact with frequently, so it needs to make a lot of noise when something goes wrong so that it gets noticed.

How would you even emit warnings in a way the user would notice?

@GoalSmashers
Copy link
Contributor

I think you are right, warning is not enough for a situation when broken reference ends up on production servers. Since that's a breaking change we would need a clean-css 1.1.

Consider it accepted!

@GoalSmashers
Copy link
Contributor

@jcoglan - so it's ready! Since it's a breaking change so we will release it as a part of clean-css 1.1.

@jcoglan
Copy link
Author

jcoglan commented Aug 30, 2013

Thank you!

@GoalSmashers
Copy link
Contributor

Likewise!

On 30 Aug 2013, at 10:25, James Coglan notifications@github.com wrote:

Thank you!


Reply to this email directly or view it on GitHub.

@GoalSmashers
Copy link
Contributor

@jcoglan clean-css 1.1 is out with fix to this issue included. Cheers!

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

No branches or pull requests

2 participants