injectjscss-template-html-webpack-plugin替换html-webpack-plugin插入方式

如果你在项目中用过html-webpack-plugin,那么你也发现它在插入jscss文件的 url 时,不够灵活。这时候,injectjscss-template-html-webpack-plugin就派上用场了。它可以帮你替换掉原本的插入方式,更加方便自定义。是在webpack 1.x版本中,这个插件挺有用的,可以让你通过一些配置来控制每个文件的注入方式。安装也简单,使用npm install injectjscss-template-html-webpack-plugin或者yarn add injectjscss-template-html-webpack-plugin就能搞定,在 webpack 配置里引入插件就行了。实际开发中,injectjscss-template-html-webpack-plugin能大大提升你对资源注入的控制力,是在需要精确控制文件路径或注入顺序时,表现更为出色。

zip 文件大小:2.32KB