Code Monkey home page Code Monkey logo

bytenode-webpack-plugin's Introduction

@herberttn/bytenode-webpack-plugin

ci coveralls npm license

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
    • ✔️ v4
    • ❔ v5
    • ✔️ entry as a string (e.g., 'src/index.js')
    • ✔️ entry as an array (e.g., ['src/index.js'])
    • ✔️ entry as an object (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')

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 {
  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)
}

Default options

new BytenodeWebpackPlugin({
  compileAsModule: true,
  compileForElectron: false,
  debugLifecycle: false,
  debugLogs: false,
  keepSource: false,
  preventSourceMaps: true,
  silent: false,
})

Contributors

herberttn
herberttn
jjeff
Jeff Robbins

bytenode-webpack-plugin's People

Contributors

herberttn avatar semantic-release-bot avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.