|<- [[Hinting your code with Grunt]]|[[Bundling client scripts with Browserify]] ->|
Préprocesser du LESS
npm install grunt-contrib-less --save-dev
Automatiser les préfixes
npm install grunt-autoprefixer --save-dev
// GruntFile.js
module.export = function(grunt) {
grunt.initConfig({
jshint: {
(...)
},
less: {
production: {
files {
"public/css/style.css": ["less/*.less"]
},
},
},
autoprefixer: {
single_file: {
src: "public/css/style.css",
dest: "public/css/style.css"
}
},
});
grunt.loadNpmTasks("grunt-contrib-jshint");
grunt.loadNpmTasks("grunt-contrib-less");
grunt.loadNpmTasks("grunt-autoprefixer");
grunt.registerTask("css", ["less", "autoprefixer"]);
grunt.registerTask("default", ["jshint"]);
};
On appelle la tâche css (process+prefix) :
grunt css