30 lines
887 B
JavaScript
30 lines
887 B
JavaScript
|
|
//npm install grunt grunt-contrib-less grunt-contrib-watch jit-grunt --save-dev
|
||
|
|
module.exports = function (grunt) {
|
||
|
|
require('jit-grunt')(grunt);
|
||
|
|
|
||
|
|
grunt.initConfig({
|
||
|
|
less: {
|
||
|
|
development: {
|
||
|
|
options: {
|
||
|
|
compress: true,
|
||
|
|
yuicompress: true,
|
||
|
|
optimization: 2
|
||
|
|
},
|
||
|
|
files: {
|
||
|
|
'client/css/dist/bundle.min.css': 'client/js/components/**/*.less' // destination file and source file
|
||
|
|
}
|
||
|
|
}
|
||
|
|
},
|
||
|
|
watch: {
|
||
|
|
styles: {
|
||
|
|
files: ['client/js/components/**/*.less'], // which files to watch
|
||
|
|
tasks: ['less'],
|
||
|
|
options: {
|
||
|
|
nospawn: true
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|
||
|
|
});
|
||
|
|
grunt.registerTask('default', ['less', 'watch']);
|
||
|
|
};
|