Skip to content

Commit 7067657

Browse files
committed
docs(examples): fix options usage
1 parent eea7cc4 commit 7067657

File tree

13 files changed

+17
-18
lines changed

13 files changed

+17
-18
lines changed

examples/api/middleware/server.js

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,7 @@ const WebpackDevServer = require('../../../lib/Server');
55
const webpackConfig = require('./webpack.config');
66

77
const compiler = Webpack(webpackConfig);
8-
const devServerOptions = Object.assign({}, webpackConfig.devServer, {
9-
stats: {
10-
colors: true,
11-
},
12-
});
8+
const devServerOptions = webpackConfig.devServer;
139
const server = new WebpackDevServer(compiler, devServerOptions);
1410

1511
server.listen(8080, '127.0.0.1', () => {

examples/api/middleware/webpack.config.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,7 @@ module.exports = setup({
1010
output: {
1111
filename: 'bundle.js',
1212
},
13+
stats: {
14+
colors: true,
15+
},
1316
});

examples/api/simple/server.js

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,6 @@ const webpackConfig = require('./webpack.config');
77
const compiler = Webpack(webpackConfig);
88
const devServerOptions = Object.assign({}, webpackConfig.devServer, {
99
open: true,
10-
stats: {
11-
colors: true,
12-
},
1310
});
1411
const server = new WebpackDevServer(compiler, devServerOptions);
1512

examples/api/simple/webpack.config.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,7 @@ module.exports = setup({
1010
output: {
1111
filename: 'bundle.js',
1212
},
13+
stats: {
14+
colors: true,
15+
},
1316
});

examples/cli/open-page-multiple/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# CLI: Open Page Option (Multiple)
22

33
```console
4-
npm run webpack-dev-server -- --open-page example1.html,example2.html
4+
npm run webpack-dev-server -- --open --open-page example1.html --open-page example2.html
55
```
66

77
Some applications may consist of multiple pages. During development it may

examples/cli/open-page-multiple/webpack.config.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ module.exports = [
2020
}),
2121
],
2222
}),
23-
setup({
23+
{
2424
context: __dirname,
2525
entry: './app2.js',
2626
output: {
@@ -33,5 +33,5 @@ module.exports = [
3333
title: 'Open Page (Multiple) / Example / Page 2',
3434
}),
3535
],
36-
}),
36+
},
3737
];

examples/cli/open-page/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# CLI: Open Page Option
22

33
```console
4-
npm run webpack-dev-server -- --open-page example.html#page1
4+
npm run webpack-dev-server -- --open --open-page example.html#page1
55
```
66

77
Some applications may consist of multiple pages. During development it may

examples/cli/watch-content-base/README.md renamed to examples/cli/watch-static/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
## Watching a single directory
44

55
```console
6-
npm run webpack-dev-server -- --content-base assets --watch-content-base --open
6+
npm run webpack-dev-server -- --static assets --open
77
```
88

99
### What Should Happen
@@ -20,13 +20,13 @@ npm run webpack-dev-server -- --content-base assets --watch-content-base --open
2020
module.exports = {
2121
/* ... */
2222
devServer: {
23-
contentBase: ['assets', 'css'],
23+
static: ['assets', 'css'],
2424
},
2525
};
2626
```
2727

2828
```console
29-
npm run webpack-dev-server -- --watch-content-base --open
29+
npm run webpack-dev-server -- --open
3030
```
3131

3232
### What Should Happen
File renamed without changes.

0 commit comments

Comments
 (0)