examples/code-splitting/template.md
This example illustrates a very simple case of Code Splitting with require.ensure.
a and b are required normally via CommonJSc is made available(,but doesn't get execute) through the require.ensure array.
b and d are required via CommonJs in the require.ensure callback
b away
You can see that webpack outputs two files/chunks:
output.js is the entry chunk and contains
example.jsab1.output.js is an additional chunk (on-demand loaded) and contains
cdYou can see that chunks are loaded via JSONP. The additional chunks are pretty small and minimize well.
_{{example.js}}_
_{{dist/output.js}}_
_{{dist/node_modules_c_js-node_modules_d_js.output.js}}_
Minimized
_{{production:dist/node_modules_c_js-node_modules_d_js.output.js}}_
_{{stdout}}_
_{{production:stdout}}_