Ecosyste.ms: Awesome

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

Awesome Lists | Featured Topics | Projects

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: about 1 month ago
JSON representation

Add the ability to include file content directly

Awesome Lists containing this project

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])
```