Sprockets Export

A Sprockets directive for hassle-free UMD-style JavaScript module definitions.

Using

# Gemfile

gem 'sprockets', '>= 3.0.0'
gem 'sprockets-export'
/* widget.js */

//= export Widget
//= require_self

this.Widget = { name: "gizmo" }

Consuming

widget = require("widget")
widget.name // gizmo

Licensed under the MIT License

© 2016 Javan Makhmali