Skip to content

Commit 8605880

Browse files
committed
chore: upgrade deps & add example
1 parent 3c6a0d4 commit 8605880

File tree

8 files changed

+4516
-275
lines changed

8 files changed

+4516
-275
lines changed

example/main.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
throw new Error('Boom')

example/package.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"private": true,
3+
"dependencies": {
4+
"html-webpack-plugin": "^3.2.0",
5+
"webpack": "^4.28.4",
6+
"webpack-cli": "^3.2.1",
7+
"webpack-dev-server": "^3.1.14"
8+
}
9+
}

example/webpack.config.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
const path = require('path')
2+
const HtmlWebpackPlugin = require('html-webpack-plugin')
3+
const ErrorOverlayPlugin = require('../lib')
4+
5+
module.exports = {
6+
mode: 'development',
7+
entry: './main.js',
8+
output: {
9+
path: path.join(__dirname, 'dist'),
10+
filename: 'bundle.js',
11+
},
12+
plugins: [new ErrorOverlayPlugin(), new HtmlWebpackPlugin()],
13+
devtool: 'cheap-module-source-map', // 'eval' is not supported by error-overlay-webpack-plugin
14+
devServer: {},
15+
}

example/yarn.lock

Lines changed: 4141 additions & 0 deletions
Large diffs are not rendered by default.

package.json

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,22 +23,22 @@
2323
"release": "standard-version && conventional-github-releaser -p angular"
2424
},
2525
"devDependencies": {
26-
"@babel/cli": "^7.1.5",
27-
"@babel/core": "^7.1.5",
28-
"@babel/preset-env": "^7.1.5",
26+
"@babel/cli": "^7.2.3",
27+
"@babel/core": "^7.2.2",
28+
"@babel/preset-env": "^7.2.3",
2929
"babel-eslint": "^10.0.1",
3030
"conventional-github-releaser": "^3.1.2",
31-
"eslint": "^5.9.0",
31+
"eslint": "^5.12.0",
3232
"eslint-config-airbnb-base": "^13.1.0",
3333
"eslint-config-prettier": "^3.3.0",
3434
"eslint-plugin-import": "^2.14.0",
35-
"prettier": "^1.15.2",
35+
"prettier": "^1.15.3",
3636
"standard-version": "^4.4.0"
3737
},
3838
"license": "MIT",
3939
"dependencies": {
40-
"react-dev-utils": "^6.1.1",
41-
"react-error-overlay": "^5.1.0"
40+
"react-dev-utils": "^7.0.1",
41+
"react-error-overlay": "^5.1.2"
4242
},
4343
"peerDependencies": {
4444
"webpack": "^4.0.0"

src/entry.js

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
import {
33
setEditorHandler,
44
startReportingRuntimeErrors,
5-
dismissBuildError,
65
} from 'react-error-overlay'
76
import launchEditorEndpoint from 'react-dev-utils/launchEditorEndpoint'
87

@@ -21,10 +20,12 @@ setEditorHandler(errorLocation => {
2120

2221
startReportingRuntimeErrors({
2322
onError() {
24-
module.hot.addStatusHandler(status => {
25-
if (status === 'apply') {
26-
window.location.reload()
27-
}
28-
})
23+
if (module.hot) {
24+
module.hot.addStatusHandler(status => {
25+
if (status === 'apply') {
26+
window.location.reload()
27+
}
28+
})
29+
}
2930
},
3031
})

src/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ Please use a multi-main (array) or object-form \`entry\` setting for now.`,
3838
entry.unshift(chunkPath)
3939
}
4040
} else {
41-
Object.keys(entry).forEach((entryName) => {
41+
Object.keys(entry).forEach(entryName => {
4242
entry[entryName] = adjustEntry(entry[entryName], chunkPath)
4343
})
4444
}

yarn.lock

Lines changed: 335 additions & 261 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)