-
Notifications
You must be signed in to change notification settings - Fork 115
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
File containing same content shouldn't be skipped #67
Comments
I'm not sure I understand the rationale behind hashing a file, so not sure how to send a PR. Shouldn't files be skipped only according to their absolute paths? Maybe I missed something? |
"Proxy" files (which contain only some |
But if full paths are exactly the same, the file will be imported once (test should be made on absolute path) |
Well, since the title fits what I'm about to say. I will just post here. Imagine this css set up: @import "tabs/base/index.css";
@import "tabs/pretty/index.css";
@import "layout.css";
@import "color.css";
@import "background.css";
@import "color.css";
@import "background.css";
@import "typography.css"; Both .tabs-tab {
background: url(tab-bg.png)
}
.tabs-panel {
background: url(panel-bg.png)
} In this case, the base module provides basic styles, and the pretty module provides more vibrant styles. If you skip files based on content, backgrounds offered by the pretty module are ignored. |
Probably not skipping files with same absolute url is too much, and multiple modules importing the same normalize.css file is understandable, but files with different absolute urls and same content should not be skipped, i believe. |
In order to prevent use case like you mentionned, I was thinking we could (in addition to the content, add a minimal length (in characters) where we can consider files are likely to be the same. But since this is starting to be ridiculous, I guess we should just add an option to enable/disable skipping like it is atm. PR is welcome for a Reminder: this "feature" is out for months and you are the first to complain about it. I am going to add some documentation about that in order to make it clear for everyone. Your PR (if you are going to do it) might helps others like you. If some others people come to yell, we might change default behavior in a major release. |
I wonder what's the drawbacks of not skipping files with different absolute urls but same content? The normalize.css case you mentioned certainly don't fail under it. I don't think cssnext has gained big enough user base (I just compare the download number on npm to that of coffee-script, hope you don't mind) to have users to complain as soon as something might not work correctly. So I don't think rely on feedback is a good way for cssnext to proceed right now, especially the use case is a rare one like I mentioned (I personally haven't been hit by that yet, just come up with it after read the source of this plugin). |
Tip: if you want to go forward quickly, start with small steps ;)
That's why I mentionned that I will update the doc to make the current behavior clear for everyone. |
Sure, sounds good to me. I think i should wait to complain about skipping once I really encounter one in my project. :) |
I will let this issue opened since I think we should do something (at least option to modify + doc). |
i'm having this issue as well. trying to convert over from sass to postcss and the framework i'm using templates like the original post. please let me know when this PR is done, or maybe point me in the direction of where this switch would be implemented, as i'd rather get this option sooner rather than later :) thanks! |
nvm i see what's happening. i'll fork and work on it until either someone else PRs or i finish |
Thanks for the options. Although I think it covers two different kinds of skips:
There are probably difference use cases in both kinds. I personally want to enable |
👌good job @MoOx |
gonna check out the commit in the morning. thank you so much!! :D |
Currently, if a file contains the same content as another, it's skipped. This can fail in cases like this:
This causes
bar/baz/index.css
not being imported.The text was updated successfully, but these errors were encountered: