GeezerVison is showing github.com — Source Maps · Issue #125 · clean-css/clean-css
ActivityGoalSmashers commented on Aug 8, 2013 @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! shannonmoeller commented on Aug 9, 2013 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! GoalSmashers commented on Aug 9, 2013 Ah, sneaky @imports! Challenge accepted :-) Kienz commented on Oct 22, 2013 GoalSmashers commented on Oct 22, 2013 @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. Subash commented on Nov 14, 2013 +1 This will be one of the most useful feature. iki commented on Nov 15, 2013 +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 GoalSmashers commented on Nov 15, 2013 @iki @sbspk looks like we need to push it higher on the priorities list. Could be 2.1 then. iki commented on Nov 16, 2013 Subash commented on Nov 16, 2013 GoalSmashers commented on Nov 16, 2013 lukeapage commented on Nov 16, 2013 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. Subash commented on Nov 17, 2013 @lukeapage You stole the words out of my mouth :D +1 for the suggestion. GoalSmashers commented on Nov 17, 2013 jakubpawlowicz commented on Dec 8, 2014 I consider the initial version of source maps as ready for 3.0 unless someone finds any bug(s). 🍻 naartjie commented on Dec 8, 2014
give SASS + clean-css a try
@jakubpawlowicz sure, I'm trying to get to it, I just ran into some problems this eve: #563 #565 naartjie commented on Dec 8, 2014
use target option pointing to a directory
When I changed root: srcDir to target: srcDir, I lost the whole source map, i.e. just an empty skeleton gets generated. gerbenvandijk commented on Dec 8, 2014 🍺 awesome! hope it ends up in the grunt-contrib-cssmin repo soon as well 👍 jakubpawlowicz commented on Dec 9, 2014 @naartjie would you be able to share your code? I can take a look later today.
@gerbenvandijk it would be great indeed! jakubpawlowicz commented on Dec 9, 2014 I've been able to verify that SASS source maps work fine too. I'll merge the branch to master now so please open a new issue if you spot anything wrong about source maps. naartjie commented on Dec 10, 2014 I can also verify from my side, that SASS source maps in are working. Sorry it took a while.
👍 for merging it into master. Super cool.
Edit: just to be clear on this, I had to use version 3.0 of libsass for this to work, as it wasn't working on more recent libsass versions. jakubpawlowicz commented on Dec 10, 2014 naartjie commented on Dec 10, 2014
@naartjie would you be able to share your code? I can take a look later today.
Sure thing. Here is a self contained test, which should exemplify my understanding of it:
var fs = require('fs');
var CleanCss = require('clean-css');
fs.writeFileSync('./my.css', 'body {color:red;}');
var cleanCss = new CleanCss({ sourceMap: true, target: process.cwd() });
var out = cleanCss.minify('@import url(my.css)').sourceMap.toString();
// out = {"version":3,"sources":[],"names":[],"mappings":""}
I'm sure I'm just doing something silly, or misunderstanding your instructions somehow. Thanks for looking into it. jakubpawlowicz commented on Dec 10, 2014 That's how you should do it, however you're missing a semicolon in import: '@import url(my.css);'. naartjie commented on Dec 10, 2014
missing a semicolon
Doh! that fixes it. Told you it was silly!! ;-) Thanks a mil!! jakubpawlowicz commented on Dec 10, 2014 naartjie commented on Dec 10, 2014 jakubpawlowicz commented on Dec 10, 2014 I'll sure have once 3.0 is out :-D
MetadataMetadataDevelopmentNo branches or pull requestsIssue actions
|