Skip to content

Instantly share code, notes, and snippets.

@radupotop
Created June 3, 2013 10:22
Show Gist options
  • Save radupotop/5697315 to your computer and use it in GitHub Desktop.
Save radupotop/5697315 to your computer and use it in GitHub Desktop.
module.exports = function(grunt) {
var appbanner = '/*! Sendmachine <%= grunt.template.today("yyyy-mm-dd HH:MM:ss Z") %> */\nvar build = "<%= grunt.template.today("yyyy-mm-dd HH:MM:ss Z") %>";\n';
grunt.initConfig({
//~pkg: grunt.file.readJSON('package.json'),
concat: {
options: {
banner: appbanner
},
dist: {
src: ['js/**/*.js', 'js/*.js'],
dest: 'sm.js'
}
},
uglify: {
options: {
banner: appbanner,
mangle: false
},
build: {
src: 'sm.js',
dest: 'sm.min.js'
}
},
jshint: {
files: ['gruntfile.js', 'js/**/*.js', 'js/*.js'],
options: {
// options here to override JSHint defaults
globals: {
jQuery: true,
console: true,
module: true,
document: true
}
}
},
less: {
options: {
yuicompress: true,
},
files: ['css/sm.less']
},
});
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-contrib-less');
grunt.registerTask('default', ['concat', 'uglify', 'less']);
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment