graphql-nexus/nexus-prisma

ESM not compatible?

yovanoc opened this issue · 10 comments

Screenshot

image

Description

I build my ts files with esbuild src/**/*.ts --platform=node --minify --target=esnext --format=esm --outdir=dist

and here's my yarn test command: cross-env NODE_ENV=${NODE_ENV:-development} DOTENV_FLOW_PATH=../.. node -r dotenv-flow/config ./dist/index.js

We should aim to add official ESM support upon the release of TypeScript 4.7.

Some work has been done to provide incremental ESM support using libraries like typescript-esm but there have been test regressions as a result. Once official ESM support lands in TypeScript we'll look to implement a solution accordingly.

Ok, you will aim to be ready for the release (24 may) or begin to dev from the that date?

@yovanoc I believe we should add the official ESM support after it's released in TypeScript but can't provide a date by which it'll be merged. If you'd like to take a stab at implementing it based on the beta I think it'd spark great discussion!

Its now released (https://devblogs.microsoft.com/typescript/announcing-typescript-4-7/)

I can't do this in the next weeks so if someone want to tackle this

Any news on this? just came back this week ^^

NTag commented

I'm sad the commit has been reverted, it's annoying as it prevents to use vitest for example which is ESM-first.

Would be very appreciated that nexus-prisma supports ESM properly as the whole ecosystem is now moving to it 🙏