Closed JL102 closed 2 months ago
I'm not sure, that does seem odd, Im wondering if this a svelte/vite bug rather than issue with my adapter. When i bundel, it's just to combine the server code with the server.js that svelte produces
Are you able to replicate this issue with the node adapter
Hard to tell for certain.
I switched to @sveltejs/adapter-node and did some ctrl+F across build/client
and build/server
.
This first screenshot includes a search through build/client, and I believe this file that's open in the editor includes all the html5-qrcode
source code bundled into a single file.
This second screenshot includes a search through build/server, and I believe this may be the same code as I noted in the original post (including the line import_html5_qrcode = __toESM(require_cjs(), 1);
).
That would be it, the only difference is, when my adapter bundles the code it minifies it
Hi,
I noticed that in my app, which loads the library
html5-qrcode
in a CSR-only page,html5-qrcode
is included in the bundle.Steps to reproduce:
npm create svelte@latest my-app
my-app
....npm install
npm install html5-qrcode @yarbsemaj/adapter-lambda
src/routes/qrcode/+page.server.ts
:src/routes/qrcode/page.svelte
with a minimum reproducible example of my qrcode page:in which
require_cjs
is the entry point for html5-qrcode. Any idea whyqrcode/_page.svelte.js
is being loaded despite ssr being off for that page? It'd be nice to keep the bundle size down by not including libraries that are only loaded on CSR-only pages.