Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

https://github.com/fancyboynet/html-webpack-include-file-plugin

Add the ability to include file content directly
https://github.com/fancyboynet/html-webpack-include-file-plugin

Last synced: 8 days ago
JSON representation

Add the ability to include file content directly

Lists

README

        

# html-webpack-include-file-plugin
在[html-webpack-plugin](https://github.com/jantimon/html-webpack-plugin)基础上增加引入文件内容功能,类似[fis](https://github.com/fex-team/fis3)的``

## install

```bash
$ npm i -D html-webpack-include-file-plugin
```

## config

```javascript
const HtmlWebpackIncludeFilePlugin = require('html-webpack-include-file-plugin')
plugins: [
new HtmlWebpackPlugin(),
new HtmlWebpackIncludeFilePlugin()
]
```

## include js
```html

```
output with `script` tag wrap
```html
//js content
```

## include css
```html

```
output with `style` tag wrap
```html
//css content
```

## include others
```html

```
output without any tag
```html


```

## important
Currently, the source path is relative to the `process.cwd()` only.

```javascript
let sourcePath = path.resolve(process.cwd(), inline[1])
```