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

Initial folder support #14

Closed
wants to merge 1 commit into from
Closed

Conversation

mduvall
Copy link

@mduvall mduvall commented Jul 11, 2014

This PR starts to address #7, a few questions:

  • The input currently concatenates all the CSS files together and reports line numbers that aren't useful anymore past the first file). What's the ideal output format in this case? I see two ways of approaching this:
    • handle each CSS file individually (file name keys to current output blob)
    • handle them all together and add support in the output for mapping line number + file name (line: [1 (foo.css), 1 (bar.css)])
  • Recursively look in directory for CSS files or top level of folder?

@Munter
Copy link
Contributor

Munter commented Jul 13, 2014

Isn't it better to just iterate over the files, keep the file names and line numbers seperate and thus usable in the output?

@mduvall
Copy link
Author

mduvall commented Jul 14, 2014

@Munter Yeah that would be simpler, but how would we represent cross-file collisions in the output in that case (ie a collision in foo:1 and bar:2) and consistently map them assuming we need to coalesce the input?

@SlexAxton
Copy link
Owner

I think sourcemap support is the real win. We can take in a sourcemap if we need to, but we can also generate a sourcemap when we do the concatenation. Then no matter what we can take in a folder, a few random files, a stream of files, etc, and be able to map them to whatever we need without making the detection code too much more complicated.

The output would need some love, but my guess is that we could sort by file with most mentions (after sourcemap resolution), and only mention the first file or two that the collision occurs in (making sure to mention the file that the less used color is in). Generally you have a color that's used in lots of spots, and then a color that was used once in one spot, and collides with the color that should have been used. So as long as that color is easy to find, I think that's a win.

We can also have a --verbose mode for the full output of locations.

@mduvall mduvall closed this Dec 17, 2014
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

Successfully merging this pull request may close these issues.

3 participants