Install - logaegae/project_study GitHub Wiki
Grunt is a Javascript task runner that can be used to compile Sass, Less or run many other plugins. It depends on theNode.js package manager (npm) So, First to do is install node.js
$ sudo apt-get install curl
$ curl -sL https://deb.nodesource.com/setup_6.x | sudo -E bash -
$ sudo apt-get install -y nodejs
$ sudo npm install -g grunt-cli
$ cd ~/myproject
$ echo "{}" > package.json
$ npm install grunt --save-dev
$ nodejs --version
v0.10.33
$ npm --version
1.4.28
$ grunt --version
grunt-cli v0.1.13
grunt v0.4.5
$ npm init
$ npm install
module.exports = function(grunt){
// Project configuration.
grunt.initConfig({
concat: {
// concat 시작
css: {
src: ['libs/css/*.css'],
dest: 'css/default.css',
},
js: {
src: ['libs/js/*.js'],
dest: 'js/default.js',
}
//concat 끝
},
watch: {
// watch stat
css: {
files: ['libs/css/*.css'],
tasks: ['concat'],
},
js: {
files: ['libs/**/*.js'],
tasks: ['concat'],
},
less:{
files: ['libs/**/*.less'],
tasks: ['less'],
}
// watch end
},
less:{
development:{
options:{
paths:["libs/less"],
},
files:{
'libs/css/less.css' : 'libs/less/*.less'
}
},
},
});
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-contrib-less');
}
$ grunt