Post

Is there a way to ensure certain files that aren't in the app tree make it into the @svelte.dev Kit build output? I have a background process that pulls a file from a relative import. Works fine in dev. Can't find the file in prod :/

0 reposts2 likes

Could try a cp this/file.js build/file.js in the build script or have it in the static/ folder Or If you’re running crons on a node server have an ingest API endpoint and run the crons against it?

I like the first idea. I came across the second idea on a forum, and it was interesting. Sounds like a fun one, but I don't want to expose an endpoint that can trigger the script. Thanks for the tips.

Sure. Im deploying to a node server because I need background tasks to run. Using node-cron to run these, and there's a feature where tasks can run as background processes if you provide a file path. As such, node-cron tries to import that file, but it doesn't exist in the build output

Oh that's clever. I was thinking something along these lines, but didn't know this existed. Thank you, I'll give it a try