File: README.md

package info (click to toggle)
ruby-sprockets-export 1.0.0-1.1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, forky, sid, trixie
  • size: 124 kB
  • sloc: ruby: 117; sh: 4; makefile: 3
file content (34 lines) | stat: -rw-r--r-- 521 bytes parent folder | download | duplicates (2)
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