From bfaaec5ac9b2d8f99b0168553d0445733249565b Mon Sep 17 00:00:00 2001 From: CJ Patoilo Date: Sat, 26 Dec 2015 18:38:44 -0300 Subject: [PATCH] updated gruntfile --- gruntfile.js | 48 +++++++++++++++++++++++++++++++++++------------- 1 file changed, 35 insertions(+), 13 deletions(-) diff --git a/gruntfile.js b/gruntfile.js index 560a981..ab55c41 100644 --- a/gruntfile.js +++ b/gruntfile.js @@ -10,12 +10,22 @@ module.exports = function ( grunt ) { // Define the configuration grunt.initConfig({ - // DEFAULT TASK - // ================================================================ - // Specifics of npm's package.json handling pkg: grunt.file.readJSON( 'package.json' ), + // Banner + banner: + '/*!\n'+ + ' * Milligram v<%= pkg.version %>\n'+ + ' * <%= pkg.homepage %>\n'+ + ' *\n'+ + ' * Copyright (c) 2015, CJ Patoilo\n'+ + ' * Licensed under the <%= pkg.license %> license\n'+ + '*/\n\n', + + // DEFAULT TASK + // ================================================================ + // Watch files and process the above tasks watch: { options: { @@ -31,7 +41,7 @@ module.exports = function ( grunt ) { }, sass: { files: [ - 'sass/**/*.sass' + 'src/**/*.sass' ], tasks: [ 'sass', @@ -52,39 +62,51 @@ module.exports = function ( grunt ) { sass: { minify: { options: { + banner: '<%= banner %>', noCache: true, sourcemap: 'none', style: 'compressed' }, files: { - 'dist/milligram.min.css': [ 'sass/**/*.sass', '!sass/**/_*.sass' ] + 'dist/milligram.min.css': [ 'src/**/*.sass', '!src/**/_*.sass' ] } }, default: { options: { + banner: '<%= banner %>', noCache: true, sourcemap: 'none', style: 'expanded' }, files: { - 'dist/milligram.css': [ 'sass/**/*.sass', '!sass/**/_*.sass' ] + 'dist/milligram.css': [ 'src/**/*.sass', '!src/**/_*.sass' ] } } }, // Parse CSS and add vendor-prefixed CSS properties using the Can I Use database. autoprefixer: { - all: { + minify: { options: { browsers: [ - 'last 2 versions', - 'ie 8', - 'ie 9' + 'last 1 versions' + ], + map: { + inline: false + } + }, + files: { + 'dist/milligram.min.css': 'dist/milligram.min.css' + } + }, + default: { + options: { + browsers: [ + 'last 1 versions' ], map: false }, files: { - 'dist/milligram.min.css': 'dist/milligram.min.css', 'dist/milligram.css': 'dist/milligram.css' } } @@ -97,13 +119,13 @@ module.exports = function ( grunt ) { // REGISTER TASKS // ================================================================ - // Default tasks + // Default task grunt.registerTask( 'default', [ 'build', 'watch' ]); - // Build tasks + // Build task grunt.registerTask( 'build', [ 'clean', 'sass',