Skip to content

Commit 6e18fa6

Browse files
committed
add promise-config example
1 parent 8f897c5 commit 6e18fa6

File tree

4 files changed

+34
-0
lines changed

4 files changed

+34
-0
lines changed

examples/promise-config/README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Promise-Based Config
2+
3+
```shell
4+
node ../../bin/webpack-dev-server.js --open
5+
```
6+
7+
## What should happen
8+
9+
The script should open the browser and show a heading with "Example: Promise Config".

examples/promise-config/app.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
'use strict';
2+
3+
// Change the following line and save to see the compilation status
4+
5+
document.write('It works!');

examples/promise-config/index.html

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<title>Promise Config Example</title>
5+
<script src="/bundle.js" type="text/javascript" charset="utf-8"></script>
6+
</head>
7+
<body>
8+
<h1>Example: Promise Config</h1>
9+
</body>
10+
</html>
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
'use strict';
2+
3+
module.exports = new Promise(((resolve) => {
4+
resolve({
5+
context: __dirname,
6+
entry: './app.js',
7+
devServer: {
8+
}
9+
});
10+
}));

0 commit comments

Comments
 (0)