Skip to content

Commit 0541963

Browse files
authored
docs: update README and examples (#2848)
1 parent e647af4 commit 0541963

File tree

24 files changed

+21
-165
lines changed

24 files changed

+21
-165
lines changed

README.md

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66

77
[![npm][npm]][npm-url]
88
[![node][node]][node-url]
9-
[![deps][deps]][deps-url]
109
[![tests][tests]][tests-url]
1110
[![coverage][cover]][cover-url]
1211
[![chat][chat]][chat-url]
@@ -52,14 +51,14 @@ There are two main, recommended methods of using the module:
5251

5352
### With the CLI
5453

55-
The easiest way to use it is with the CLI. In the directory where your
54+
The easiest way to use it is with the [webpack CLI](https://webpack.js.org/api/cli/). In the directory where your
5655
`webpack.config.js` is, run:
5756

5857
```console
59-
node_modules/.bin/webpack-dev-server
58+
node_modules/.bin/webpack serve
6059
```
6160

62-
_**Note**: Many CLI options are available with `webpack-dev-server`. Explore this [link](https://webpack.js.org/configuration/dev-server/)._
61+
_**Note**: Many CLI options are available with `webpack serve`. Explore this [link](https://webpack.js.org/configuration/dev-server/)._
6362

6463
### With NPM Scripts
6564

@@ -69,7 +68,7 @@ script as such:
6968

7069
```json
7170
"scripts": {
72-
"start:dev": "webpack-dev-server"
71+
"start:dev": "webpack serve"
7372
}
7473
```
7574

@@ -144,8 +143,6 @@ This project is heavily inspired by [peerigon/nof5](https://github.com/peerigon/
144143
[npm-url]: https://npmjs.com/package/webpack-dev-server
145144
[node]: https://img.shields.io/node/v/webpack-dev-server.svg
146145
[node-url]: https://nodejs.org
147-
[deps]: https://david-dm.org/webpack/webpack-dev-server.svg
148-
[deps-url]: https://david-dm.org/webpack/webpack-dev-server
149146
[tests]: https://github.com/webpack/webpack-dev-server/workflows/webpack-dev-server/badge.svg
150147
[tests-url]: https://github.com/webpack/webpack-dev-server/actions?query=workflow%3Awebpack-dev-server
151148
[cover]: https://codecov.io/gh/webpack/webpack-dev-server/branch/master/graph/badge.svg

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/listen-socket/README.md

Lines changed: 0 additions & 50 deletions
This file was deleted.

examples/cli/listen-socket/check-socket.js

Lines changed: 0 additions & 9 deletions
This file was deleted.

examples/cli/listen-socket/webpack.config.js

Lines changed: 0 additions & 10 deletions
This file was deleted.

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
];

0 commit comments

Comments
 (0)