A webpack plugin for electron development
MIT License
A webpack plugin for electron development, When the file changes automatically restart electron main process. example: shortcut-capture
import path from 'path'
import webpack, { Configuration } from 'webpack'
import ElectronDevWebpackPlugin from './src'
const config: Configuration = {
mode: 'development',
entry: {
app: './app.js'
},
output: {
path: path.resolve(__dirname, '../dist'),
filename: '[name].js'
},
watch: true,
devtool: false,
plugins: [
new ElectronDevWebpackPlugin()
// or
new ElectronDevWebpackPlugin({
port: 5858 // electron inspect port
})
]
}
webpack(config, (err, stats) => {
console.log(err)
})
interface Options {
port?: number
title?: string
info?: (data: string) => void
warn?: (data: string) => void
}
5858
new ElectronDevWebpackPlugin({
port: 5858 // electron inspect port
})
MAIN PROCESS
new ElectronDevWebpackPlugin({
title: 'MAIN PROCESS'
})
new ElectronDevWebpackPlugin({
info: data => console.log(`INFO ${data}`)
})
new ElectronDevWebpackPlugin({
warn: data => console.warn(`WARN ${data}`)
})