You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
James Kaviyil Jose adac42ea1e
[Docs]: Added TOC
2 weeks ago
..
aggressive-merging update examples 2 weeks ago
chunkhash update examples 2 weeks ago
code-splitted-css-bundle Switch from uglifyjs-webpack-plugin to terser-webpack-plugin 9 months ago
code-splitted-require.context update examples 2 weeks ago
code-splitted-require.context-amd update examples 2 weeks ago
code-splitting update examples 2 weeks ago
code-splitting-bundle-loader update examples 2 weeks ago
code-splitting-harmony update examples 2 weeks ago
code-splitting-native-import-context update examples 2 weeks ago
code-splitting-native-import-context-filter update examples 2 weeks ago
code-splitting-specify-chunk-name update examples 2 weeks ago
coffee-script update examples 2 weeks ago
common-chunk-and-vendor-chunk update examples 2 weeks ago
common-chunk-grandchildren update examples 2 weeks ago
commonjs update examples 2 weeks ago
dll update examples 2 weeks ago
dll-app-and-vendor update examples 2 weeks ago
dll-entry-only update examples 2 weeks ago
dll-user update examples 2 weeks ago
explicit-vendor-chunk update examples 2 weeks ago
externals update examples 2 weeks ago
extra-async-chunk update examples 2 weeks ago
extra-async-chunk-advanced update examples 2 weeks ago
harmony update examples 2 weeks ago
harmony-interop update examples 2 weeks ago
harmony-library update examples 2 weeks ago
harmony-unused update examples 2 weeks ago
http2-aggressive-splitting update examples 2 weeks ago
hybrid-routing update examples 2 weeks ago
i18n update examples 2 weeks ago
loader update examples 2 weeks ago
many-pages update examples 2 weeks ago
mixed update examples 2 weeks ago
multi-compiler update examples 2 weeks ago
multi-part-library update examples 2 weeks ago
multiple-entry-points update examples 2 weeks ago
named-chunks update examples 2 weeks ago
node_modules added dll example with module 3 years ago
require.context update examples 2 weeks ago
require.resolve update examples 2 weeks ago
scope-hoisting update examples 2 weeks ago
side-effects update examples 2 weeks ago
source-map update examples 2 weeks ago
two-explicit-vendor-chunks update examples 2 weeks ago
wasm-simple update examples 2 weeks ago
web-worker update examples 2 weeks ago
README.md [Docs]: Added TOC 2 weeks ago
build-common.js chore(examples): output error if webpack-cli isn't installed 4 months ago
buildAll.js Refactor chunk graph 1 year ago
examples.js Refactor example scripts and test to allow nested folders 2 years ago
template-common.js chore(examples): modify RegExp in template-common 4 months ago

README.md

Examples

Table of Contents

  1. Aggressive Merging
  2. Chunk
  3. Code Splitted
  4. Code Splitting
  5. Coffee Script
  6. CommonJS
  7. DLL
  8. Externals
  9. Harmony
  10. HTTP2 Aggressive Splitting
  11. Hybrid Routing
  12. i18n
  13. Loader
  14. Mixed
  15. Multi Compiler
  16. Multi Part Library
  17. Multiple Entry Points
  18. Require Context
  19. Require Resolve
  20. Scope Hoisting
  21. Side Effects
  22. Source Map
  23. Web Worker
  24. Requests
  25. Building an Example

Aggressive Merging

aggressive-merging

Chunk

chunkhash

common-chunk-and-vendor-chunk

explicit-vendor-chunk

extra-async-chunk-advanced

extra-async-chunk

code-splitting-specify-chunk-name

named-chunks example demonstrating merging of chunks with named chunks

two-explicit-vendor-chunks

Code Splitted

code-splitted-css-bundle

code-splitted-require.context-amd example demonstrating contexts in a code-split environment with AMD.

code-splitted-require.context example demonstrating contexts in a code-split environment.

Code Splitting

code-splitting example demonstrating a very simple case of Code Splitting.

code-splitting-bundle-loader example demonstrating Code Splitting through the builder loader

code-splitting-harmony

code-splitting-native-import-context

code-splitting-specify-chunk-name

Coffee Script

coffee-script example demonstrating code written in coffee-script.

CommonJS

commonjs example demonstrating a very simple program

DLL

dll

dll-user

Externals

externals

Harmony

harmony

code-splitting-harmony

harmony-interop

harmony-library

harmony-unused

HTTP2 Aggressive Splitting

http2-aggressive-splitting

Hybrid Routing

hybrid-routing

i18n

i18n example demonstrating localization.

Loader

loader example demonstrating the usage of loaders.

Mixed

mixed example demonstrating mixing CommonJs and AMD

Multi Compiler

multi-compiler

Multi Part Library

multi-part-library

Multiple Entry Points

multiple-entry-points example demonstrating multiple entry points with Code Splitting.

Require Context

require.context example demonstrating automatic creation of contexts when using variables in require.

Require Resolve

require.resolve example demonstrating how to cache clearing of modules with require.resolve and require.cache.

Scope Hoisting

scope-hoisting

Side Effects

side-effects

Source Map

source-map

Web Worker

web-worker example demonstrating creating WebWorkers with webpack and the worker-loader.

Requests

If you think an example is missing, please report it as issue. :)

Building an Example

  1. Run yarn in the root of the project.
  2. Run yarn setup in the root of the project.
  3. Run yarn add --dev webpack-cli in the root of the project.
  4. Run node build.js in the specific example directory. (Ex: cd examples/commonjs && node build.js)

Note: To build all examples run npm run build:examples