2.0.1 • Published 9 years ago

grunt-phantom-svg2png v2.0.1

Weekly downloads
3
License
unlicence
Repository
github
Last release
9 years ago

grunt-svg2png Built with Grunt

Generate PNG from SVG using svg2png

Getting Started

If you haven't used grunt before, be sure to check out the Getting Started guide, as it explains how to create a gruntfile as well as install and use grunt plugins. Once you're familiar with that process, install this plugin with this command:

npm install --save-dev grunt-svg2png

Once the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:

grunt.loadNpmTasks('grunt-svg2png');

Tip: the load-grunt-tasks module makes it easier to load multiple grunt tasks.

Documentation

See the Gruntfile in this repo for a full example.

Example config

grunt.initConfig({
  svg2png: {
    fallback: {
      options: {
        subdir: "png"
      },
      files: [{
        expand: true,
        cwd: "test/svg",
        src: ["**/*.svg"]
      }]
    },
    ios: {
      options: {
        sizes: [{ width : 60, name : 'icon.png' }, { width: 120, name : 'icon@2x.png' }], //specify multiple for each file to generate various sizes at once
        subdir: "ios",
      },
      files: [{
        expand: true,
        cwd: "test/svg",
        src: ["**/*.svg"]
      }]
    }
  }
});

grunt.loadNpmTasks("grunt-svg2png");
grunt.registerTask("default", ["svg2png"]);

Tip: the grunt-newer module might come in handy if you have a large number of files.

License

unlicence

2.0.1

9 years ago

2.0.0

9 years ago

1.0.2

10 years ago

1.0.1

10 years ago

1.0.0

10 years ago

0.2.0

10 years ago