1.0.5 • Published 4 years ago

electron-dev-webpack-plugin v1.0.5

Weekly downloads
26
License
MIT
Repository
github
Last release
4 years ago

electron-dev-webpack-plugin

A webpack plugin for electron development, When the file changes automatically restart electron main process. example: shortcut-capture

screenshot.jpg

Install

NPM

Usage

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)
})

Options

interface Options {
  port?: number
  title?: string
  info?: (data: string) => void
  warn?: (data: string) => void
}
  • port: electron inspect port, default 5858
new ElectronDevWebpackPlugin({
  port: 5858 // electron inspect port
})
  • title: Plugin log title, default MAIN PROCESS
new ElectronDevWebpackPlugin({
  title: 'MAIN PROCESS'
})
  • info: Functions for custom output logs
new ElectronDevWebpackPlugin({
  info: data => console.log(`INFO ${data}`)
})
  • warn: Custom function to output warnings
new ElectronDevWebpackPlugin({
  warn: data => console.warn(`WARN ${data}`)
})
1.0.5

4 years ago

1.0.4

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago

0.0.11

5 years ago

0.0.10

6 years ago

0.0.9

6 years ago

0.0.8

6 years ago

0.0.7

6 years ago

0.0.6

6 years ago

0.0.5

6 years ago

0.0.4

6 years ago

0.0.3

6 years ago

0.0.2

6 years ago

0.0.1

6 years ago