Skip to content

Instantly share code, notes, and snippets.

@thathurtabit
Created February 6, 2014 12:02
Show Gist options
  • Save thathurtabit/8842845 to your computer and use it in GitHub Desktop.
Save thathurtabit/8842845 to your computer and use it in GitHub Desktop.
Gruntfile.js for LESS only
module.exports = function(grunt) {
// Project configuration.
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
uglify: {
options: {
banner: '/*! <%= pkg.name %> <%= grunt.template.today("yyyy-mm-dd") %> */\n'
}
},
watch: {
styles: {
files: ['less/*.less'],
tasks: ['less'],
options: {
spawn: false,
},
},
},
less: {
development: {
options: {
compress: true,
yuicompress: true,
optimization: 2
},
files: {
"compiled.css": "less/core.less"
}
}
},
connect: {
server: {
options: {
port: 9999,
base: 'www-root'
}
}
}
});
// Load the plugin that provides the "uglify" task.
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-contrib-less');
grunt.loadNpmTasks('grunt-contrib-connect');
// Default task(s).
grunt.registerTask('default', [ 'less', 'uglify', 'connect', 'watch']);
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment