From ad24b6add00e3e1975e0fd4f44afdf8c6505ad28 Mon Sep 17 00:00:00 2001 From: Slawomir Brzezinski Date: Fri, 12 Jun 2020 20:44:27 +0100 Subject: [PATCH] Docs > Tutorial > Improve discoverability of `manualChunks` for code splitting (#3631) * Improve discoverability of `manualChunks` for code splitting * Action a review comment - change 'late' to 'lazy' Remark from [this comment](https://github.com/rollup/rollup/pull/3631#pullrequestreview-429522492) plus a minor improvement of precision in the parenthesis describing what it is. --- docs/04-tutorial.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/04-tutorial.md b/docs/04-tutorial.md index ddc3c18a41d..9be6fbed265 100755 --- a/docs/04-tutorial.md +++ b/docs/04-tutorial.md @@ -282,7 +282,9 @@ var version=function(){"use strict";var n="1.0.0";return function(){console.log( ### Code Splitting -To use the code splitting feature, we go back to the original example and modify `src/main.js` to load `src/foo.js` dynamically instead of statically: +For code splitting, there are cases where Rollup splits code into chunks automatically, like dynamic loading or multiple entry points, and there is a way to explicitly tell Rollup which modules to split into separate chunks via the [`manualChunks`](guide/en/#manualchunks) option. + +To use the code splitting feature to achieve the lazy dynamic loading (where some imported module(s) is only loaded after executing a function), we go back to the original example and modify `src/main.js` to load `src/foo.js` dynamically instead of statically: ```js // src/main.js