2017-06-20 18:42:46 +08:00
|
|
|
# Examples
|
|
|
|
## Aggressive Merging
|
2018-10-29 01:20:46 +08:00
|
|
|
[aggressive-merging](aggressive-merging)
|
2012-04-06 18:40:43 +08:00
|
|
|
|
2017-06-20 18:42:46 +08:00
|
|
|
## Chunk
|
|
|
|
[chunkhash](chunkhash)
|
2012-05-07 03:14:36 +08:00
|
|
|
|
2017-06-20 18:42:46 +08:00
|
|
|
[common-chunk-and-vendor-chunk](common-chunk-and-vendor-chunk)
|
2012-05-07 03:14:36 +08:00
|
|
|
|
2017-06-20 18:42:46 +08:00
|
|
|
[explicit-vendor-chunk](explicit-vendor-chunk)
|
2012-04-06 18:40:43 +08:00
|
|
|
|
2017-06-20 18:42:46 +08:00
|
|
|
[extra-async-chunk-advanced](extra-async-chunk-advanced)
|
2012-04-06 18:40:43 +08:00
|
|
|
|
2017-06-20 18:42:46 +08:00
|
|
|
[extra-async-chunk](extra-async-chunk)
|
2012-07-19 17:48:07 +08:00
|
|
|
|
2017-06-20 18:42:46 +08:00
|
|
|
[code-splitting-specify-chunk-name](code-splitting-specify-chunk-name)
|
2012-07-19 17:48:07 +08:00
|
|
|
|
2017-11-14 20:43:27 +08:00
|
|
|
[named-chunks](named-chunks) example demonstrating merging of chunks with named chunks
|
2012-04-06 18:40:43 +08:00
|
|
|
|
2017-06-20 18:42:46 +08:00
|
|
|
[two-explicit-vendor-chunks](two-explicit-vendor-chunks)
|
2012-08-23 07:58:17 +08:00
|
|
|
|
2017-06-20 18:42:46 +08:00
|
|
|
## Code Splitted
|
|
|
|
[code-splitted-css-bundle](code-splitted-css-bundle)
|
2012-08-23 07:58:17 +08:00
|
|
|
|
2017-06-20 18:42:46 +08:00
|
|
|
[code-splitted-require.context-amd](code-splitted-require.context-amd) example demonstrating contexts in a code-split environment with AMD.
|
2012-04-06 18:40:43 +08:00
|
|
|
|
2017-06-20 18:42:46 +08:00
|
|
|
[code-splitted-require.context](code-splitted-require.context) example demonstrating contexts in a code-split environment.
|
2012-04-06 18:40:43 +08:00
|
|
|
|
2017-06-20 18:42:46 +08:00
|
|
|
## Code Splitting
|
|
|
|
[code-splitting](code-splitting) example demonstrating a very simple case of Code Splitting.
|
2012-04-06 18:40:43 +08:00
|
|
|
|
2017-06-20 18:42:46 +08:00
|
|
|
[code-splitting-bundle-loader](code-splitting-bundle-loader) example demonstrating Code Splitting through the builder loader
|
2012-04-06 18:40:43 +08:00
|
|
|
|
2018-10-29 01:20:46 +08:00
|
|
|
[code-splitting-harmony](code-splitting-harmony)
|
2012-05-07 03:14:36 +08:00
|
|
|
|
2018-10-29 01:20:46 +08:00
|
|
|
[code-splitting-native-import-context](code-splitting-native-import-context)
|
2012-05-07 03:14:36 +08:00
|
|
|
|
2017-06-20 18:42:46 +08:00
|
|
|
[code-splitting-specify-chunk-name](code-splitting-specify-chunk-name)
|
2012-05-17 18:46:55 +08:00
|
|
|
|
2017-06-20 18:42:46 +08:00
|
|
|
## Coffee Script
|
|
|
|
[coffee-script](coffee-script) example demonstrating code written in coffee-script.
|
2012-05-17 18:46:55 +08:00
|
|
|
|
2017-06-20 18:42:46 +08:00
|
|
|
## CommonJS
|
|
|
|
[commonjs](commonjs) example demonstrating a very simple program
|
2012-08-07 04:19:15 +08:00
|
|
|
|
2017-06-20 18:42:46 +08:00
|
|
|
## DLL
|
|
|
|
[dll](dll)
|
2012-08-23 07:58:17 +08:00
|
|
|
|
2017-06-20 18:42:46 +08:00
|
|
|
[dll-user](dll-user)
|
2013-02-19 19:48:17 +08:00
|
|
|
|
2017-06-20 18:42:46 +08:00
|
|
|
## Externals
|
|
|
|
[externals](externals)
|
2013-02-19 19:48:17 +08:00
|
|
|
|
2017-06-20 18:42:46 +08:00
|
|
|
## Harmony
|
|
|
|
[harmony](harmony)
|
2013-11-20 01:09:26 +08:00
|
|
|
|
2017-06-20 18:42:46 +08:00
|
|
|
[code-splitting-harmony](code-splitting-harmony)
|
2013-11-20 01:09:26 +08:00
|
|
|
|
2017-06-20 18:42:46 +08:00
|
|
|
[harmony-interop](harmony-interop)
|
|
|
|
|
|
|
|
[harmony-library](harmony-library)
|
|
|
|
|
|
|
|
[harmony-unused](harmony-unused)
|
|
|
|
|
2017-09-01 10:11:06 +08:00
|
|
|
## HTTP2 Aggressive Splitting
|
2017-06-20 18:42:46 +08:00
|
|
|
[http2-aggressive-splitting](http2-aggressive-splitting)
|
|
|
|
|
|
|
|
## Hybrid Routing
|
|
|
|
[hybrid-routing](hybrid-routing)
|
|
|
|
|
|
|
|
## i18n
|
|
|
|
[i18n](i18n) example demonstrating localization.
|
|
|
|
|
|
|
|
## Loader
|
|
|
|
[loader](loader) example demonstrating the usage of loaders.
|
|
|
|
|
|
|
|
## Mixed
|
|
|
|
[mixed](mixed) example demonstrating mixing CommonJs and AMD
|
|
|
|
|
|
|
|
## Multi Compiler
|
|
|
|
[multi-compiler](multi-compiler)
|
|
|
|
|
|
|
|
## Multi Part Library
|
|
|
|
[multi-part-library](multi-part-library)
|
2012-04-06 18:40:43 +08:00
|
|
|
|
2017-06-20 18:42:46 +08:00
|
|
|
## Multiple Entry Points
|
|
|
|
[multiple-entry-points](multiple-entry-points) example demonstrating multiple entry points with Code Splitting.
|
|
|
|
|
|
|
|
## Require Context
|
|
|
|
[require.context](require.context) example demonstrating automatic creation of contexts when using variables in `require`.
|
|
|
|
|
|
|
|
## Require Resolve
|
|
|
|
[require.resolve](require.resolve) example demonstrating how to cache clearing of modules with `require.resolve` and `require.cache`.
|
|
|
|
|
|
|
|
## Scope Hoisting
|
|
|
|
[scope-hoisting](scope-hoisting)
|
|
|
|
|
2017-11-30 03:52:09 +08:00
|
|
|
## Side Effects
|
|
|
|
[side-effects](side-effects)
|
2017-08-08 15:40:17 +08:00
|
|
|
|
2017-06-20 18:42:46 +08:00
|
|
|
## Source Map
|
|
|
|
[source-map](source-map)
|
|
|
|
|
|
|
|
## Web Worker
|
|
|
|
[web-worker](web-worker) example demonstrating creating WebWorkers with webpack and the worker-loader.
|
|
|
|
|
|
|
|
|
|
|
|
# Requests
|
2015-05-27 10:29:04 +08:00
|
|
|
If you think an example is missing, please report it as issue. :)
|
2012-04-06 18:40:43 +08:00
|
|
|
|
2015-11-12 02:53:41 +08:00
|
|
|
# Building an Example
|
2018-10-29 18:29:06 +08:00
|
|
|
1. Run `yarn` in the root of the project.
|
|
|
|
2. Run `yarn setup` in the root of the project.
|
2018-05-02 18:12:24 +08:00
|
|
|
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`)
|
2016-10-14 15:20:29 +08:00
|
|
|
|
|
|
|
Note: To build all examples run `npm run build:examples`
|