1.0.7 • Published 8 years ago

packing-rev-webpack-plugin v1.0.7

Weekly downloads
3
License
ISC
Repository
github
Last release
8 years ago

Packing Rev Webpack Plugin

NPM

This is a webpack plugin that reversion files to the build directory.

Getting started

Install the plugin:

npm install --save-dev packing-rev-webpack-plugin

Usage

new RevWebpackPlugin([patterns], options)

new RevWebpackPlugin({ cwd: path.join(cwd, assets), src: '*/.{jpg,png}', dest: path.join(cwd, assetsDist), }),

A pattern looks like: { cwd: '', src: '**/*', dest: 'dest' }

Pattern properties:

  • src
    • is required
    • can be a glob
    • can be an Array
  • dest
    • is optional
    • if not absolute, it's relative to the build root
  • cwd
    • is optional
    • The base directory (absolute path!) for reversion
    • defaults to process.cwd()
  • glob
    • is optional
    • glob options

Available options:

  • format
    • is optional
    • reversion name format
    • default value is [name]-[hash][ext]
  • algorithm
    • is optional
    • default value is sha256
  • length
    • is optional
    • default value is 8

Examples

var RevWebpackPlugin = require('packing-rev-webpack-plugin');
var path = require('path');

module.exports = {
    plugins: [
        new RevWebpackPlugin([
            { src: 'from/file.txt', dest: 'dist' },

            // {output}/to/file.txt
            { cwd: 'assets', src: 'images/**/*', dest: 'imgs' }
        ]),
        new RevWebpackPlugin([
            { src: ['**/*.png', '!notrev.png'], dest: 'dist' },

            // {output}/to/file.txt
            { cwd: 'assets', src: 'images/**/*', dest: 'imgs' }
        ])
    ]
};
1.0.7

8 years ago

1.0.6

8 years ago

1.0.5

8 years ago

1.0.4

8 years ago

1.0.3

8 years ago

1.0.2

8 years ago

1.0.1

8 years ago

1.0.0

8 years ago