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: about 1 month ago
JSON representation
Add the ability to include file content directly
- Host: GitHub
- URL: https://github.com/fancyboynet/html-webpack-include-file-plugin
- Owner: fancyboynet
- Created: 2018-05-09T01:55:06.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2018-05-09T02:03:29.000Z (over 6 years ago)
- Last Synced: 2024-09-28T23:04:29.443Z (2 months ago)
- Language: JavaScript
- Size: 1000 Bytes
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- awesome-github-star - html-webpack-include-file-plugin
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])
```