Skip to content

FlynnLeeGit/webpack-external-vendor-plugin

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

useful for some libiaries which are included globally

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published