Skip to content

Commit

Permalink
Merge pull request #17 from m-poh/feature/refactoring-202308011844
Browse files Browse the repository at this point in the history
introduce lazy loading for routes (-25% in chunk sizes)
  • Loading branch information
linomp authored Aug 3, 2023
2 parents b5b3d78 + 65e4a33 commit 5cfa659
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/routes.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
import Home from "./components/Home.svelte";
import Handheld from "./components/Handheld.svelte";
import wrap from "svelte-spa-router/wrap";

const routes = {
'/': Home,
'/handheld': Handheld,
'/': wrap({
asyncComponent: () => import('./components/Home.svelte')
}),
'/handheld': wrap({
asyncComponent: () => import('./components/Handheld.svelte')
}),
}

export {routes}

0 comments on commit 5cfa659

Please sign in to comment.