Skip to content

Instantly share code, notes, and snippets.

@aleohl
Created June 19, 2014 12:10
Show Gist options
  • Save aleohl/9cee83cd91d00dbfccf0 to your computer and use it in GitHub Desktop.
Save aleohl/9cee83cd91d00dbfccf0 to your computer and use it in GitHub Desktop.
module.exports = function(grunt) {
//Initializing the configuration object
grunt.initConfig({
// Task configuration
less: {
development: {
options: {
compress: true
},
files: {
"./public_html/assets/css/main.css":"./assets/less/main.less"
}
}
},
concat: {
options: {
separator: ';'
},
js: {
src: [
'./bower_components/jquery/dist/jquery.js',
'./bower_components/bootstrap/dist/js/bootstrap.js',
'./assets/js/main.js'
],
dest: './public_html/assets/js/main.js'
}
},
uglify: {
options: {
mangle: false // Use if you want the names of your functions and variables unchanged
},
js: {
files: {
'./public_html/assets/js/main.js': './public_html/assets/js/main.js'
}
}
},
watch: {
js: {
files: [
//watched files
'./bower_components/jquery/jquery.js',
'./bower_components/bootstrap/dist/js/bootstrap.js',
'./assets/js/main.js'
],
tasks: ['concat:js','uglify:js'], //tasks to run
options: {
livereload: true //reloads the browser
}
},
less: {
files: ['./assets/less/*.less'], //watched files
tasks: ['less'], //tasks to run
options: {
livereload: true //reloads the browser
}
}
}
});
// Plugin loading
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-contrib-less');
grunt.loadNpmTasks('grunt-contrib-uglify');
// Task definition
grunt.registerTask('default', ['watch']);
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment