Add an Error process

This commit is contained in:
Markus Olsson 2017-05-22 09:20:49 +02:00
parent d55347feb1
commit 2b3b0d3520
5 changed files with 36 additions and 2 deletions

View file

@ -0,0 +1,7 @@
import * as React from 'react'
export class ErrorApp extends React.Component<{ }, void> {
public render() {
return <span>hello world</span>
}
}

13
app/src/crash/index.tsx Normal file
View file

@ -0,0 +1,13 @@
import * as React from 'react'
import * as ReactDOM from 'react-dom'
import { ErrorApp } from './error-app'
const container = document.createElement('div')
container.id = 'desktop-crash-container'
document.body.appendChild(container)
ReactDOM.render(
<ErrorApp />,
document.getElementById('desktop-app-container')!
)

View file

@ -121,11 +121,23 @@ const askPassConfig = merge({}, commonConfig, {
target: 'node',
})
const crashConfig = merge({}, commonConfig, {
entry: { shared: path.resolve(__dirname, 'src/crash/index') },
target: 'electron-renderer',
plugins: [
new HtmlWebpackPlugin({
'filename': 'crash.html',
'chunks': ['crash']
}),
],
})
module.exports = {
main: mainConfig,
shared: sharedConfig,
renderer: rendererConfig,
askPass: askPassConfig,
crash: crashConfig,
replacements: replacements,
externals: commonConfig.externals,
}

View file

@ -36,5 +36,6 @@ const rendererConfig = merge({}, common.renderer, config, {
})
const sharedConfig = merge({}, common.shared, config, { })
const crashConfig = merge({}, common.crash, config, { })
module.exports = [ mainConfig, sharedConfig, rendererConfig, askPassConfig ]
module.exports = [ mainConfig, sharedConfig, rendererConfig, askPassConfig, crashConfig ]

View file

@ -39,6 +39,7 @@ const config = {
const mainConfig = merge({}, common.main, config)
const sharedConfig = merge({}, common.shared, config)
const askPassConfig = merge({}, common.askPass, config)
const crashConfig = merge({}, common.crash, config, { })
const rendererConfig = merge({}, common.renderer, config, {
module: {
@ -61,4 +62,4 @@ const rendererConfig = merge({}, common.renderer, config, {
]
})
module.exports = [ mainConfig, sharedConfig, rendererConfig, askPassConfig ]
module.exports = [ mainConfig, sharedConfig, rendererConfig, askPassConfig, crashConfig ]