componentjs / builder2.js

builder for component
50 stars 20 forks source link

components without `main` don't work #41

Closed bmcmahen closed 10 years ago

bmcmahen commented 10 years ago

It looks like components without main in their component.json don't work. See for example, component/raf, which gives me the following error:

Uncaught Error: failed to require "component~raf@1.1.3"

jonathanong commented 10 years ago

i'm pretty sure it works because i'm using it right now.

can you give me a small test case?

bmcmahen commented 10 years ago

I think it has something to do with the bundler, actually. I'm going to try to figure out things today, and if I can't, a small test-case will come your way

bmcmahen commented 10 years ago

Yeah, so it turns out that raf is being included with boot.js (which is good), but even though the boot script is running, it's still not able to require it. hrm.

bmcmahen commented 10 years ago

Figured it out. I was including the require code multiple times for each bundle, which in turn was overwriting the require object of the previous bundle.