Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix typo #13

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions content/blog/vite-code-splitting-that-works.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ This will load the route specific files only when the route is visited and it do

### React

React router also supports code-splitting but the bare **lazy imports** don't work properly in vite/rollup. From my time with lazy loading components in React with vite, you have to warp **Lazy imports** inside a **React.lazy()** to get it working. e.g.
React router also supports code-splitting but the bare **lazy imports** don't work properly in vite/rollup. From my time with lazy loading components in React with vite, you have to wrap **Lazy imports** inside a **React.lazy()** to get it working. e.g.

```js
const Template = React.lazy(() => import('./pages/Template'));
Expand Down Expand Up @@ -64,4 +64,4 @@ export default defineConfig({
```
As we can see, when rollup starts building our app, it'll split the vendor chunk on the basis of the **output.manualChunks** configuration. The vendor array should be there with the boot dependencies i.e. modules that will be loaded during app boot. This works for me and currently the most effective way to split vite generated bundles.

Thanks for reading ✌️. Peace ☮️
Thanks for reading ✌️. Peace ☮️