enguerranws
enguerranws

Reputation: 8233

Grunt sass multiple dest files

Let's see this part of configuration of grunt sass module :

dev: {
    src: 'dev/sass/style.scss',
    dest: '../site/web/assets/css/style.css',
    options: {
        style: 'expand',
        compass: true
    }
}

This works as expected. Now I want Grunt to compile my scss file to 2 destinations, so I tried :

dev: {
    src: 'dev/sass/style.scss',
    dest: ['../site/web/assets/css/style.css','another/path/style.css']
    options: {
        style: 'expand',
        compass: true
    }
}

But it returns an error :

Warning: Unable to write "../site/web/assets/css/style.css,another/path/style.css" file (Error code: undefined). Use --force to continue.

Is it possible ? What am I doing wrong ?

Upvotes: 1

Views: 1168

Answers (1)

hereandnow78
hereandnow78

Reputation: 14434

dest must be a string not an array. you can't define multiple destination files.

you should use the

Files Object Format

dev: {
    options: {
        style: 'expand',
        compass: true
    },
    files: {
        '../site/web/assets/css/style.css': ['dev/sass/style.scss'],
        'another/path/style.css': ['dev/sass/style.scss']
    }
}

or Files Array Format

dev: {
    options: {
        style: 'expand',
        compass: true
    },
    files: [
      {src: ['dev/sass/style.scss'], dest: '../site/web/assets/css/style.css'}, 
      {src: ['dev/sass/style.scss'], dest: 'another/path/style.css'} 
    ]
}    

Upvotes: 2

Related Questions