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
Bug: UMD pattern treated like RequireJS even when not present #137
Comments
The build output also includes this: ... define("backbone.localStorage",["underscore","backbone"],function(e,t){ ... |
This file also gives similar trouble: https://github.com/passy/canjs-localstorage/blob/master/can.localstorage.js#L2-L9 |
This problem turns out to be a bit more severe than I thought. Not only is the whole UMD pattern replaced with a call to an undefined Before: (function (root, factory) {
if (typeof define === 'function' && define.amd) {
define(['backbone'], function (Backbone) {
return factory(Backbone || root.Backbone);
});
} else {
factory(Backbone);
}
}(this, function (Backbone) {
Backbone.LocalStorage = 'I am the local storage. Muha!';
return Backbone.LocalStorage;
})); After: define("backbone.localStorage", ["backbone"], function(Backbone) {
return factory(Backbone || root.Backbone);
}); I think we might need to drop our fanciness with trying to optimize away the UMD wrapper and just live with the overhead so the runtime can do it's thing. Obviously this thing also throws a |
I've added some changes to the My strategy is to add an Am I on the right track here? |
My method of using a getter that looked at the assets incoming relations turned out not to be working properly in cases where the asst would be cloned, like in the |
When running
buildProduction --root backbone --outroot backbone-dist backbone/index.html
in https://github.com/Munter/todomvc-challenge/tree/gh-pages/architecture-examples/backbone I get this log:Looks like Assetgraph is interpreting this section using the RequireJS branch even though requirejs isn't present: https://github.com/Munter/todomvc-challenge/blob/gh-pages/architecture-examples/backbone/bower_components/backbone.localStorage/backbone.localStorage.js#L7-L18
The text was updated successfully, but these errors were encountered: