webpack-external-vendor-plugin
v1.2.0
Published
useful for some libiaries which are included globally
Downloads
56
Maintainers
Readme
webpack-external-vendor-plugin
can captiable with html-webpack-plugin@4
for webpack 4.0 useful for some libiaries which are included globally,it will inject global variables in webpack,then all deps can use external modules
Usage
const ExternalVendorPlugin = require('webpack-external-vendor-plugin')
// webpack.config.js
{
// use webpack.externals options
externals:{
'vue':'window.Vue',
'jquery':'window.jQuery',
'babel-polyfill': 'window._babelPolyfill'
},
plugins: [
new ExternalVendorPlugin({
filename: 'static/[name].js?[hash:7]', // default [name].js
// notice all js files you need include the browser version
entry: {
base_vendors: [
'jquery/dist/jquery.min',
'vue/dist/vue.js',
'babel-polyfill/dist/polyfill.min.js'
],
base_style:[
]
}
})
]
//...
}
options.externals see webpack.externals