From 8f04afa98e22c09c7e3abef6dd46d4d44899852b Mon Sep 17 00:00:00 2001 From: Slawomir Brzezinski Date: Fri, 12 Jun 2020 00:52:19 +0100 Subject: [PATCH 1/2] Improve discoverability of `manualChunks` for code splitting --- 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..69fb656fb21 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 late dynamic loading (where the import 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 From 51d01b6b0830d86d7d42451b85ae43517bde9ced Mon Sep 17 00:00:00 2001 From: Slawomir Brzezinski Date: Fri, 12 Jun 2020 09:05:44 +0100 Subject: [PATCH 2/2] 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 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/04-tutorial.md b/docs/04-tutorial.md index 69fb656fb21..9be6fbed265 100755 --- a/docs/04-tutorial.md +++ b/docs/04-tutorial.md @@ -284,7 +284,7 @@ var version=function(){"use strict";var n="1.0.0";return function(){console.log( 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 late dynamic loading (where the import 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: +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