0.0.2 • Published 5 years ago

html-external-webpack-plugin v0.0.2

Weekly downloads
2
License
MIT
Repository
github
Last release
5 years ago

html-external-webpack-plugin

add external js,css to html-webpack-plugin

Build Status Coverage Status npm version npm downloads npm license

Install

$ npm i html-external-webpack-plugin --save

API

const HtmlExternalWebpackPlugin = require('html-external-webpack-plugin')

// webpack.config.js
plugins: [
  new HtmlWebpackPlugin(),
  new HtmlExternalWebpackPlugin({
    HtmlWebpackPlugin,
    context: __dirname,

    css: [],
    js: [],
    jsCDN: '',
  }),
]

options

nametypedesc
options.HtmlWebpackPluginthe HtmlWebpackPlugin reference
options.contextStringthe context dir for resolve dep
options.css[]Stringextra css to add
options.js[]JsTypeextra js to add
options.jsCDNStringavailable unpkg / baidu / jsdelivr

JsType

supported JsType

typedescexample
String fullUrlthe js srchttps://cdn.jsdelivr.net/npm/axios@0.18.0/dist/axios.min.js
String urlthe js src/npm/axios@0.18.0/dist/axios.min.js
Sytring package-namethe package namevue
Object{name, version, path}{ name: 'lodash', version: '4.0.0',path: '/lodash.min.js'}

Changelog

CHANGELOG.md

License

the MIT License http://magicdawn.mit-license.org