How do I achieve the same functionality on the server side that the client/compatibility folder provides on the client side.
I have files with lots of old js functions that are defined as:
function functionName() {...}
I need to access these from my new server side Meteor code but because they are in different files and Meteor gives each file its own namspace they aren't in scope.
I could force each library function to be global by changing the declaration to:
functionName = function() {...}
but this is impractical as I don't own or maintain the js functions.
To prevent this wrapping on the client side you can place the js file in the folder client/compatibility. How do I prevent this wrapping server side? server/compatibility doesn't seem to work. Neither does creating a package and using api.export()
funcName = function() {...}syntax but I don't want to change the files if I can help it. - Unstableairapi.export()requires that the function is "declared without var" butfunction x(){}is just shorthand forvar x = function x (){}in JavaScript so it still doesn't work. This is the same issue I have with the unpackaged file. - Unstableair