Skip to content

Instantly share code, notes, and snippets.

@cbourdage
Created April 13, 2015 18:25
Show Gist options
  • Save cbourdage/8b1c69c245b98cfe9570 to your computer and use it in GitHub Desktop.
Save cbourdage/8b1c69c245b98cfe9570 to your computer and use it in GitHub Desktop.
sample grunt configuration for js combining/minification
// Project configuration.
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
clean: {
js: [
'js/gorilla/deploy/*.js',
'js/gorilla/plugins.js'
]
},
// Concatenate gorilla lib files into a single plugins file
concat: {
options: {
separator: "\n\n"
},
build: {
src: [
'js/gorilla/*.js',
'!js/gorilla/plugins.js',
'!js/gorilla/utilities.js'
],
dest: 'js/gorilla/plugins.js'
},
deploy: {
src: [
'js/gorilla/deploy/*.js'
],
dest: 'js/gorilla/plugins.js'
}
},
// Minifies our javascript files
uglify: {
options: {
banner: '/*! <%=pkg.name %> - v<%=pkg.version %> -' + '<%=grunt.template.today("yyyy-mm-dd") %> */' + "\n",
mangle: true,
compress: false
/*compress: {
drop_console: true
}*/
},
deploy: {
files: [{
expand: true,
cwd: 'js/gorilla',
src: [
'*.js',
'!utilities.js'
],
dest: 'js/gorilla/deploy'
}]
}
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment