0.0.7 • Published 4 years ago

handle-inject-html-webpack-plugin v0.0.7

Weekly downloads
1
License
ISC
Repository
-
Last release
4 years ago

作用

需要改变index.html中注入的js文件和css文件 例如在使用dll打包时,可以使用该plugin改变index.html中的注入

使用示例

const HandleInjectHtmlWebpackPlugin = require('handle-inject-html-webpack-plugin')

...
plugins: [
    new HandleInjectHtmlWebpackPlugin({
        js: 'your js file path'
    })
]
...

配置项

配置项类型
jsString/Array/Function/Object
cssString/Array/Function/Object

配置示例

  • String
new HandleInjectHtmlWebpackPlugin({
    js: 'your js file path'
})
  • Object
new HandleInjectHtmlWebpackPlugin({
    js: {
        path: 'your js file path',
        pos: 'pre' // pos属性为 pre 时,这个js文件会放在最前方注入,其他属性无效
    }
})
  • Object
new HandleInjectHtmlWebpackPlugin({
    js: [{
        path: 'your js file path',
        pos: 'pre' // pos属性为 pre 时,这个js文件会放在最前方注入,其他属性无效
    }, 'your js file path']
})
  • function
new HandleInjectHtmlWebpackPlugin({
    js: function (originalJsFileList) {
        return ... // 需要返回一个数组
    }
})
0.0.7

4 years ago

0.0.6

4 years ago

0.0.5

4 years ago

0.0.4

4 years ago

0.0.3

4 years ago

0.0.2

4 years ago

0.0.1

4 years ago