autocdn-webpack-plugin

0.0.1 • Public • Published
Logo

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
}

Readme

Keywords

none

Package Sidebar

Install

npm i autocdn-webpack-plugin

Weekly Downloads

2

Version

0.0.1

License

GPL-3.0

Unpacked Size

46.6 kB

Total Files

7

Last publish

Collaborators

  • rabbitcc