Hi everyone. I'm super hyped to give Payload a try!
I would however love to integrate it with my Clojurscript web server, which runs on Node.js and has it's own configuration mechanism. One solution would be to read some configuration (for the DB) from a file. I have tried requiring Node's fs module in the payload.config.js:
const fs = require('fs');
This makes webpack frontend build fail, which obviously can't access the node module:
Module not found: Error: Can't resolve 'fs' in '…/df-macchiato/server'
The config I want to read is purely for the server. Is there a way tu suppress the require for the frontend build?
If this is not the case, it would also be possible (even better!) if I had a way to pass the server config during the call to payload.init{config: …}). My attempts at this, however, ran into the converse problem: I cannot require the slate Editor inside Node.js because it requires SCSS, which is only possible in webpack:
…/node_modules/payload/dist/admin/components/elements/Banner/index.scss:1
@import '../../../scss/styles.scss';
I'm a bit lost at this point and would appreciate any directions you can give me.