I have an application build using Svelte (v3), Routify (v2) and Vite (v3). Home page of application comprises of various sections and each section comprises of multiple components. Hence when this page loads, it makes network request to 50+ components resulting into network waterfall hell!
Is there any mechanism to bundle the components into modules (like feature modules) and load them instead? Example, I can bundle multiple header related components into one header-module and make 1 network request instead of many!
routify.config.js
module.exports = {
routifyDir: '.routify',
dynamicImports: true,
extensions: ['svelte']
}
vite.config.js
export default defineConfig({
server: {
port: 5000,
},
plugins: [
svelte({
preprocess: [preprocess()],
}),
],
});



Routify only handles loading your page and modules (_layout.svelte).
That means for the page /admin/dashboard, Routify will dynamically import
How you import components is between you and your bundler. In this case Vite. It sounds like Vite is converting your imports to dynamic imports.