Created
January 2, 2015 05:45
-
-
Save pryley/1a24e30640b0b75557a7 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
module.exports = function( grunt ) | |
{ | |
'use strict'; | |
grunt.initConfig( { | |
clean: { | |
dist: [ | |
'public/assets/css/*', | |
] | |
}, | |
compass: { | |
dist: { | |
options: { | |
sourcemap: true, | |
config : 'config.rb' | |
} | |
} | |
}, | |
grunticon: { | |
svg: { | |
files: [{ | |
expand: true, | |
cwd : 'app/assets/svg/min', | |
src : [ '*.svg' ], | |
dest : "public/assets/css" | |
} | |
], | |
options: { | |
datasvgcss: 'svg.css', | |
datapngcss: 'png.css', | |
urlpngcss : 'fallback.css', | |
pngfolder : 'public/assets/img/fallback', | |
cssprefix : '.svg-' | |
} | |
} | |
}, | |
postcss: { | |
options: { | |
map: false, | |
processors: [ | |
require( 'csswring' )( { removeAllComments: true } ).postcss | |
] | |
}, | |
dist: { | |
src: 'public/assets/css/*.css' | |
} | |
}, | |
svgmin: { | |
options: { | |
plugins: [ | |
{ removeViewBox: false }, | |
{ removeUselessStrokeAndFill: false } | |
] | |
}, | |
dist: { | |
files: [ | |
{ | |
expand: true, | |
cwd : 'app/assets/svg', | |
src : [ '*.svg' ], | |
dest : 'app/assets/svg/min', | |
ext : '.svg' | |
} | |
] | |
} | |
}, | |
watch: { | |
options: { | |
livereload: true | |
}, | |
css: { | |
files: [ | |
'app/assets/scss/**/*.scss' | |
], | |
tasks: [ | |
'compass', | |
'postcss' | |
] | |
}, | |
svg: { | |
files: [ | |
'app/assets/svg/*.svg' | |
], | |
tasks: [ | |
'svgmin', | |
'grunticon:svg', | |
'compass', | |
'postcss' | |
] | |
} | |
} | |
} ); | |
// Load tasks | |
grunt.loadNpmTasks( 'grunt-contrib-clean' ); | |
grunt.loadNpmTasks( 'grunt-contrib-compass' ); | |
grunt.loadNpmTasks( 'grunt-contrib-concat' ); | |
grunt.loadNpmTasks( 'grunt-contrib-watch' ); | |
grunt.loadNpmTasks( 'grunt-grunticon' ); | |
grunt.loadNpmTasks( 'grunt-postcss' ); | |
grunt.loadNpmTasks( 'grunt-svgmin' ); | |
// Register tasks | |
grunt.registerTask( 'default', [ | |
'clean', | |
'svgmin', | |
'grunticon:svg', | |
'compass', | |
'postcss', | |
] ); | |
grunt.registerTask( 'dev', [ | |
'watch' | |
] ); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment