Skip to content

Instantly share code, notes, and snippets.

@mickey
Created Mar 28, 2013
Embed
What would you like to do?
module.exports = function(grunt) {
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-coffee');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-contrib-less');
grunt.loadNpmTasks('grunt-contrib-connect');
// Project configuration.
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
less: {
development: {
options: {
paths: ["src/less"]
},
files: {
"src/css/main.css": "src/less/main.less"
}
}
},
uglify: {
options: {
// banner: grunt.file.read('LICENCE'),
mangle: {toplevel: true},
squeeze: {dead_code: false},
codegen: {quote_keys: true}
},
build: {
src: 'src/js/*.js',
dest: 'build/main.min.js'
}
},
coffee: {
glob_to_multiple: {
expand: true,
cwd: 'src/',
src: ['*.coffee'],
dest: 'src/js/',
ext: '.js'
}
},
watch: {
scripts: {
files: ['src/*.coffee', 'src/less/*.less'],
tasks: ['default'],
options: {
interrupt: true
}
}
},
connect: {
server: {
options: {
port: 9001,
base: 'src',
hostname: '192.168.0.4',
keepalive: true
}
}
}
});
grunt.registerTask('server', ['default', 'connect']);
grunt.registerTask('default', ['coffee', 'uglify', 'less']);
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment