How to export a default export from a module

Building my first module is proving challenging—I’m having trouble importing it into my project. Are default exports not supported? Instead of the expected default export, importing the module yields an object with a default property.

1 Like

We recommend that you use only named exports from a module, like:

// in the module
export {myFunction}

// in the project
import {myFunction} from 'my-module'

Something to keep in mind that is that there is automatic behavior to also export the module config API, so that developers can write:

import MyModule from 'my-module'

MyModule.config.update({configValue: true})

MyModule.myFunction()