DEV Community

Discussion on: Building a blog with Svelte: Code splitting

sharakpl profile image

How do you handle unsupported browsers? There should be a notice for the user to switch to modern browser. Preferably this should load for every browser outside the range set by browserslist in package.json.

chrsjxn profile image
Chris Jackson Author • Edited on

Hey, that's a really good question!

I haven't tried it yet, since this is just a learning project for me. But I think that adding a babel step to the rollup build could transpile and shim the project into more compatible JS.

And you'd need to use non-native modules. Rollup should support code splitting with system.js modules and AMD.

Swapping to server rendering with sapper might also solve this, with some app refactoring. And at that point you could consider skipping the complexity of code splitting.