Skip to content

Commit

Permalink
Docs > Tutorial > Improve discoverability of manualChunks for code …
Browse files Browse the repository at this point in the history
…splitting (#3631)

* Improve discoverability of `manualChunks` for code splitting

* Action a review comment - change 'late' to 'lazy'

Remark from [this comment](#3631 (review))

plus a minor improvement of precision in the parenthesis describing what it is.
  • Loading branch information
zlamma committed Jun 12, 2020
1 parent c063df7 commit ad24b6a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion docs/04-tutorial.md
Expand Up @@ -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
Expand Down

0 comments on commit ad24b6a

Please sign in to comment.