maccman/hem — Issue #19: underscore and backbone dependencies break hem
Author: jonashuckestein
Created: 2011-11-25 21:08:19+00:00
State: open

I'm currently setting up my project and have

dependencies: ["underscore", "backbone"]

in my slug.json. The files get included all right, but are accessible using require("underscore/underscore") and require("backbone/backbone") only. I'm assuming this is some issue with resolving the index file of those packages, but I couldn't figure it out. The package.json files have the necessary "main" properties.

Perhaps you can quickly give it a try. I noticed that dependencies that work (like "json2ify") have main files that are called "index.js", so perhaps that's the problem.

Anyway, for anyone else trying to load underscore and backbone as dependencies: create wrapper modules that require and export the full path until this is fixed. Here's my app/underscore.coffee:

module.exports = require "underscore/underscore"