1.0.9 • Published 3 years ago

cdn-error-fallback-webpack-plugin v1.0.9

Weekly downloads
-
License
ISC
Repository
github
Last release
3 years ago

cdn-error-fallback-webpack-plugin

cdn resource loading failure solution

CDN资源加载失败解决方案

Install

npm i cdn-error-fallback-webpack-plugin -D

Usage

example

demo:

const { CdnErrorFallbackWebpackPlugin } = require('cdn-error-fallback-webpack-plugin')

module.exports = {
  plugins: [
    new CdnErrorFallbackWebpackPlugin({
      inject: 'head',
      resources: [
        ['https://cdnjs.cloudflare.com/ajax/libs/animate.css/4.1.1/animate.min222.css', 'https://cdnjs.cloudflare.com/ajax/libs/animate.css/4.1.1/animate.min.css'],
        ['https://cdnjs.cloudflare.com/ajax/libs/vue/2.6.11/vue2.js', 'https://cdnjs.cloudflare.com/ajax/libs/vue/2.6.11/vue.js'],
        ['https://cdnjs.cloudflare.com/ajax/libs/vuex/2.5.0/vuex.js', "https://cdnjs.cloudflare.com/ajax/libs/vuex/2.5.0/vuex.js"],
        ['https://cdnjs.cloudflare.com/ajax/libs/vue-router/3.0.7/vue-router.js', "https://cdnjs.cloudflare.com/ajax/libs/vue-router/3.0.7/vue-router.js"]
      ]
    })
  ]
}

option

inject

default = 'head'

The location in the HTML file where the CDN resource is inserted

resources

default = []

CDN resource two-dimensional array, in accordance with the array order into the HTML file, when the resource loading failure will try the next index of the resource

1.0.9

3 years ago

1.0.8

3 years ago

1.0.7

3 years ago

1.0.6

3 years ago

1.0.5

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago