Created
March 25, 2014 19:41
-
-
Save notpushkin/9769665 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'; | |
// Project configuration | |
grunt.initConfig({ | |
rasterize: { | |
front: { | |
vector: 'src/front.svg', | |
raster: [{ path: 'preview/front.png' }] | |
}, | |
inside: { | |
vector: 'src/inside.svg', | |
raster: [{ path: 'preview/inside.png' }] | |
}, | |
}, | |
exec: { | |
preview_clean: 'rm -rf preview/; mkdir preview', | |
dist_clean: 'rm -rf dist/; mkdir dist', | |
dist_front: 'inkscape -f=src/front.svg --export-pdf=dist/front.pdf', | |
dist_inside: 'inkscape -f=src/inside.svg --export-pdf=dist/inside.pdf' | |
}, | |
mkdir: { | |
preview: { create: ['preview'] }, | |
dist: { create: ['dist'] } | |
} | |
}); | |
// These plugins provide necessary tasks | |
grunt.loadNpmTasks('grunt-rasterize'); | |
grunt.loadNpmTasks('grunt-exec'); | |
// Default task | |
grunt.registerTask('preview', ['exec:preview_clean', 'rasterize:front', 'rasterize:inside']); | |
grunt.registerTask('dist', ['exec:dist_clean', 'exec:dist_front', 'exec:dist_inside']); | |
grunt.registerTask('default', ['preview']); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment