webpack/examples/require.context/template.md

482 B

example.js

_{{example.js}}_

templates/

  • a.js
  • b.js
  • c.js

All templates are of this pattern:

module.exports = function() {
	return "This text was generated by template X";
}

dist/output.js

_{{dist/output.js}}_

Info

Unoptimized

_{{stdout}}_

Production mode

_{{production:stdout}}_

Code Splitting

See this example combined with code splitting