sstur
sstur

Reputation: 1799

CSS compilation/compression and Source Maps v3

Does anyone know of a tool that will compress/minify/combine my CSS files and produce valid v3 SourceMap that can be used with Chrome? Preferably a NodeJS tool.

The compressors I know of for Node are clean-css, csso, css-condense (uses css-parse but chokes on bootstrap.css) and cssmin (port from YUI but has no CLI). None of these appear to have source-map support.

I think SASS (Ruby) and possibly Less.js are working on implementations, but those are preprocessor tools.

Upvotes: 4

Views: 1747

Answers (3)

Vitaly
Vitaly

Reputation: 3460

mincer assets pipeline 1.0.0+ release comes with source maps support. That's ruby's sprockets port to node.js. Latest state of engines is on wiki.

For CSS right now you can use LESS + AutoPrefixer + CssWring chain. SASS also has sourcemaps support, but it's not yet adopted to mincer.

In nearest future Stylus should add source maps support too.

Upvotes: 1

Soeren L. Nielsen
Soeren L. Nielsen

Reputation: 171

I use https://ajaxmin.codeplex.com/ which works great, also on bootstrap.

It can minify JS and CSS. Handles sourcemaps and bundling of files.

Lots of options, but I use a few xml files to define what should be minified and what should be bundled. You can also just use the command line for it.

My usecase was compile time creation. If yours is runtime creation then you should go with something else.

Upvotes: 0

Adrian Heine
Adrian Heine

Reputation: 4131

mincer-sourcemap seems to be able to generate CSS sourcemaps.

Upvotes: 1

Related Questions