Closed rafakato closed 8 years ago
What's the motivation here?
When I write a plugin inside the project using ES2015 module pattern, glue gives an error when I try to register it, because when transpiled, the ES2015 module export default
became a property default
when required using require
.
So this check is to avoid this kind of problem
It is a rather trivial change, but given the sentiment elsewhere in the hapi core to not add shims like this, I'm hesitant. Can you raise this question in hapijs/discuss and reference this issue?
Oh, I didn't knew about this statement in hapi core. I'll open an issue there to discuss this. Thanks!
Did you open a discussion elsewhere?
This thread has been automatically locked due to inactivity. Please open a new issue for related bugs or questions following the new issue template instructions.
When Babel transpile
export default
it adds a__esModule
property to the module when requiring it in the code. So this change is to check this property and then loads the register fromdefault
property created by Babel