I want to generate .css partial files from the corresponding .less files
I use the latest versions available from npm, [email protected], [email protected]
Prior to Grunt version 0.4 I could simply specify the pattern:
htdocs/less/*.less
as source
htdocs/css/*.css
as destination
and all the files from the folder htdocs/less
would be generated into the folder htdocs/css
Since v0.4 the destination pattern does no longer work, all files from the folder htdocs/less
are concatenated into one file named *.css
How can I configure the task that it generates all files instead concatenating them into one file.
I do not want list the files individually.
Couldn't find an answer in the Grunt documentation http://gruntjs.com/configuring-tasks#files does
Thank You.
My Gruntfile.js (extract):
module.exports = function (grunt) {
grunt.initConfig({
less: {
development: {
files: {
"htdocs/css/*.css": "htdocs/less/*.less"
}
}
},
});
};
You'd want to read the Building the files object dynamically section in the docs.
This would be a direct translation from your current config:
module.exports = function (grunt) {
grunt.initConfig({
less: {
development: {
files: [{
expand: true, // Enable dynamic expansion.
cwd: 'htdocs/less', // Src matches are relative to this path.
src: ['*.less'], // Actual pattern(s) to match.
dest: 'htdocs/css', // Destination path prefix.
ext: '.css', // Dest filepaths will have this extension.
}]
}
},
});
};
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With