clean-css / clean-css

Fast and efficient CSS optimizer for node.js and the Web

Home Page:https://clean-css.github.io/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Source Maps

shannonmoeller opened this issue Β· comments

@shannonmoeller please correct me if I'm wrong but source maps are for CSS preprocessors only. And apparently clean-css makes smaller CSS from… larger CSS!

Source maps are for any JS or CSS files that are compiled from other source files. Because clean-css inlines @imports and modifies code to make it smaller than the source files, it qualifies! Consider your JS sister, uglifyjs. It only makes smaller JS files from larger JS files, and it supports generating source maps too!

Ah, sneaky @imports! Challenge accepted :-)

+1
Any news?

@Kienz we have some other tasks in the pipeline but we won't leave it unanswered. The more +1's the quicker we get into it.

+1 This will be one of the most useful feature.

+1, we'd prefer to use --clean-css from grunt less task, as it gives better results than --compress, but we need the source maps

@iki @sbspk looks like we need to push it higher on the priorities list. Could be 2.1 then.

@GoalSmashers sounds great, count me in for testing if needed

@GoalSmashers sounds awesome πŸ‘ .

When doing it please could you consider allowing passing in a source sourcemap as well? Uglifjs also allows this and I think If you use mozillas sourcemap library (on node) then it allows integrating it. I implemented css sourcemap support for less and it would be great to allow less to use clean css to compress the css and transform the sourcemap too.

@lukeapage You stole the words out of my mouth :D +1 for the suggestion.

@lukeapage @sbspk Sure, I'll take a look into it!

+1
Really nice feature! :)

Looking forward to this an willing to help test out in any way I can.

πŸ‘

I'm not sure how this can be done without an AST (and clean-css doesn't create one). Any thoughts @GoalSmashers?

LESS does create a source map, so it might be worth looking at what they're doing for compressing.

@OliverJAsh I've been thinking a lot about it and we may need an AST-like structure to add source maps but there could be another option as well. Need to play a bit more with it to see what fits the best.

+1 This feature would be sooooo useful!

+1 for sourcemaps out
+1 for sourcemaps in

+1

Throwing in my πŸ‘ in support of this. :)

+1 for use with cssmin (gruntjs/grunt-contrib-cssmin#58)

To give you all a short update, the work on source maps is slowly progressing and it should be available for testing in the coming weeks.

I'll likely make 2.3 release solely for source maps as other updates waiting for 2.2 are unnecessarily collecting the dust.

Stay tuned!

Nice news. Keep up the good work!

Great news, looking forward to it! Cheers

Thanks for the future feature, big πŸ‘!

πŸ‘

πŸ‘

Big πŸ‘!

This would be awesome. +1

+1 for support!

+1 πŸ‘

πŸ‘

This is blocking making gulp-minify-css work with gulp-sourcemaps:
https://github.com/jonathanepollack/gulp-minify-css/issues/29#issuecomment-49166181

Any updates? It's been a few months now and this is the final key to full source map support for several projects.

There are couple more fixes to 2.2 and the next milestone is 2.3 with only one feature: source maps! Some preliminary work is already done but marrying it with advanced minification will be quite a challenge.

Great! Thanks for the update and your work on this. Your minification techniques are really fantastic.

clean-css doesn't need to handle sourcemaps as that functionality can be provided by gulp-sourcemaps. It should however treat /*# */ as a special comment as stated on a previous issue.

If the file is changed in any way it invalidates the map, making it
useless.. what good would it do leaving an invalid comment in ?

@bytespider: gulp-sourcemaps won't in any way generate a valid sourcemap. It will fill a sourcemap with the origin source but won't map attributes etc to the generated file. It's not the same thing. If you look at gulp-sourcemaps enabled plugins, they all pass the incoming sourcemap to their underlying library's API that is responsible for creating the new sourcemap file. IT is then reinsterted in the stream by the gulp plugin.

My appologies, I had totally misunderstood the scope of gulp-sourcemaps.

+1 as in "Please add it ASAP" :)

+1 looking forward to this!

πŸ‘

+1 to source maps in (from Sass, for example), source maps out.

+1 for source maps

Source Maps πŸ‘

+1

+1 looking forward to 2.3! (source map in -> source map out)

πŸ‘

+1 🍎

πŸ‘

@jakubpawlowicz, Just curious what the timeline is looking like for version 2.3. Lots of people looking forward to source map support. Thanks!

@shannonmoeller working on it as we speak. Unfortunately it requires some substantial changes to how clean-css works.

@jakubpawlowicz Glad to hear that it's in-progress! Bummer about the level of effort. Thanks for your hard work.

1/2 OT: If you need source map support now, maybe you want to take a look at csswring, although it does not compress as good as clean-css (for a comparison, see http://goalsmashers.github.io/css-minification-benchmark/). sass should also work, because every css file is also a valid scss input.

I also used csswring in my last projects and it works every good with sass + compass + autoprefixer = source maps e.g.: http://www.moelleken.org/ take a look at the source with Google Chome DevTools :)

πŸ‘

Oh boy, please no more "+1". (Yeah, I know. I did it, too. Sorry.)

Could everyone please just write a mail to the GitHub support (support@github.com) with a request for a proper rating system for issues? Subscribers to an issue should only be notified on progress and only the repository maintainer should be notified about votes/ratings for an issue (imo).

Admins for clean css can Lock this thread - github added it with the intention of allowing people to lock threads where discussion was over and it was not just a flood of +1's or off topic discussion..

@lukeapage see comment at the top of this thread

we have some other tasks in the pipeline but we won't leave it unanswered. The more +1's the quicker we get into it.

@lukeapage @RadValentin I don't mind +1s as a reminder of how important it is.

As a side note, here's the update: recently I was able to redo the core of clean-css ( see b06f37d...dd8c14a ) to enable easy addition of source-maps. Stay tuned for update on my progress next week.

Well if you don't mind a reminder, let's remind you! :)
Anything new?