Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

babel-plugin-globals

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

babel-plugin-globals - npm Package Compare versions

Comparing version 1.0.0 to 1.0.1

2

package.json
{
"name": "babel-plugin-globals",
"version": "1.0.0",
"version": "1.0.1",
"description": "A babel plugin that exposes ES6 modules to global variables.",

@@ -5,0 +5,0 @@ "license": "MIT",

@@ -10,7 +10,10 @@ babel-plugin-globals

```javascript
babel.transform('code', {
_globalName: 'myGlobal',
filename: filename,
plugins: ['globals']
});
{
"plugins": [
["globals", {
"globalName": 'myGlobal'
}]
],
"filename": filename
}
// Modules will be available at this.myGlobal.

@@ -20,5 +23,8 @@ ```

## API
This plugin requires passing two options to the babel config object (besides adding the plugin). They are:
This plugin requires passing the following plugin/babel options (besides adding the plugin):
- `_globalName` **{string}** The name of the global variable that the modules should be exported to.
- `filename` **{string}** This is an optional existing babel option, but is required for this plugin, since it uses the file name to decide the name of the keys that will be exported in the global variable.
### Plugin options
- `globalName` **{string}** The name of the global variable that the modules should be exported to.
### Babel options
- `filename` **{string}** This is an optional existing babel option, but is required for this plugin, since the plugin uses the file name to decide the name of the keys that will be exported in the global variable.
SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc