NeXTSTEP Programming Mastermind
Share your code. npm Orgs help your team discover, share, and reuse code. Create a free org »

webpack-provide-global-plugin

0.0.1 • Public • Published

Provides installed packages as globals for webpack

Helper plugin that uses the webpack ProvidePlugin with the help of the (imports-loader)[https://github.com/webpack-contrib/imports-loader] and the (exports-loader)[https://github.com/webpack-contrib/exports-loader].

Installation

You must be running webpack on node 0.12.x or higher

Install the plugin with npm:

$ npm install --save-dev webpack-provide-global-plugin

Example

Setting up fetch and Promise globals:

plugins: [
    new WebpackProvideGlobalPlugin({
        "es6-promise": "Promise",
        "whatwg-fetch": "fetch"
    })
]

This is is identical to writing:

plugins: [
    new webpack.ProvidePlugin({
        "Promise": "imports-loader?this=>global!exports-loader?global.Promise!es6-promise",
        "fetch": "imports-loader?this=>global!exports-loader?global.fetch!whatwg-fetch"
    })
]

install

npm i webpack-provide-global-plugin

Downloadsweekly downloads

291

version

0.0.1

license

MIT

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability