Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build single (non ESM) bundle.js file in SPA-Mode #1682

Closed
icalvin102 opened this issue Jun 13, 2021 · 1 comment
Closed

Build single (non ESM) bundle.js file in SPA-Mode #1682

icalvin102 opened this issue Jun 13, 2021 · 1 comment

Comments

@icalvin102
Copy link
Contributor

I am currently building a 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.

The adapter-static in SPA-Mode seems to be a good fit for hat and the app works as expected (in modern browsers). Sadly one of the project requirements is that it has to support some browsers that do not support import syntax.

Describe the solution you'd like
A build option in adapter-static that behaves similar to format: 'iife' in svelte with rollup.js that creates a single bundle.js file that is not dependant on ESM.

Describe alternatives you've considered
I tried @vitejs/plugin-legacy but I could not get it to work.

How important is this feature to you?
Very important. The ability to build a legacy (non ESM) bundle determines if I use sveltekit or not.

@Conduitry
Copy link
Member

Conduitry commented Jun 13, 2021

There's already #12 for differential legacy builds. Whether or not this ends up being handled by outputting a single .js file seems like an implementation detail to me, so I'm closing this in favor of that issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants