0.2.2 • Published 8 years ago

html-repath-webpack-plugin v0.2.2

Weekly downloads
1
License
MIT
Repository
github
Last release
8 years ago

html-repath-webpack-plugin

NPM version Build Status Coverage Status NPM downloads Dependency Status

Webpack plugin for generating html file with specified path, meanwhile fix assets path in html by configuration.

Features

Generates html files with specified path

Installation

$ npm i --save html-repath-webpack-plugin

Usage

Add new plugin instance to your webpack config

  import HtmlRepathPlugin from 'html-repath-webpack-plugin';

  const compiler = webpack({
    // ...
    plugins: [
      new HtmlRepathPlugin({
        regx: new RegExp(/(.+)\.html$/),
        replace: function (i, match) {
          return i.replace(match, '../../' + match)
        },
        ignore: ['dist/**/*.html','coverage/**/*.html'],
        xFixAssets: false,
        hash: true,
        forceRelative: true
      })
    ]
  });

Configuration

The plugin accepts the following options:

  • cwd: cwd
  • regx: must be instance of RegExp
  • replace: must be a function return new path of html
  • ignore: pass through to glob
  • xFixAssets: do not fix assets paths in html but fix hash
  • hash: fix assets with hash paths in html
  • forceRelative: absolute path in html would regard as relative, USED FOR publicPath

License

MIT

0.2.2

8 years ago

0.2.1

8 years ago

0.2.0

8 years ago

0.1.1

8 years ago

0.1.0

8 years ago