webpack-html-embed-source-plugin
webpack插件,用于将指定的css、js资源内联到入口html文件中.
使用
npm i -D webpack-html-embed-source-plugin
添加至 webpack.config.js
:
const WebpackHtmlEmbedSourcePlugin = ; webpackConfigplugins = prepend: Path Path append: Path Path tests: /index.*.css/ /runtime.*.js/ ;
输出
参数
new WebpackHtmlEmbedSourcePlugin({ prepend, append, tests })
prepend
Type: Array<string>
追加指定的外部资源,将会内联到固定资源的前部.
append
Type: Array<string>
追加指定的外部资源,将会内联到固定资源的尾部.
tests
Type: Array<RegExp>