Skip to content

Instantly share code, notes, and snippets.

@mickey
Created March 28, 2013 23:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mickey/5267665 to your computer and use it in GitHub Desktop.
Save mickey/5267665 to your computer and use it in GitHub Desktop.
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