Null Pointer Mayhem

    grunt-phantom-rasterize

    2.1.0 • Public • Published

    grunt-phantom-rasterize Built with Grunt

    npm version Build Status dependencies devDependency Status

    Installation

    If you haven't used [grunt][] before, be sure to check out the [Getting Started][] guide, as it explains how to create a [gruntfile][Getting Started] 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-phantom-rasterize

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

    grunt.loadNpmTasks('grunt-phantom-rasterize');

    Documentation

    See the Gruntfile in this repo for a full example.

    Example Generating Icons for an iOS Application

    grunt.initConfig({
     
      rasterize : {
        ios : {
          options: {
            sizes : [
              { width : 29, name : 'Icon-Small.png' },
              { width : 40, name : 'Icon-Small-40.png' },
              { width : 58, name : 'Icon-Small@2x.png' },
              { width : 76, name : 'Icon-76.png' },
              { width : 80, name : 'Icon-Small-40@2x.png' },
              { width : 87, name : 'Icon-Small@3x.png' },
              { width : 120, name : 'Icon-Small-40@3x.png' },
              { width : 120, name : 'Icon-60@2x.png' },
              { width : 152, name : 'Icon-76@2x.png' },
              { width : 180, name : 'Icon-60@3x.png' },
              { width : 512, name : 'iTunes@512.png' },
              { width : 1024, name : 'iTunes@1024.png' }
            ]
          },
          files: [
            {
              expand: true,
              cwd: 'graphics/icons',
              src: ['ios.svg'],
              dest : 'ios-prod/'
            },
            {
              expand: true,
              cwd: 'graphics/icons',
              src : ['ios-dev.svg'],
              dest : 'ios-dev/'
            }
          ]
        }
      }
     
    });
     
    grunt.loadNpmTasks("grunt-phantom-rasterize");

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

    License

    unlicence

    Install

    npm i grunt-phantom-rasterize

    DownloadsWeekly Downloads

    1

    Version

    2.1.0

    License

    unlicence

    Last publish

    Collaborators

    • runspired