From 8f0cdc9f3a77a05fc3db9bbfc278df6fc252ebfc Mon Sep 17 00:00:00 2001 From: ItalyPaleAle <43508+ItalyPaleAle@users.noreply.github.com> Date: Sat, 9 Dec 2023 10:30:35 -0800 Subject: [PATCH] More docs updated --- Advanced Usage.md | 2 +- examples/dynamic-imports/src/routes/Home.svelte | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Advanced Usage.md b/Advanced Usage.md index a507888..db2ab23 100644 --- a/Advanced Usage.md +++ b/Advanced Usage.md @@ -71,7 +71,7 @@ routes.set('/books', wrap({ ### Async routes and loading placeholders -As mentioned in the main readme, starting with version 3 the `wrap` method is used with dynamically-imported components. This allows (when the bundler supports that, such as with Rollup or Webpack) code-splitting too, so code for less-common routes can be downloaded on-demand from the server rather than shipped in the app's core bundle. +As mentioned in the main readme, starting with version 3 the `wrap` method is used with dynamically-imported components. This allows (when the bundler supports that, such as with Vite, Rollup or Webpack) code-splitting too, so code for less-common routes can be downloaded on-demand from the server rather than shipped in the app's core bundle. This is done by setting the `options.asyncComponent` property to a function that returns a dynamically-imported module. For example: diff --git a/examples/dynamic-imports/src/routes/Home.svelte b/examples/dynamic-imports/src/routes/Home.svelte index 4ca9488..9465d0c 100644 --- a/examples/dynamic-imports/src/routes/Home.svelte +++ b/examples/dynamic-imports/src/routes/Home.svelte @@ -2,7 +2,7 @@

This sample shows how to dynamically import components. These are modules imported on-demand with the import() method.
- Bundlers like Rollup and Webpack support automatic code splitting when you use dynamic imports, so after compiling this sample, in the dist/ folder you'll see a bunch of different JavaScript files. At runtime, the browser requests them only when you first navigate to the route (and then they're cached). + Bundlers like Vite, Rollup and Webpack support automatic code splitting when you use dynamic imports, so after compiling this sample, in the dist/ folder you'll see a bunch of different JavaScript files. At runtime, the browser requests them only when you first navigate to the route (and then they're cached).

This is the Home component, which contains markup only.