icalvin102
icalvin102

Reputation: 157

How to build single (non ESM) bundle.js file in sveltekit SPA-Mode?

I am currently building a WebApp (SPA) with svelte and would like to migrate to sveltekit because of the builtin router. The serverside functions of sveltekit are not needed as all content is dynamically loaded from a REST API and SEO is not really a concern.

With the adapter-static in SPA-Mode the app works as expected however the built app relies on ESM import syntax. Sadly one of the project requirements is that it has to support some browsers that do not support import syntax.

Is there a way to build sveltekit apps like svelte with rollup.js does it? Meaning a single bundle.js file in iife format.

Upvotes: 2

Views: 2100

Answers (1)

Saikat Das
Saikat Das

Reputation: 368

There isn't a solution currently. But there is an open issue for it here

https://github.com/sveltejs/kit/issues/12

Upvotes: 1

Related Questions