5 ms·
I bundled it with esbuild for an astro/payload monorepo setup and it worked fine.
by coxmi 3y ago
I bundled it with esbuild for an astro/payload monorepo setup and it worked fine.
- p2hari 3y agoNice, is it something you can share? If not could you briefly mention the steps. Even high level would be helpful
- coxmi 3y agoYep! There are probably issues with this setup, but I wrote a small plugin to allow them to work in the same repo, sharing the same express instance: https://github.com/coxmi/astro-payload-plugin https://github.com/coxmi/astro-payload-plugin Because of various ES module/CJS issues I had to bundle payload with esbuild and change the extension to cjs. The config wasn't being properly found/parsed by their webpack/ts-node setup, and because payload loads its own config in dev mode, it's all a bit complicated. This was the easiest fix I could find. My example repo can be found here: https://github.com/coxmi/astro-payload-example https://github.com/coxmi/astro-payload-example Which was sort-of based on Payload's own custom server example here: https://github.com/payloadcms/payload/tree/main/examples/custom-server https://github.com/payloadcms/payload/tree/main/examples/cus...