-
Notifications
You must be signed in to change notification settings - Fork 158
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enable building with webpack #209
Conversation
When building with WebPack, `require('x') returns the module, not the default export, so this just peels off the default export from the module, if it's present.
2acdea4
to
9ffecb8
Compare
@cowboyd I used this commit in an angular-cli project. The problem is that the self executing is somehow executed twice. In the first call the RouteRecognizer or FakeXMLHttpRequest do not even resolve (i.e. they are undefined) leading to another error about |
@ohcibi I assume it doesn't work without this commit either? Can you get it working by checking if |
@cowboyd yep, thats exactly the quickfix I have added. You can see the debugger hitting that line twice but at the second time I have added that into my real world project to see if it works there that way. The interesting part is that I did not had any error like that there. I was doing it very late yesterday, so I need to investigate a bit more what was happening there (cant do it right now). But I have a clue: In the test project I messed around with the |
Yep. Nevermind. The fix works as intended and I was misusing angular-cli. |
@trek @stefanpenner Any thoughts on what it will take for this to be kosher to merge? We've been using this patch for over a month without problems, but that's just one data point. I'm not sure if there's a good way to test this, short of setting up a webpack build for it. Also, it looks like this isn't the only effort to make module lookup work in different environments, so piling on another hack might not be the right answer. Then again... |
Made redundant by #216 🎉 |
When building with WebPack,
require('x')
returns the module, not the default export, so this just peels off the default export from the module, if it's present.fixes #207