-
Notifications
You must be signed in to change notification settings - Fork 671
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
Wrap shim code if have AMD dependencies #197
Comments
+1 on this currently, I have backbone-amd and backbone-relational non-amd used together with
this works fine when developing, but fails when trying to build it is there any workaround until this becomes a feature? thanks for your great effort! |
If you include backbone in the build then it should work. The more I think about it, the more I do not want to try to add a wrapper -- it affects the scope around the wrapped library, and it would actually break some libraries that just define their globals via So, I'm going to close this ticket for now, as it will just create other problems. The current guidance is to always build in the dependencies of shimmed scripts into the build layer that contains the shimmed script. |
probably, I'm not aware of how to include backbone properly in the build, as I've tried to do that my built script concatenated the js libs in the following order (taken from the js comments in the final file)
Thus backbone is supposed to be present by the time the
get's called I'm using this version of backbone: https://github.com/amdjs/backbone I know that this is not related to the original issue any more, and I totally understand your reason behind closing the original ticket |
It looks like jquery is not in the built file, that will need to be in there too. And it may also work better to use the regular backbone.js file instead of the amdjs version. |
If a shim module has a dependency on a module that is AMD with dependencies, consider wrapping the shim lib in a define. Watch out for scope problems. Maybe warn on any auto wrap done.
The text was updated successfully, but these errors were encountered: