Created
August 18, 2014 22:10
-
-
Save jacobcpeters/bf4f6575731dcbb05be9 to your computer and use it in GitHub Desktop.
Simple grunt setup with external config files
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) { | |
// Project configuration. | |
grunt.initConfig({ | |
pkg: grunt.file.readJSON('package.json'), | |
uglify: grunt.file.readYAML('grunt-config/uglify.yaml'), | |
watch: grunt.file.readYAML('grunt-config/watch.yaml'), | |
sass: grunt.file.readYAML('grunt-config/sass.yaml'), | |
autoprefixer: grunt.file.readYAML('grunt-config/autoprefixer.yaml') | |
}); | |
// Load the plugins | |
grunt.loadNpmTasks('grunt-contrib-uglify'); | |
grunt.loadNpmTasks('grunt-contrib-sass'); | |
grunt.loadNpmTasks('grunt-contrib-watch'); | |
grunt.loadNpmTasks('grunt-autoprefixer'); | |
// Default task(s). | |
grunt.registerTask('default', ['watch']); | |
// Custom Tasks | |
grunt.registerTask('styles', ['sass', 'autoprefixer']); | |
grunt.registerTask('build', ['uglify', 'sass', 'autoprefixer']); | |
grunt.registerTask('ugly', ['uglify']); | |
}; |
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
--- | |
scripts: | |
options: | |
spawn: true | |
files: | |
- "**/*.js" | |
- "**/*.scss" | |
tasks: | |
- uglify | |
- sass | |
- autoprefixer |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment