项目作者: aboutqx

项目描述 :
script-link-html-webpack-plugin
高级语言: JavaScript
项目地址: git://github.com/aboutqx/script-link-html-webpack-plugin.git
创建时间: 2018-04-24T01:40:24Z
项目社区:https://github.com/aboutqx/script-link-html-webpack-plugin

开源协议:MIT License

下载


script-link-html-webpack-plugin

add script prefix to js script src,use with html-webpack-plugin.

Installation

You must be running webpack on node 0.12.x or higher

Install the plugin with npm:

  1. $ npm i script-link-html-webpack-plugin -D

Basic Usage

in webpack production mode

  1. new ScriptLinkPlugin({
  2. preffix: 'htttp:xxx.com',
  3. suffix:'?v='+Date.now(),
  4. pattern:{
  5. regex:/assets/,
  6. replce:'myassets'
  7. },
  8. img:true
  9. })

src in html script tag like /assets/js/index.js will be http:xxx.com/myassets/js/index.js?v=1522223212.

support tag includes script,link as defalt ,img tag has to set img option to true.