Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to use several src and dest with grunt cssmin task?

Tags:

gruntjs

I'm trying to use grunt cssmin on two files: style.css and ie.css (without concatenating them).

For the moment I have this in my grunt.js:

cssmin: {
  dist: {
    src: ['<banner:meta.wpblock>', '../style.css'],
    dest: '../style.css'
  }
},

Is it possible to specify several src (../style.css and ../ie.css) and several dest (../style.css and ../ie.css)?

like image 699
edDraw Avatar asked Sep 04 '12 12:09

edDraw


2 Answers

Currently no, although when grunt 0.4 is released and the task is updated accordingly, you'll be able to do:

cssmin: {
  dist: {
    files: {
        '../style.css': ['<banner:meta.wpblock>', '../style.css'],
        '../style.css': ['<banner:meta.wpblock>', '../style.css']
    }
  }
},
like image 60
Sindre Sorhus Avatar answered Nov 14 '22 16:11

Sindre Sorhus


I think you could use grunt's compact format to do this.

For example:

cssmin: {
    'production/css/style.css': ['<banner:meta.wpblock>', 'css/style.css'],
    'production/css/ie.css': ['<banner:meta.wpblock>', 'css/ie.css']
},
like image 25
user1783440 Avatar answered Nov 14 '22 16:11

user1783440