Created
October 20, 2015 18:56
-
-
Save taniarascia/1a12a744b6f0efff9093 to your computer and use it in GitHub Desktop.
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
// Load Grunt | |
module.exports = function (grunt) { | |
grunt.initConfig({ | |
pkg: grunt.file.readJSON('package.json'), | |
// Tasks | |
sass: { // Begin Sass Plugin | |
dist: { | |
options: { | |
sourcemap: 'none' | |
}, | |
files: [{ | |
expand: true, | |
cwd: 'sass', | |
src: ['**/*.scss'], | |
dest: 'css', | |
ext: '.css' | |
}] | |
} | |
}, | |
postcss: { // Begin Post CSS Plugin | |
options: { | |
map: false, | |
processors: [ | |
require('autoprefixer')({ | |
browsers: ['last 2 versions'] | |
}) | |
] | |
}, | |
dist: { | |
src: 'css/style.css' | |
} | |
}, | |
cssmin: { // Begin CSS Minify Plugin | |
target: { | |
files: [{ | |
expand: true, | |
cwd: 'css', | |
src: ['*.css', '!*.min.css'], | |
dest: 'css', | |
ext: '.min.css' | |
}] | |
} | |
}, | |
uglify: { // Begin JS Uglify Plugin | |
build: { | |
src: ['src/*.js'], | |
dest: 'js/script.min.js' | |
} | |
}, | |
watch: { // Compile everything into one task with Watch Plugin | |
css: { | |
files: '**/*.scss', | |
tasks: ['sass', 'postcss', 'cssmin'] | |
}, | |
js: { | |
files: '**/*.js', | |
tasks: ['uglify'] | |
} | |
} | |
}); | |
// Load Grunt plugins | |
grunt.loadNpmTasks('grunt-contrib-sass'); | |
grunt.loadNpmTasks('grunt-postcss'); | |
grunt.loadNpmTasks('grunt-contrib-cssmin'); | |
grunt.loadNpmTasks('grunt-contrib-uglify'); | |
grunt.loadNpmTasks('grunt-contrib-watch'); | |
// Register Grunt tasks | |
grunt.registerTask('default', ['watch']); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment