Hanging Gardens — CommonJS for Sprockets

Usage

in your Gemfile:

gem 'hanging_gardens'

after setting up your Sprockets environment:

HangingGardens.register(env)

add your first CommonJS file 'app/assets/index.common':

var window = require('browser/window');
console.log(window);