Last active
December 22, 2015 15:49
-
-
Save danielhusar/6494926 to your computer and use it in GitHub Desktop.
Default grunt tasks without tests
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.exports = function(grunt) { | |
grunt.initConfig({ | |
pkg: grunt.file.readJSON('package.json'), | |
//concat files | |
concat: { | |
app : { | |
src: ['js/*.js', '!js/*min.js'], | |
dest: 'js/all.js' | |
} | |
}, | |
//uglify files | |
uglify: { | |
dist: { | |
src: 'js/*.js', // source files mask | |
dest: 'js/', // destination folder | |
expand: true, // allow dynamic building | |
flatten: true, // remove all unnecessary nesting | |
ext: '.min.js' // replace .js to .min.js | |
} | |
}, | |
//lint | |
jshint: { | |
files: ['<%= concat.app.src %>'] | |
}, | |
//watch files | |
watch: { | |
files: ['sass/*.scss', 'sass/**/*.scss', 'sass/**/**/.scss'], | |
tasks: ['c'] | |
}, | |
//compass for compiling sass | |
compass: { | |
dist: { | |
options: { | |
config: 'config.rb' | |
} | |
} | |
} | |
}); | |
//Dependencies | |
grunt.loadNpmTasks('grunt-contrib-uglify'); | |
grunt.loadNpmTasks('grunt-contrib-jshint'); | |
grunt.loadNpmTasks('grunt-contrib-concat'); | |
grunt.loadNpmTasks('grunt-contrib-watch'); | |
grunt.loadNpmTasks('grunt-contrib-compass'); | |
//Tasks | |
grunt.registerTask('default', ['jshint', 'concat', 'uglify', 'compass']); | |
grunt.registerTask('h', ['jshint']); | |
grunt.registerTask('c', ['concat']); | |
grunt.registerTask('u', ['uglify']); | |
grunt.registerTask('c', ['compass']); | |
grunt.registerTask('w', ['watch']); | |
return grunt; | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"devDependencies":{ | |
"grunt" : "~0.4.0", | |
"grunt-contrib-jshint" : "*", | |
"grunt-contrib-uglify" : "*", | |
"grunt-contrib-concat" : "*", | |
"grunt-contrib-watch" : "*", | |
"grunt-contrib-compass" : "*" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment