Enable transpilation of non-CJS packages #2277
willviles
started this conversation in
Feature Requests & Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
It'd be great if Payload exposed a simple way to transpile modules, similar to Next.js'
transpilePackages
array innext.config.js
.This would enable any non-compiled esm or ts package to be used by Payload.
Personally, this would be a massive win. It'd allow me to configure my Turborepo so there's no build step to compile all my esm/ts packages down to cjs and would speed my dev workflow up a huge amount!
I've hacked it around with a custom webpack config using
swc-loader
.This setup works fine when running the server, but when trying to generate types or the GraphQL schema, it fails because the CLI commands aren't bundled with Webpack.
Originally posted by @willviles in #2106 (comment)
Beta Was this translation helpful? Give feedback.
All reactions