Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
RequireJS with non-AMD modules
// 1. Add definition to foot of module.js (the required file)
// AMD Define
return baron;
// 2. Add the path to main.js (requireJS config) as normal
baseUrl: "/sites/all/themes/base/js/",
paths: {
"underscore": "../vendor/underscore-min",
"baron": "../vendor/baron"
shim: {
underscore: {
exports: "_"
// 3. Require the file in app.js
define(["underscore", "../vendor/baron"], function(_, Baron) {
// use non-AMD module here
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment