Security News
PyPI Introduces Digital Attestations to Strengthen Python Package Security
PyPI now supports digital attestations, enhancing security and trust by allowing package maintainers to verify the authenticity of Python packages.
electron-webpack-plugin
Advanced tools
Webpack plugin to restart Electron.
Requires a peer dependency of electron
.
NOTE: As of version 2.0.0
, relaunchPathMatch
has changed to test
- which is a regex to test the module ID against.
new ElectronPlugin({
// if a module ID matches this regex and that module has changed, electron will be restarted
// *required*
test: /^.\/src\/browser/,
// the path to launch electron with
// *required*
path: "./output",
// the command line arguments to launch electron with
// optional
args: ["--enable-logging"],
// the options to pass to child_process.spawn
// see: https://nodejs.org/api/child_process.html#child_process_child_process_spawnsync_command_args_options
// optional
options: {
env: {NODE_ENV: "development"}
}
})
With this config, Electron will restart when any module in ./src/browser
changes.
const ElectronPlugin = require("electron-webpack-plugin");
module.exports = {
entry: {
"browser/index": "./src/browser/index.js",
"renderer/index": "./src/renderer/index.js",
},
output: {
path: "./output",
filename: "scripts/[name].js"
},
plugins: [
new ElectronPlugin({
test: /^.\/src\/browser/,
path: "output"
})
],
target: "electron"
};
You will need to use write-file-webpack-plugin, to allow Electron to access the output path.
You will also need to add the following options:
devServer: {
// electron will break if client is inlined in main process
inline: false
}
You will also need to add the dev server client to your renderer entry point, if it is not already:
"renderer/index": [
"webpack-dev-server/client?http://localhost:3000",
"./src/scripts/renderer/index.js"
]
This will allow HMR with inline: false
.
(replace http://localhost:3000
with whatever your dev server URL is)
FAQs
Webpack plugin to launch Electron.
The npm package electron-webpack-plugin receives a total of 3 weekly downloads. As such, electron-webpack-plugin popularity was classified as not popular.
We found that electron-webpack-plugin demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
PyPI now supports digital attestations, enhancing security and trust by allowing package maintainers to verify the authenticity of Python packages.
Security News
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
Security News
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.