I need to create features or modules that consists of multiple meteor smart packages and share the same namespace. The problem is that, if i api.export the namespace in all package.js files then the linker creates a result like that:
/* Imports */
var Meteor = Package.meteor.Meteor;
var MyModule = Package['mymodule-base'].MyModule;
/* Package-scope variables */
var MyModule;
So it overwrites the MyModule variable which makes the old scope not usable in other module packages. If i export the variable only in one package then its fine but as soon as i try to include assignment of that variable to code like:
(function (MyModule) {
MyModule.SomeFeature = ...
})(MyModule || (MyModule = {}));
then again the same problem comes up, the linker declares the variable twice, rendering the imported variable useless.
Any reason why this could be intentional or is it a bug? Or how should i solve this situation.
For now i have modified the meteor code to not declare package-scope variable, if it is already declared as imported variables.