Skip to content

Instantly share code, notes, and snippets.

@Remigr
Last active August 29, 2015 14:02
Show Gist options
  • Save Remigr/98917ae6c0b862a4b90a to your computer and use it in GitHub Desktop.
Save Remigr/98917ae6c0b862a4b90a to your computer and use it in GitHub Desktop.
1) Run in the project folder :
$ npm install grunt-contrib-less --save-dev
2) Add less to config/env/all.js :
less: [
'public/modules/*/less/*.less'
],
and modify the css config to this :
css: [
'public/modules/*/less/*.css'
],
3) In gruntfile.js
*Change clientCSS to ClientLESS (line 10) :
clientLESS: ['public/modules/**/less/*.less'],
*Change clientCSS to clientLESS (line 44) :
clientLESS: {
files: watchFiles.clientLESS,
tasks: ['less', 'csslint'],
options: {
livereload: true
}
}
*Add less task :
less: {
development: {
files: {
'public/dist/modules.css': '<%= applicationLESSFiles %>'
}
}
},
*Add LESS config (line 160) :
grunt.config.set('applicationLESSFiles', config.assets.less);
*Add the task to the lint tasks :
grunt.registerTask('lint', ['jshint', 'less', 'csslint']);
4) Rename all the directories public/modules/**/css to public/modules/**/less, and rename all the .css extension to .less.
Kudo's to Rémi.
6/2014
@sielay
Copy link

sielay commented Dec 3, 2014

I think line 160 should be

grunt.registerTask('lint', ['loadConfig', 'jshint', 'less', 'csslint']);

otherwise you have no config

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment