Skip to content

Commit 6d064d9

Browse files
committed
Start with examples
Ref #581
1 parent c706a9b commit 6d064d9

36 files changed

+223
-82
lines changed

.editorconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
root = true
22

3-
[*.js]
3+
[*.{js,html,less}]
44
indent_style=tab
55
trim_trailing_whitespace=true

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ This project is heavily inspired by [peerigon/nof5](https://github.com/peerigon/
1616

1717
The client scripts are built with `npm run-script prepublish`.
1818

19+
Run the relevant [examples](https://github.com/webpack/webpack-dev-server/tree/master/examples) to see if all functionality still works.
20+
1921
When making a PR, keep these goals in mind:
2022

2123
- The communication library (Sock.js) should not be exposed to the user.

example/README.md

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

example/alternative.config.js

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

examples/README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Examples
2+
3+
Each example showcases a feature. You can use this to learn how to use that feature, but also when making a Pull Request.
4+
5+
An example should be as minimal as possible, and consists of:
6+
7+
- The code that is necessary
8+
- Instructions on how to run
9+
- A description of what should happen

examples/https/README.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# https
2+
3+
```shell
4+
node ../../bin/webpack-dev-server.js --open --https
5+
```
6+
7+
A fake certificate is used to enable https.
8+
9+
## What should happen
10+
11+
The script should open `https://localhost:8080/`. Your browser will probably give you a warning about using an invalid certificate. After ignoring this warning, you should see "It's working."

examples/https/app.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
document.write("It's working.");

examples/https/index.html

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<script src="bundle.js" type="text/javascript" charset="utf-8"></script>
5+
</head>
6+
<body>
7+
<h1>Example: https</h1>
8+
</body>
9+
</html>

examples/https/webpack.config.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
module.exports = {
2+
context: __dirname,
3+
entry: "./app.js",
4+
}

examples/modus-iframe/README.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Modus: iframe
2+
3+
```shell
4+
node ../../bin/webpack-dev-server.js --no-inline --open
5+
```
6+
7+
The app is started in an iframe. The page contains the client script to connect to webpack-dev-server.
8+
9+
## What should happen
10+
11+
It should open `http://localhost:8080/webpack-dev-server/`. In the bar at the top, the text should say `App ready.`
12+
13+
In `app.js`, uncomment the code that results in an error and save. The bar at the top should display `Errors while compiling. App updated with errors. No reload!` with a stack trace underneath it.
14+
15+
Then, in `app.js`, uncomment the code that results in a warning. The bar at the top should display `Warnings while compiling.`.

0 commit comments

Comments
 (0)