Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add basic example for multi-compiler
- Loading branch information
Showing
3 changed files
with
34 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# CLI: Multi Compiler | ||
|
||
`webpack-dev-server` should be able to compile multiple webpack configs. | ||
|
||
```shell | ||
npm run webpack-dev-server -- --open | ||
``` | ||
|
||
## What Should Happen | ||
|
||
1. The script should open `http://localhost:8080/` in your default browser. | ||
2. You should see the text on the page itself change to read `Success!`. | ||
3. In `app.js` write code containing a syntax error and save the file. | ||
4. The page should now refresh and show a full screen error overlay, displaying | ||
the syntax error. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
'use strict'; | ||
|
||
const target = document.querySelector('#target'); | ||
|
||
target.classList.add('pass'); | ||
target.innerHTML = 'Success!'; | ||
|
||
// This results in an error: | ||
// if(!window) require("test"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
'use strict'; | ||
|
||
// our setup function adds behind-the-scenes bits to the config that all of our | ||
// examples need | ||
const { setup } = require('../../util'); | ||
|
||
module.exports = [setup({ | ||
context: __dirname, | ||
entry: './app.js' | ||
})]; |