autocdn-webpack-plugin
v0.0.1
Published
```js const HtmlWebpackPlugin = require('html-webpack-plugin') const HtmlWebpackTemplate = require('html-webpack-template') const AutoCDNWebpackPlugin = require('@rabbitcc/autocdn-webpack-plugin')
Downloads
4
Readme
Usage
const HtmlWebpackPlugin = require('html-webpack-plugin')
const HtmlWebpackTemplate = require('html-webpack-template')
const AutoCDNWebpackPlugin = require('@rabbitcc/autocdn-webpack-plugin')
module.exports = {
//...webpack options...
plugins: [
new AutoCDNWebpackPlugin(),
new HtmlWebpackPlugin({
template: HtmlWebpackTemplate,
inject: false
})
]
}
Interface
type PackageName = string
type GlobalExportName = string
type CDN =
| { url: string | Array<string>, name: GlobalExportName }
| {
css: string | Array<string>,
js: string | Array<string>,
name: GlobalExportName
}
type Options = {
cdn: { // preset cdn by yourself
[name: PackageName]: CDN
},
exclude: string | Array<string>, // exclude some package
include: string | Array<string>, // include some package
report: boolean // report result on before inject plugin
}