Compile JavaScript into bytecode using bytenode
.
Inspired by bytenode-webpack-plugin
.
npm install --save @herberttn/bytenode-webpack-plugin
-
electron-forge
- ✔️ Default configuration
-
webpack
- ✔️ v4
- ❔ v5
- ✔️
entry
as astring
(e.g.,'src/index.js'
) - ✔️
entry
as anarray
(e.g.,['src/index.js']
) - ✔️
entry
as anobject
(e.g.,{ main: 'src/index.js' }
) - ✔️
entry
middlewares (e.g.,['src/index.js', 'webpack-hot-middleware/client']
) - ✔️ Dynamic
output.filename
(e.g.,'[name].js'
) - ✔️ Named
output.filename
(e.g.,'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
debugLogs: boolean; // enables debug logs
keepSource: boolean; // emits the original source files along with the compiled ones
preventSourceMaps: boolean; // prevents source maps from being generated
silent: boolean; // disables all logs, but not errors thrown (overrides debug flags)
}
new BytenodeWebpackPlugin({
compileAsModule: true,
compileForElectron: false,
debugLifecycle: false,
debugLogs: false,
keepSource: false,
preventSourceMaps: true,
silent: false,
})
herberttn |
Jeff Robbins |