Skip to content

Instantly share code, notes, and snippets.

@notpushkin
Created March 25, 2014 19:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save notpushkin/9769665 to your computer and use it in GitHub Desktop.
Save notpushkin/9769665 to your computer and use it in GitHub Desktop.
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