babel-plugin-globals
Advanced tools
Comparing version 1.0.0 to 1.0.1
{ | ||
"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. |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
9812
29