Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Branch: master
Fetching contributors…

Cannot retrieve contributors at this time

84 lines (59 sloc) 1.776 kB

grunt-zopfli-native

Compress your files with zopfli without installing anything.

Build Status Dependency Status

Installing

npm install grunt-zopfli-native --save-dev

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

grunt.loadNpmTasks('grunt-zopfli-native');

Using

Task targets, files and options may be specified according to the grunt Configuring tasks guide.

Options

mode String

Choose an output format, you can choose between gzip, zlib or deflate. Defaults to gzip.

 zopfli({ format: 'zlib' })

extension String

Forces an extension to your files. Defaults depends on the mode chosen.

 zopfli({ format: 'zlib' })

zopfliOptions Object

Options object to pass through to node-zopfli. See node-zopfli documentation for more information.

{
    verbose: false,
    verbose_more: false,
    numiterations: 15,
    blocksplitting: true,
    blocksplittinglast: false,
    blocksplittingmax: 15
};

Examples

Make a gzip file

zopfli: {
  main: {
    files: [
      {src: ['path/*'], dest: 'gzipped_files/', filter: 'isFile'}
    ]
  }
}

Compress your files for production

zopfli: {
  main: {
    expand: true,
    cwd: 'assets/',
    src: ['**/*'],
    dest: 'public/'
  }
}
Jump to Line
Something went wrong with that request. Please try again.