From 86d4138dea0fa4ef301480f658d822887609f148 Mon Sep 17 00:00:00 2001 From: Bartosz Kaszubowski Date: Thu, 8 Mar 2018 07:22:38 +0100 Subject: [PATCH 1/6] docs(devServer): clarify devServer "open" option description Added information that you can also use browser name in the config file. --- src/content/configuration/dev-server.md | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/content/configuration/dev-server.md b/src/content/configuration/dev-server.md index 833f56398017..b6b050f93947 100644 --- a/src/content/configuration/dev-server.md +++ b/src/content/configuration/dev-server.md @@ -458,6 +458,11 @@ When `open` is enabled, the dev server will open the browser. ```js open: true ``` +If no browser is provided (as shown above), your default browser will be used. To specify a different browser, just pass its name instead of boolean: + +```js +open: 'Google Chrome' +``` Usage via the CLI @@ -465,7 +470,7 @@ Usage via the CLI webpack-dev-server --open ``` -If no browser is provided (as shown above), your default browser will be used. To specify a different browser, just pass its name: +Or with specified browser: ```bash webpack-dev-server --open 'Google Chrome' From b50d92356a7d10ba65a3c79f164fde5adae52e16 Mon Sep 17 00:00:00 2001 From: simek Date: Thu, 8 Mar 2018 07:39:52 +0100 Subject: [PATCH 2/6] docs(devServer): add missing type to 'open' option --- src/content/configuration/dev-server.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/content/configuration/dev-server.md b/src/content/configuration/dev-server.md index b6b050f93947..df7caa164f17 100644 --- a/src/content/configuration/dev-server.md +++ b/src/content/configuration/dev-server.md @@ -451,7 +451,7 @@ noInfo: true ## `devServer.open` -`boolean` +`boolean` `string` When `open` is enabled, the dev server will open the browser. From 7761f40c1fdc6dbf3270ea3f2cb4ad916757b2cd Mon Sep 17 00:00:00 2001 From: simek Date: Tue, 13 Mar 2018 12:14:18 +0100 Subject: [PATCH 3/6] docs(devServer): fix Travis CI --- src/content/configuration/dev-server.md | 1 + 1 file changed, 1 insertion(+) diff --git a/src/content/configuration/dev-server.md b/src/content/configuration/dev-server.md index df7caa164f17..89a005c2f606 100644 --- a/src/content/configuration/dev-server.md +++ b/src/content/configuration/dev-server.md @@ -458,6 +458,7 @@ When `open` is enabled, the dev server will open the browser. ```js open: true ``` + If no browser is provided (as shown above), your default browser will be used. To specify a different browser, just pass its name instead of boolean: ```js From 63a9f260212d9e35f097fedbe0027ffb5d49c7d6 Mon Sep 17 00:00:00 2001 From: Sam Chen Date: Fri, 9 Mar 2018 03:38:40 +0800 Subject: [PATCH 4/6] docs(guides): fix sentence (#1887) This removes a word that made a sentence not grammatically correct. --- src/content/guides/asset-management.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/content/guides/asset-management.md b/src/content/guides/asset-management.md index c78d4ad35e88..8a075fe54de3 100644 --- a/src/content/guides/asset-management.md +++ b/src/content/guides/asset-management.md @@ -6,6 +6,7 @@ contributors: - michael-ciniawsky - TheDutchCoder - sudarsangp + - chenxsan --- If you've been following the guides from the start, you will now have a small project that shows "Hello webpack". Now let's try to incorporate some other assets, like images, to see how they can be handled. @@ -325,7 +326,7 @@ __project__ |- /node_modules ``` -With the loader configured and fonts in place, you can use incorporate them via an `@font-face` declaration. The local `url(...)` directive will be picked up by webpack just as it was with the image: +With the loader configured and fonts in place, you can incorporate them via an `@font-face` declaration. The local `url(...)` directive will be picked up by webpack just as it was with the image: __src/style.css__ From b6084ed808d5447b23dd1718db500170afd4eb14 Mon Sep 17 00:00:00 2001 From: Rasmus Fonseca Date: Tue, 13 Mar 2018 03:11:51 -0700 Subject: [PATCH 5/6] docs (guides): Missing line in diff and missing semicolons (#1907) --- src/content/guides/production.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/content/guides/production.md b/src/content/guides/production.md index 248311c05213..445c21a11276 100644 --- a/src/content/guides/production.md +++ b/src/content/guides/production.md @@ -177,7 +177,7 @@ __webpack.prod.js__ + sourceMap: true + }) ] - }) + }); ``` T> Avoid `inline-***` and `eval-***` use in production as they can increase bundle size and reduce the overall performance. @@ -200,12 +200,13 @@ __webpack.prod.js__ plugins: [ new UglifyJSPlugin({ sourceMap: true - }), +- }) ++ }), + new webpack.DefinePlugin({ + 'process.env.NODE_ENV': JSON.stringify('production') + }) ] - }) + }); ``` T> Technically, `NODE_ENV` is a system environment variable that Node.js exposes into running scripts. It is used by convention to determine dev-vs-prod behavior by server tools, build scripts, and client-side libraries. Contrary to expectations, `process.env.NODE_ENV` is not set to `"production"` __within__ the build script `webpack.config.js`, see [#2537](https://github.com/webpack/webpack/issues/2537). Thus, conditionals like `process.env.NODE_ENV === 'production' ? '[name].[hash].bundle.js' : '[name].bundle.js'` within webpack configurations do not work as expected. From 23f300b390c2637f3a3971bc04d5cb04a764d58c Mon Sep 17 00:00:00 2001 From: Fernando Montoya Date: Tue, 18 Dec 2018 11:43:01 +0100 Subject: [PATCH 6/6] Update dev-server.md --- src/content/configuration/dev-server.md | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/content/configuration/dev-server.md b/src/content/configuration/dev-server.md index b4269419efc5..6af19d0cb28b 100644 --- a/src/content/configuration/dev-server.md +++ b/src/content/configuration/dev-server.md @@ -640,8 +640,13 @@ module.exports = { If no browser is provided (as shown above), your default browser will be used. To specify a different browser, just pass its name instead of boolean: -```js -open: 'Google Chrome' +```javascript +module.exports = { + //... + devServer: { + open: 'Google Chrome' + } +}; ``` Usage via the CLI