When exporting functions in the following files, we recommend you use the standard export syntax contained in the documentation's code examples:
You can also use other export formats that are part of the ES6 (ES2015) module export syntax. However, the following export formats are not supported in events.js
, data.js
, routers.js
, or service plugin code files:
Re-exporting a function: Directly re-exporting a function imported from an npm or Velo package. For example, this doesn't work:
The following alternative syntax is supported:
Dynamic exports: Exports including a dynamic operation or expression that requires execution to resolve. For example, this doesn't work:
The following alternative syntax is supported:
Exports wrapped in objects: Exports where functions are defined as properties of an object. For example, this doesn't work:
The following alternative syntax is supported:
CommonJS exports: Exports in the CommonJS (CJS) format that preceded ES6 (ES2015). For example, this doesn't work:
Functions exported using a syntax that isn't supported aren't called by the triggering event.