1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34
|
# Sprockets Export
A [Sprockets directive](https://github.com/rails/sprockets#sprockets-directives) for hassle-free [UMD](https://github.com/umdjs/umd)-style JavaScript module definitions.
## Using
``` ruby
# Gemfile
gem 'sprockets', '>= 3.0.0'
gem 'sprockets-export'
```
```js
/* widget.js */
//= export Widget
//= require_self
this.Widget = { name: "gizmo" }
```
## Consuming
```js
widget = require("widget")
widget.name // gizmo
```
---
Licensed under the [MIT License](LICENSE.txt)
© 2016 Javan Makhmali
|