updated gruntfile

This commit is contained in:
CJ Patoilo 2015-12-26 18:38:44 -03:00
parent 4051000c66
commit bfaaec5ac9

View File

@ -10,12 +10,22 @@ module.exports = function ( grunt ) {
// Define the configuration // Define the configuration
grunt.initConfig({ grunt.initConfig({
// DEFAULT TASK
// ================================================================
// Specifics of npm's package.json handling // Specifics of npm's package.json handling
pkg: grunt.file.readJSON( 'package.json' ), 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 files and process the above tasks
watch: { watch: {
options: { options: {
@ -31,7 +41,7 @@ module.exports = function ( grunt ) {
}, },
sass: { sass: {
files: [ files: [
'sass/**/*.sass' 'src/**/*.sass'
], ],
tasks: [ tasks: [
'sass', 'sass',
@ -52,39 +62,51 @@ module.exports = function ( grunt ) {
sass: { sass: {
minify: { minify: {
options: { options: {
banner: '<%= banner %>',
noCache: true, noCache: true,
sourcemap: 'none', sourcemap: 'none',
style: 'compressed' style: 'compressed'
}, },
files: { files: {
'dist/milligram.min.css': [ 'sass/**/*.sass', '!sass/**/_*.sass' ] 'dist/milligram.min.css': [ 'src/**/*.sass', '!src/**/_*.sass' ]
} }
}, },
default: { default: {
options: { options: {
banner: '<%= banner %>',
noCache: true, noCache: true,
sourcemap: 'none', sourcemap: 'none',
style: 'expanded' style: 'expanded'
}, },
files: { 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. // Parse CSS and add vendor-prefixed CSS properties using the Can I Use database.
autoprefixer: { autoprefixer: {
all: { minify: {
options: { options: {
browsers: [ browsers: [
'last 2 versions', 'last 1 versions'
'ie 8', ],
'ie 9' map: {
inline: false
}
},
files: {
'dist/milligram.min.css': 'dist/milligram.min.css'
}
},
default: {
options: {
browsers: [
'last 1 versions'
], ],
map: false map: false
}, },
files: { files: {
'dist/milligram.min.css': 'dist/milligram.min.css',
'dist/milligram.css': 'dist/milligram.css' 'dist/milligram.css': 'dist/milligram.css'
} }
} }
@ -97,13 +119,13 @@ module.exports = function ( grunt ) {
// REGISTER TASKS // REGISTER TASKS
// ================================================================ // ================================================================
// Default tasks // Default task
grunt.registerTask( 'default', [ grunt.registerTask( 'default', [
'build', 'build',
'watch' 'watch'
]); ]);
// Build tasks // Build task
grunt.registerTask( 'build', [ grunt.registerTask( 'build', [
'clean', 'clean',
'sass', 'sass',