Skip to content

Instantly share code, notes, and snippets.

@alejandroiglesias
Created April 15, 2013 21:49
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 alejandroiglesias/5391546 to your computer and use it in GitHub Desktop.
Save alejandroiglesias/5391546 to your computer and use it in GitHub Desktop.
/*global module:false*/
module.exports = function(grunt) {
// Project configuration.
grunt.initConfig({
// Metadata.
pkg: grunt.file.readJSON('package.json'),
banner: '/*! <%= pkg.title || pkg.name %> - v<%= pkg.version %> - ' +
'<%= grunt.template.today("yyyy-mm-dd") %>\n' +
'<%= pkg.homepage ? "* " + pkg.homepage + "\\n" : "" %>' +
'* Copyright (c) <%= grunt.template.today("yyyy") %> <%= pkg.author.name %>;' +
' Licensed <%= _.pluck(pkg.licenses, "type").join(", ") %> */\n',
// Task configuration.
concat: {
options: {
banner: '<%= banner %>',
stripBanners: true
},
dist: {
src: ['public/js/vendor/overthrow.js', 'public/js/helper.js', 'public/js/main.js'],
dest: 'public/js/main.min.js'
}
},
uglify: {
options: {
banner: '<%= banner %>'
},
dist: {
src: '<%= concat.dist.dest %>',
dest: '<%= concat.dist.dest %>'
}
},
jshint: {
options: {
curly: true,
eqeqeq: true,
immed: true,
latedef: true,
newcap: true,
noarg: true,
sub: true,
undef: true,
unused: true,
boss: true,
eqnull: true,
browser: true,
globals: {
jQuery: true
}
},
gruntfile: {
src: 'Gruntfile.js'
}//,
// app: {
// src: ['public/js/**/*.js', '!public/js/main.min.js', '!public/js/vendor/**/*.js']
// }
},
recess: {
dev: {
options: {
compile: true
},
files: '<%= recess.prod.files %>'
},
prod: {
options: {
compile: true,
compress: true
},
files: {
'public/css/main.css': ['public/css/src/main.less']
}
}
},
manifest: {
generate: {
options: {
basePath: "public/",
timestamp: true
},
src: [
"css/main.css",
"css/fonts/icomoon.eot",
"css/fonts/icomoon.svg",
"css/fonts/icomoon.ttf",
"css/fonts/icomoon.woff",
"js/main.min.js",
"js/zepto.min.js",
"js/jquery.min.js",
"img/icon-driving.png",
"img/icon-info.png",
"img/icon-listing.png",
"img/icon-map.png",
"img/icon-marker.png",
"img/icon-walking.png",
"img/logo-banelco.png",
"img/logo-link.png",
"img/logo.png",
"img/mobile-pic.png"
]
}
},
watch: {
gruntfile: {
files: '<%= jshint.gruntfile.src %>',
tasks: ['jshint:gruntfile']
},
// app: {
// files: '<%= jshint.app.src %>',
// tasks: ['jshint:app', 'concat']
// },
styles: {
files: '<%= recess.prod.files %>',
tasks: ['recess:dev']
}
}
});
// These plugins provide necessary tasks.
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-contrib-manifest');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-recess');
// Default task.
grunt.registerTask('dev', ['jshint', 'concat', 'uglify', 'recess:dev']);
grunt.registerTask('default', ['jshint', 'concat', 'uglify', 'recess:prod', 'manifest']);
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment