Skip to content

Instantly share code, notes, and snippets.

@tlovett1
Created January 10, 2014 15:47
Show Gist options
  • Save tlovett1/8356775 to your computer and use it in GitHub Desktop.
Save tlovett1/8356775 to your computer and use it in GitHub Desktop.
Gruntfile.js
module.exports = function ( grunt ) {
grunt.initConfig( {
pkg: grunt.file.readJSON( 'package.json' ),
concat: {
js: {
src: [
'js/config.js',
'js/utils.js',
'js/app.js',
'js/parent-models/*',
'js/models/*',
'js/collections/*',
'js/parent-views/*',
'js/views/*',
'js/main.js',
],
dest: 'build/combined-app.js'
}
},
uglify: {
js: {
files: {
'build/combined-app.min.js': ['build/combined-app.js']
}
}
},
jshint: {
main: {
options: {
smarttabs: true,
},
files: {
src: [
'js/config.js',
'js/utils.js',
'js/app.js',
'js/parent-models/*',
'js/models/*',
'js/collections/*',
'js/parent-views/*',
'js/views/*',
'js/main.js',
]
},
}
},
watch: {
files: ['js/*', 'js/parent-models/*', 'js/models/*', 'js/collections/*', 'js/parent-views/*', 'js/views/*'],
tasks: ['concat', 'uglify']
}
});
grunt.loadNpmTasks( 'grunt-contrib-concat' );
grunt.loadNpmTasks( 'grunt-contrib-uglify' );
grunt.loadNpmTasks( 'grunt-contrib-jshint' );
grunt.loadNpmTasks( 'grunt-contrib-watch' );
grunt.registerTask( 'default', ['concat:js', 'uglify:js'] );
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment