![Maven Central Adds Sigstore Signature Validation](https://cdn.sanity.io/images/cgdhsj6q/production/7da3bc8a946cfb5df15d7fcf49767faedc72b483-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Maven Central Adds Sigstore Signature Validation
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.
@herberttn/bytenode-webpack-plugin
Advanced tools
Compile JavaScript into bytecode using bytenode
.
Inspired by bytenode-webpack-plugin
.
npm install --save @herberttn/bytenode-webpack-plugin
electron-forge
webpack
entry
as a string
(e.g., entry: 'src/index.js'
)entry
as an array
(e.g., entry: ['src/index.js']
)entry
as an object
(e.g., entry: { main: 'src/index.js' }
)entry
middlewares (e.g., entry: ['src/index.js', 'webpack-hot-middleware/client']
)entry.*.filename
(e.g., entry: { main: { filename: 'index.js' } }
)output.filename
(e.g., output: { filename: '[name].js' }
)output.filename
(e.g., output: { filename: 'index.js' }
)import { BytenodeWebpackPlugin } from '@herberttn/bytenode-webpack-plugin';
// webpack options
module.exports = {
// ...
plugins: [
// using all defaults
new BytenodeWebpackPlugin(),
// overriding an option
new BytenodeWebpackPlugin({
compileForElectron: true,
}),
],
};
interface Options {
compileAsModule: boolean; // wraps the code in a node module
compileForElectron: boolean; // compiles for electron instead of plain node
debugLifecycle: boolean; // enables webpack hooks lifecycle logs
keepSource: boolean; // emits the original source files along with the compiled ones
preventSourceMaps: boolean; // prevents source maps from being generated
}
new BytenodeWebpackPlugin({
compileAsModule: true,
compileForElectron: false,
debugLifecycle: false,
keepSource: false,
preventSourceMaps: true,
})
electron-forge
supportYou may need to change the default entry configuration for the main process. Probably something like this:
- entry: './src/index.ts',
+ entry: {
+ index: './src/index.ts',
+ },
+ output: {
+ filename: '[name].js',
+ },
You will probably run into missing node core modules.
If you run into a webpack error similar to the one below, it's because bytenode
requires some of node's code modules to properly do its job, and only you can decide the best way to provide them given your configuration.
Two possible solutions:
node
Other solutions may exist.
Error example:
ERROR in ../../node_modules/bytenode/lib/index.js 3:11-24
Module not found: Error: Can't resolve 'fs' in '../../node_modules/bytenode/lib'
@ ./src/renderer.loader.js 1:0-19
BREAKING CHANGE: webpack < 5 used to include polyfills for node.js core modules by default.
This is no longer the case. Verify if you need this module and configure a polyfill for it.
If you want to include a polyfill, you need to:
- add a fallback 'resolve.fallback: { "vm": require.resolve("vm-browserify") }'
- install 'vm-browserify'
If you don't want to include a polyfill, you can use an empty module like this:
resolve.fallback: { "vm": false }
@ ./src/renderer.loader.js 1:0-19
herberttn |
Jeff Robbins |
FAQs
Compile JavaScript into bytecode using bytenode
The npm package @herberttn/bytenode-webpack-plugin receives a total of 0 weekly downloads. As such, @herberttn/bytenode-webpack-plugin popularity was classified as not popular.
We found that @herberttn/bytenode-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
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.
Security News
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
Research
Security News
Socket researchers uncovered a backdoored typosquat of BoltDB in the Go ecosystem, exploiting Go Module Proxy caching to persist undetected for years.