gluejs icon indicating copy to clipboard operation
gluejs copied to clipboard

Including Backbone with a single copy of Underscore

Open moll opened this issue 12 years ago • 1 comments

Hey,

Trying out Gluejs in a real world context here, but having trouble understanding how it's supposed to be used.

Invoking it with, amongst other options, with:

        --basepath app/javascripts
        --include app/javascripts/node_modules/underscore/index.js
        --include app/javascripts/node_modules/backbone/index.js

Doing require("underscore") works from my own code, but when doing require("backbone"), it fails with Uncaught Error: failed to require "underscore" from index.js because of Backbone's attempt to load Underscore itself.

How should this be handled?

moll avatar Nov 22 '13 13:11 moll

This seems to come from the difference on how Node resolves dependencies (searching ancestor directories) and how Glue doesn't.

moll avatar Nov 25 '13 13:11 moll