Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ant-tool/html-repath-webpack-plugin
manage html output path by this plugin
https://github.com/ant-tool/html-repath-webpack-plugin
Last synced: 3 months ago
JSON representation
manage html output path by this plugin
- Host: GitHub
- URL: https://github.com/ant-tool/html-repath-webpack-plugin
- Owner: ant-tool
- Created: 2016-04-11T04:17:35.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2017-01-12T08:56:53.000Z (about 8 years ago)
- Last Synced: 2024-08-08T15:44:11.582Z (6 months ago)
- Language: JavaScript
- Size: 14.6 KB
- Stars: 5
- Watchers: 9
- Forks: 1
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- Changelog: HISTORY.md
Awesome Lists containing this project
README
# html-repath-webpack-plugin
[![NPM version](https://img.shields.io/npm/v/html-repath-webpack-plugin.svg?style=flat)](https://npmjs.org/package/html-repath-webpack-plugin)
[![Build Status](https://img.shields.io/travis/ant-tool/html-repath-webpack-plugin.svg?style=flat)](https://travis-ci.org/ant-tool/html-repath-webpack-plugin)
[![Coverage Status](https://img.shields.io/coveralls/ant-tool/html-repath-webpack-plugin.svg?style=flat)](https://coveralls.io/r/ant-tool/html-repath-webpack-plugin)
[![NPM downloads](http://img.shields.io/npm/dm/html-repath-webpack-plugin.svg?style=flat)](https://npmjs.org/package/html-repath-webpack-plugin)
[![Dependency Status](https://david-dm.org/ant-tool/html-repath-webpack-plugin.svg)](https://david-dm.org/ant-tool/html-repath-webpack-plugin)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
```bash
$ npm i --save html-repath-webpack-plugin
```## Usage
Add new plugin instance to your `webpack` config
```javascript
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