I have some global classes(JS classes with prototype syntax) that need to be manually added to registry with System.set(moduleName, Module). Since second parameter is of type Module, I need to use System.newModule(object).
But, if I pass a non-object to System.newModule(), it throws - Uncaught TypeError: Expected object.
Am I doing this wrong? Is there another way to do this?
System.set(System.normalizeSync('./something'), System.newModule({
__useDefault: function() {
console.log('do stuff');
}
}));
Basically all you need to do is to have your function/non-object defined in defalut key and use option: __useDefault: true
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With