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',
src: [
'selectize.default.css',
'selectize.pagination.css',
'selectize.patch.css',
'!*.min.css'
],
dest: 'release/css',
ext: '.min.css'
}]
}
}
Problem is there is only one file named selectize.min.css
I don't want it to minimize only one file. How can I minimize all three of them?
So this ticket is kind of old, but as Peng Lin so eloquently stated above, the selected answer is inadequate for most programmers since it requires too much manual adjustment. It's not maintainable.
Grunt has a way of specifying where the extension dot is in file names. By default, it's set to the first one which effectively changes the file names on output. The property is called extDot. You can read about it Here if you want.
If you set it to last, it will preserve your file names and your original example will work.
Example:
cssmin: {
min: {
files: [{
expand: true,
cwd: 'css',
src: [
'selectize.default.css',
'selectize.pagination.css',
'selectize.patch.css',
'!*.min.css'
],
dest: 'release/css',
ext: '.min.css',
extDot: 'last' // Extensions in filenames begin after the last dot
}]
} }
Hope this helps someone in the future.
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