Skip to content

Instantly share code, notes, and snippets.

@twilson63
Last active December 16, 2015 12:49
Show Gist options
  • Save twilson63/5437514 to your computer and use it in GitHub Desktop.
Save twilson63/5437514 to your computer and use it in GitHub Desktop.
Gruntfile.js Template
var www = 'public';
var appFiles = [
www + '/app/app.js',
www + '/app/services/*.js',
www + '/app/filters/*.js',
www + '/app/directives/*.js',
www + '/app/controllers/*.js'
];
module.exports = function(grunt) {
grunt.initConfig({
jshint: {
files: appFiles
},
concat: {
app: {
src: appFiles,
dest: www + '/ng-app.js'
}
},
uglify: {
grxnet: {
src: [ www + '/ng-app.js'],
dest: www + '/ng-app.min.js'
}
},
watch: {
scripts: {
files: www + '/app/**/*.js',
tasks: ['jshint','concat'],
options: {
interrupt: true
}
}
}
});
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.registerTask('default', 'jshint concat uglify');
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment