-
Notifications
You must be signed in to change notification settings - Fork 36
Open
Description
postal.xframe (bower) won't work OOTB with webpack.
Seems that the order of AMD vs CommonJS check in this environment must be CommonJS first like in postal.federation.
(function( root, factory ) {
if ( typeof module === "object" && module.exports ) {
// Node, or CommonJS-Like environments
module.exports = function( postalFed ) {
return factory( require( "lodash" ), postalFed );
};
} else if ( typeof define === "function" && define.amd ) {
// AMD. Register as an anonymous module.
define( [ "lodash", "postal.federation" ], function( _, postal ) {
return factory( _, postal, root );
} );
} else {
// Browser globals
root.postal = factory( root._, root.postal, root );
}
}( this, function( _, postal, global, undefined ) {
//import("xframe.js");
return postal;
} ));While this violates the consense made in http://ifandelse.com/its-not-hard-making-your-library-support-amd-and-commonjs/#update2 reversing the order solves the issue for webpack.
Metadata
Metadata
Assignees
Labels
No labels