Skip to content

Commit 9921ecc

Browse files
committed
Add basic example for multi-compiler
1 parent c32cfa8 commit 9921ecc

File tree

3 files changed

+34
-0
lines changed

3 files changed

+34
-0
lines changed

examples/cli/multi-compiler/README.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# CLI: Multi Compiler
2+
3+
`webpack-dev-server` should be able to compile multiple webpack configs.
4+
5+
```shell
6+
npm run webpack-dev-server -- --open
7+
```
8+
9+
## What Should Happen
10+
11+
1. The script should open `http://localhost:8080/` in your default browser.
12+
2. You should see the text on the page itself change to read `Success!`.
13+
3. In `app.js` write code containing a syntax error and save the file.
14+
4. The page should now refresh and show a full screen error overlay, displaying
15+
the syntax error.

examples/cli/multi-compiler/app.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
'use strict';
2+
3+
const target = document.querySelector('#target');
4+
5+
target.classList.add('pass');
6+
target.innerHTML = 'Success!';
7+
8+
// This results in an error:
9+
// if(!window) require("test");
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
'use strict';
2+
3+
// our setup function adds behind-the-scenes bits to the config that all of our
4+
// examples need
5+
const { setup } = require('../../util');
6+
7+
module.exports = [setup({
8+
context: __dirname,
9+
entry: './app.js'
10+
})];

0 commit comments

Comments
 (0)