Back

Appwrite functions with ESM

  • 0
  • Functions
Etienne Moureton
5 Sep, 2023, 15:23

Hi,

In every examples, I see Functions use CJS, could I use ESM's imports ? (And would be cool to have TS starter too)

Thanks!

TL;DR
The user asks if they can use ESM's imports with Appwrite functions. They mention that currently, functions only support CJS. They also mention that in version 1.4, there should be a TypeScript starter available.
Drake
6 Sep, 2023, 18:06

i think functions only support CJS at the moment.

pre-1.4, you can write TS functions and then transpile before deploying so that the deployed code is javascript.

in 1.4, there should be a TS starter since you can execute custom commands (tsc) as part of the build

Etienne Moureton
7 Sep, 2023, 06:40

Okay thanks Steven! Was trying some workarounds but will wait for the custom commands πŸ™

Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more