mirror of https://github.com/webpack/webpack.git
moved changes to template.md
This commit is contained in:
parent
86d96864fe
commit
50ea1cb157
|
@ -1,6 +1,6 @@
|
|||
This example illustrate a very simple case of Code Splitting with `require.ensure`.
|
||||
This example illustrates a very simple case of Code Splitting with `require.ensure`.
|
||||
|
||||
* `a` and `b` are required normally via CommonsJs
|
||||
* `a` and `b` are required normally via CommonJS
|
||||
* `c` is depdended through the `require.ensure` array.
|
||||
* This means: make it available, but don't execute it
|
||||
* webpack will load it on demand
|
||||
|
@ -12,7 +12,7 @@ This example illustrate a very simple case of Code Splitting with `require.ensur
|
|||
|
||||
You can see that webpack outputs two files/chunks:
|
||||
|
||||
* `output.js` is the entry chunks and contains
|
||||
* `output.js` is the entry chunk and contains
|
||||
* the module system
|
||||
* chunk loading logic
|
||||
* the entry point `example.js`
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
This example show how to use multiple entry points with a commons chunk.
|
||||
This example shows how to use multiple entry points with a commons chunk.
|
||||
|
||||
In this example you have two (HTML) pages `pageA` and `pageB`. You want to create individual bundles for each page. In addition to this you want to create a shared bundle that contains all modules that used in both pages (assuming there are many/big modules in common). The pages also use Code Splitting to load a less used part of the features on demand.
|
||||
In this example you have two (HTML) pages `pageA` and `pageB`. You want to create individual bundles for each page. In addition to this you want to create a shared bundle that contains all modules used in both pages (assuming there are many/big modules in common). The pages also use Code Splitting to load a less used part of the features on demand.
|
||||
|
||||
You can see how to define multiple entry points via the `entry` option and the required changes (`[name]`) in the `output` option. You can also see how to use the CommonsChunkPlugin.
|
||||
|
||||
|
@ -13,7 +13,7 @@ You can see the output files:
|
|||
* `pageA.bundle.js` contains: (`pageB.bundle.js` is similar)
|
||||
* the entry point `pageA.js`
|
||||
* it would contain any other module that is only used by `pageA`
|
||||
* `0.chunk.js` is an additional chunk which if used by both pages. It contains:
|
||||
* `0.chunk.js` is an additional chunk which is used by both pages. It contains:
|
||||
* module `shared.js`
|
||||
|
||||
You can also see the info that is printed to console. It shows among others:
|
||||
|
@ -21,7 +21,7 @@ You can also see the info that is printed to console. It shows among others:
|
|||
* the generated files
|
||||
* the chunks with file, name and id
|
||||
* see lines starting with `chunk`
|
||||
* the modules that are in this chunks
|
||||
* the modules that are in the chunks
|
||||
* the reasons why the modules are included
|
||||
* the reasons why a chunk is created
|
||||
* see lines starting with `>`
|
||||
|
|
Loading…
Reference in New Issue