DEV Community

Discussion on: Building a blog with Svelte: Code splitting

Collapse
 
chrsjxn profile image
Chris Jackson • Edited

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.