Questions tagged [grunt-contrib-cssmin]

A grunt plug-in for compressing and combining CSS files

A grunt plug-in for compressing and combining CSS files: https://github.com/gruntjs/grunt-contrib-cssmin

76 questions
15
votes
2 answers

How to make sure remote @imports are processed correctly with Grunt

I use Grunt to build my project and cssmin task inside. My CSS file contains a remote @import statements and grunt build return a warning: Running "cssmin:generated" (cssmin) task >> Ignoring remote @import of…
tolyasik
  • 345
  • 2
  • 13
14
votes
2 answers

grunt-contrib-cssmin - how to remove comments from minified css

Im using cssmin to minify css files. my config like this: module.exports = function(grunt) { grunt.config.set('cssmin', { site: { src: ['.tmp/public/concat/site.css'], dest: '.tmp/public/min/site.min.css' …
kabiev
  • 299
  • 3
  • 12
12
votes
6 answers

cssmin not correctly handling @import

I am using cssmin on files containing @imports. cssmin is recursively importing local files correctly, but for imports that point to a URL the imports are left inline. This makes the resulting minified CSS invalid because @ rules must be at the…
9
votes
2 answers

How to disable grunt-contrib-cssmin combine?

I have three files: 'selectize.default.css' 'selectize.pagination.css' 'selectize.patch.css' and I want to minimize them. Here is my gruntfile: cssmin: { min: { files: [{ expand: true, cwd: 'css', …
Peng Lin
  • 131
  • 4
8
votes
4 answers

cssmin is giving me "Path must be a string. Received undefined"

My project is a pretty basic yo/angular project. I have the following cssmin config. useminPrepare: { html: '<%= yeoman.app %>/index.html', options: { dest: '<%= yeoman.dist %>', flow: { html: { …
Pompey Magnus
  • 2,191
  • 5
  • 27
  • 40
5
votes
2 answers

why using grunt-contrib-cssmin is changing my css while it should only minify that

I am using grunt-contrib-cssmin to minify my css files. I think this tool (grunt-contrib-cssmin) is only a wrapper for clean-css. Everything is fine except the fact that this grunt plugin is making changes in my css. I have tried to use every option…
Muhammad Raza
  • 424
  • 5
  • 22
5
votes
1 answer

Avoid Grunt cssmin task to remove duplicate entries

In my Gruntfile I'm using cssmin (grunt-contrib-cssmin) task. Something like: cssmin: { css : { src: "dist/styles.css", dest: "dist/styles.min.css" } } The problem is: styles.css is generated with a concat task that…
Christian Benseler
  • 7,907
  • 8
  • 40
  • 71
5
votes
1 answer

Adding a style css file to grunt vendor

Whenever I add manually a css file to my index.html page that file is removed when I build. What configuration am I missing? For instance "rzslider.css" is removed even though it's included in my bower.json. Is there a way to force it to be built…
Mark Lenser
  • 1,070
  • 8
  • 12
5
votes
1 answer

How do we set a target in a grunt cssmin task?

I am trying out cssmin for Grunt According to the docs targets can be defined "according to the grunt Configuring tasks guide." When I create a cssmin task using that pattern, like: cssmin: { my_target: { minify: { src:…
Thomas Andersen
  • 1,501
  • 5
  • 18
  • 23
4
votes
2 answers

Prevent cssMin from removing svg styles

When running the grunt.js task cssMin https://github.com/gruntjs/grunt-contrib-cssmin Svg css properties are being removed. For example: .testClass { r: 4; width: 3px; margin-left: 18px !important; } Gets converted to .testClass { …
Jack Fairfield
  • 1,876
  • 22
  • 25
4
votes
1 answer

grunt-contrib-cssmin : Relative path of images is not replaced in target minified file

I am using grunt-contrib-cssmin, for the minification of my css files. I want the relative urls in the css files to be replaced automatically in my target minified file. I have looked for this problem and found the two options that I can use to…
4
votes
0 answers

Grunt: Concat CSS files from multiple directories breaks URLs

In my project we have CSS files in different directories, as well as other stylesheets from vendors such as twitter bootstrap and font awesome. When in production environment, we're trying to minify and concat all stylesheets into a single one. For…
ecc
  • 1,490
  • 1
  • 17
  • 42
4
votes
1 answer

I want to disable the optimizations done by clean-css tool

I am using grunt-contrib-cssmin, which is a wrapper over the clean-css plugin. I have tried every option to disable optimizations done by clean-css, I only want clean-css to minify my css files, but unfortunately its changing them, for example…
3
votes
1 answer

Unable to write "css" file (Error code: EISDIR) Grunt cssmin

I have defined a uncss grunt task, I want add .min.css to all my files content in the folder /css, but when I run grunt command and save my css changes (the task watch is looking), I get the following error in console: Unable to write "css" file…
Funny Frontend
  • 3,807
  • 11
  • 37
  • 56
3
votes
1 answer

Grunt: style: 'compressed' VS cssmin

I am quite new to Grunt and I am wondering why one should use grunt-contrib-cssmin instead of creating dev/dist versions like in this example: sass: { dist: { options: { style: 'compressed', }, …
user1861373
  • 85
  • 1
  • 9
1
2 3 4 5 6