Skip to content

Commit

Permalink
chore: upgrade deps & add example
Browse files Browse the repository at this point in the history
  • Loading branch information
gregberge committed Jan 11, 2019
1 parent 3c6a0d4 commit 8605880
Show file tree
Hide file tree
Showing 8 changed files with 4,516 additions and 275 deletions.
1 change: 1 addition & 0 deletions example/main.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
throw new Error('Boom')
9 changes: 9 additions & 0 deletions example/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"private": true,
"dependencies": {
"html-webpack-plugin": "^3.2.0",
"webpack": "^4.28.4",
"webpack-cli": "^3.2.1",
"webpack-dev-server": "^3.1.14"
}
}
15 changes: 15 additions & 0 deletions example/webpack.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
const path = require('path')
const HtmlWebpackPlugin = require('html-webpack-plugin')
const ErrorOverlayPlugin = require('../lib')

module.exports = {
mode: 'development',
entry: './main.js',
output: {
path: path.join(__dirname, 'dist'),
filename: 'bundle.js',
},
plugins: [new ErrorOverlayPlugin(), new HtmlWebpackPlugin()],
devtool: 'cheap-module-source-map', // 'eval' is not supported by error-overlay-webpack-plugin
devServer: {},
}
4,141 changes: 4,141 additions & 0 deletions example/yarn.lock

Large diffs are not rendered by default.

14 changes: 7 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,22 +23,22 @@
"release": "standard-version && conventional-github-releaser -p angular"
},
"devDependencies": {
"@babel/cli": "^7.1.5",
"@babel/core": "^7.1.5",
"@babel/preset-env": "^7.1.5",
"@babel/cli": "^7.2.3",
"@babel/core": "^7.2.2",
"@babel/preset-env": "^7.2.3",
"babel-eslint": "^10.0.1",
"conventional-github-releaser": "^3.1.2",
"eslint": "^5.9.0",
"eslint": "^5.12.0",
"eslint-config-airbnb-base": "^13.1.0",
"eslint-config-prettier": "^3.3.0",
"eslint-plugin-import": "^2.14.0",
"prettier": "^1.15.2",
"prettier": "^1.15.3",
"standard-version": "^4.4.0"
},
"license": "MIT",
"dependencies": {
"react-dev-utils": "^6.1.1",
"react-error-overlay": "^5.1.0"
"react-dev-utils": "^7.0.1",
"react-error-overlay": "^5.1.2"
},
"peerDependencies": {
"webpack": "^4.0.0"
Expand Down
13 changes: 7 additions & 6 deletions src/entry.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
import {
setEditorHandler,
startReportingRuntimeErrors,
dismissBuildError,
} from 'react-error-overlay'
import launchEditorEndpoint from 'react-dev-utils/launchEditorEndpoint'

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

startReportingRuntimeErrors({
onError() {
module.hot.addStatusHandler(status => {
if (status === 'apply') {
window.location.reload()
}
})
if (module.hot) {
module.hot.addStatusHandler(status => {
if (status === 'apply') {
window.location.reload()
}
})
}
},
})
2 changes: 1 addition & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ Please use a multi-main (array) or object-form \`entry\` setting for now.`,
entry.unshift(chunkPath)
}
} else {
Object.keys(entry).forEach((entryName) => {
Object.keys(entry).forEach(entryName => {
entry[entryName] = adjustEntry(entry[entryName], chunkPath)
})
}
Expand Down
596 changes: 335 additions & 261 deletions yarn.lock

Large diffs are not rendered by default.

0 comments on commit 8605880

Please sign in to comment.