Skip to content

Instantly share code, notes, and snippets.

@jacobcpeters
Created August 18, 2014 22:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jacobcpeters/bf4f6575731dcbb05be9 to your computer and use it in GitHub Desktop.
Save jacobcpeters/bf4f6575731dcbb05be9 to your computer and use it in GitHub Desktop.
Simple grunt setup with external config files
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']);
};
---
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