Socket
Socket
Sign inDemoInstall

webpack-provide-global-plugin

Package Overview
Dependencies
279
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    webpack-provide-global-plugin

A webpack plugin to provide installed packages as named global variables


Version published
Weekly downloads
117
increased by14.71%
Maintainers
1
Install size
1.01 MB
Created
Weekly downloads
 

Readme

Source

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"
    })
]

Keywords

FAQs

Last updated on 17 Feb 2017

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc