html-webpack-include-file-plugin

0.0.1 • Public • Published

html-webpack-include-file-plugin

html-webpack-plugin基础上增加引入文件内容功能,类似fis<link rel="import">

install

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

config

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

include js

<link rel="include" href="node_modules/some.js">

output with script tag wrap

<script>//js content</script> 

include css

<link rel="include" href="node_modules/some.css">

output with style tag wrap

<style>//css content</style>

include others

<link rel="include" href="node_modules/some.html">

output without any tag

<div></div>

important

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

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

Readme

Keywords

Package Sidebar

Install

npm i html-webpack-include-file-plugin

Weekly Downloads

1

Version

0.0.1

License

ISC

Unpacked Size

2.96 kB

Total Files

3

Last publish

Collaborators

  • fancy