Worker functions
I am building a Vue app using pages but need access to other services. In looking through the configuration, server/index.js is the entry point for worker code. Is there a way to configure multiple files for my worker configurations so I can have the service split out. As an example, have one file for KV and another for D1
I have tried deploying a functions folder but nothing in that directory seems to get compiled when running 'npm run build'
1 Reply
When running
npm run build
you are simply building your vue project, your worker will not be copied to the dist
directory - which will then be published via wrangler.
You could copy the worker in the dist directory and configure wrangler to deploy it, too - which is a lot of hacky work compared to switching to a proper solution.
I recommend you to look into e.g. nuxt, which is based on vue, has embedded server side rendering (good for seo) and full support for cloudflare pages