1.1.2 • Published 3 years ago

electron-bytenode-webpack-plugin v1.1.2

Weekly downloads
-
License
ISC
Repository
-
Last release
3 years ago

Bytenode Webpack Plugin

Inspired by bytenode-webpack-plugin.

A webpack plugin that simplifies compiling your JS source code into V8 bytecode using Bytenode.

Essentially converts raw .js files in your output into compiled .jsc files.

Install

  npm install --save-dev electron-bytenode-webpack-plugin
  yarn add --dev electron-bytenode-webpack-plugin

Usage

// webpack.config.js

const BytenodeWebpackPlugin = require('electron-bytenode-webpack-plugin')

module.exports = {
  entry: 'index.js',
  output: {
    path: __dirname + '/dist',
    filename: 'index_bundle.js'
  },
  plugins: [
    new BytenodeWebpackPlugin()
  ]
}

Options

NameTypeDefaultDescription
compileAsModulebooleantrueAllow the resulting .jsc file to be used as a module or not.
keepSourcebooleanfalseKeep JS source files in output or not.

To use options:

// webpack.config.js

const BytenodeWebpackPlugin = require('electron-bytenode-webpack-plugin')

module.exports = {
  entry: 'index.js',
  output: {
    path: __dirname + '/dist',
    filename: 'index_bundle.js'
  },
  plugins: [
    new BytenodeWebpackPlugin({
        compileAsModule: false,
        keepSource: true
    })
  ]
}