hello i m using SvelteKit with
hello, i'm using SvelteKit with Cloudflare Pages, but it's in a monorepo with other libs that I added to the project with deps
file:../other-dir
; however, if it works locally, it doesn't work with Cloudflare Pages' automatic deployment - I get errors such as: Error: [vite]: Rollup failed to resolve import "other-dir" from "src/modules/types.ts".
, and if I use Rollup's externals, I get .svelte-kit/output/server/chunks/styles.js:2:7: ERROR: Could not resolve "other-dir"
.
I tried to do a manual deployment, and it works just fine.
Any idea of what I can try to make this auto deployment work?1 Reply
well I see that the issue comes from Cloudflare's CI stuff that discard everything else but the "root dir" ; if you too don't have time for more JavaScript/CI bollocks -> workaround is to use hard copy of the packages in the root dir in your CI/predeployment, then use the plugin
@rollup/plugin-alias
to alias the imports in your code with the option build.rollupOptions.plugins
in Vite config file.