webpack/examples/code-splitting-native-impor.../template.md

494 B

example.js

This example illustrates how to leverage the import() syntax to create ContextModules which are separated into separate chunks for each module in the ./templates folder.

{{example.js}}

templates/

  • foo.js
  • baz.js
  • bar.js

All templates are of this pattern:

{{templates/foo.js}}

dist/output.js

{{dist/output.js}}

Info

Unoptimized

{{stdout}}

Production mode

{{production:stdout}}