diff --git a/src/content/concepts/configuration.md b/src/content/concepts/configuration.md index 6bcb1f46cdf3..e2d4828f7bbe 100644 --- a/src/content/concepts/configuration.md +++ b/src/content/concepts/configuration.md @@ -28,7 +28,7 @@ T> The most important part to take away from this document is that there are man The following examples below describe how webpack's configuration object can be both expressive and configurable because _it is code_: -## The Simplest Configuration +## Simple Configuration **webpack.config.js** @@ -36,6 +36,7 @@ The following examples below describe how webpack's configuration object can be var path = require('path'); module.exports = { + mode: 'development', entry: './foo.js', output: { path: path.resolve(__dirname, 'dist'), diff --git a/src/content/configuration/configuration-languages.md b/src/content/configuration/configuration-languages.md index a3ac2379200f..e0589ae82966 100644 --- a/src/content/configuration/configuration-languages.md +++ b/src/content/configuration/configuration-languages.md @@ -30,6 +30,7 @@ import * as webpack from 'webpack'; import * as path from 'path'; const config: webpack.Configuration = { + mode: 'production', entry: './foo.js', output: { path: path.resolve(__dirname, 'dist'), @@ -101,6 +102,7 @@ webpack = require('webpack') path = require('path') config = + mode: 'production' entry: './path/to/my/entry/file.js' output: path: path.resolve(__dirname, 'dist') @@ -150,7 +152,7 @@ const CustomPlugin = config => ({ }); export default ( - + [mode](/concepts/mode): "production", // "production" | "development" | "none" + [mode](/concepts/mode): "production", // enable many optimizations for production builds + [mode](/concepts/mode): "development", // enabled useful tools for development + [mode](/concepts/mode): "none", // no defaults + + // Chosen mode tells webpack to use its built-in optimizations accordingly. +
[entry](/configuration/entry-context#entry): "./app/entry", // string | object | array [entry](/configuration/entry-context#entry): ["./app/entry1", "./app/entry2"], [entry](/configuration/entry-context#entry): {