@herberttn/bytenode-webpack-plugin
Compile JavaScript into bytecode using bytenode
.
Inspired by bytenode-webpack-plugin
.
Install
npm install --save @herberttn/bytenode-webpack-plugin
Supports
-
electron-forge
✔️ Default configuration
-
webpack
✔️ 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']
)✔️ Dynamicoutput.filename
(e.g.,'[name].js'
)✔️ Namedoutput.filename
(e.g.,'index.js'
)
Usage
import { BytenodeWebpackPlugin } from '@herberttn/bytenode-webpack-plugin';
// webpack options
module.exports = {
// ...
plugins: [
// using all defaults
new BytenodeWebpackPlugin(),
// overriding an option
new BytenodeWebpackPlugin({
compileForElectron: true,
}),
],
};
Options
interface Options {
compileForElectron: boolean; // compiles for electron instead of plain node
}
Default options
new BytenodeWebpackPlugin({
compileForElectron: false,
})
Contributors
herberttn |
Jeff Robbins |
Darrel O'Pry |