# @dopry/bytenode-webpack-plugin

> Compile JavaScript into bytecode using bytenode

Latest version **2.0.0-next.1** (published 2022-09-22) · MIT license · 0 weekly downloads

## Install

```sh
npm install @dopry/bytenode-webpack-plugin
pnpm add @dopry/bytenode-webpack-plugin
yarn add @dopry/bytenode-webpack-plugin
bun add @dopry/bytenode-webpack-plugin
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.0.0-next.1 |
| Published | 2022-09-22 |
| First published | 2022-09-22 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 18.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | herberttn |
| Maintainers | dopry |
| Keywords | bytecode, bytenode, compile, javascript, js, node, nodejs, plugin, webpack |

## Links

- npm: https://www.npmjs.com/package/@dopry/bytenode-webpack-plugin
- Repository: https://github.com/dopry/bytenode-webpack-plugin
- Homepage: https://github.com/herberttn/bytenode-webpack-plugin
- Issues: https://github.com/herberttn/bytenode-webpack-plugin/issues
- npm.io page: https://npm.io/package/@dopry/bytenode-webpack-plugin

## Dependencies (2)

- [slash](https://npm.io/package/slash.md) 3.0.0
- [bytenode](https://npm.io/package/bytenode.md) 1.3.4

## Alternatives

- [@mapbox/jsonlint-lines-primitives](https://npm.io/package/@mapbox/jsonlint-lines-primitives.md) — 5.3M weekly downloads
- [reftools](https://npm.io/package/reftools.md) — 3.5M weekly downloads
- [@hey-api/openapi-ts](https://npm.io/package/@hey-api/openapi-ts.md) — 3.5M weekly downloads
- [@mapbox/geojson-rewind](https://npm.io/package/@mapbox/geojson-rewind.md) — 2.4M weekly downloads
- [turbo-stream](https://npm.io/package/turbo-stream.md) — 1.7M weekly downloads

## Recent versions

- 2.0.0-next.1 (latest) — 2022-09-22

## README

@herberttn/bytenode-webpack-plugin
---

[![ci][badge-workflow-ci]][badge-workflow-ci-link]
[![coveralls][badge-coveralls]][badge-coveralls-link]
[![npm][badge-npm]][badge-npm-link]
[![license][badge-license]][badge-license-link]

[badge-coveralls]: https://img.shields.io/coveralls/github/herberttn/bytenode-webpack-plugin?logo=coveralls&style=flat-square
[badge-coveralls-link]: https://coveralls.io/github/herberttn/bytenode-webpack-plugin
[badge-license]: https://img.shields.io/github/license/herberttn/bytenode-webpack-plugin?style=flat-square
[badge-license-link]: LICENSE
[badge-npm]: https://img.shields.io/npm/v/@herberttn/bytenode-webpack-plugin?logo=npm&style=flat-square
[badge-npm-link]: https://www.npmjs.com/package/@herberttn/bytenode-webpack-plugin
[badge-workflow-ci]: https://img.shields.io/github/workflow/status/herberttn/bytenode-webpack-plugin/ci?label=ci&logo=github&style=flat-square
[badge-workflow-ci-link]: https://github.com/herberttn/bytenode-webpack-plugin/actions/workflows/ci.yml

Compile JavaScript into bytecode using [`bytenode`][link-to-bytenode].  
Inspired by [`bytenode-webpack-plugin`][link-to-bytenode-webpack-plugin].

[link-to-bytenode-webpack-plugin]: https://www.npmjs.com/package/bytenode-webpack-plugin
[link-to-bytenode]: https://www.npmjs.com/package/bytenode

### Install
```shell
npm install --save @herberttn/bytenode-webpack-plugin
```

### Supports
- [`electron-forge`][link-to-electron-forge]
  - :heavy_check_mark:  Default configuration
- [`webpack`][link-to-webpack]
  - :heavy_check_mark:  v5
  - :heavy_check_mark:   `entry` as a `string` (e.g., `'src/index.js'`)
  - :heavy_check_mark:   `entry` as an `array` (e.g., `['src/index.js']`)
  - :heavy_check_mark:   `entry` as an `object` (e.g., `{ main: 'src/index.js' }`)
  - :heavy_check_mark:   `entry` middlewares (e.g., `['src/index.js', 'webpack-hot-middleware/client']`)
  - :heavy_check_mark:   Dynamic `output.filename` (e.g., `'[name].js'`)
  - :heavy_check_mark:   Named `output.filename` (e.g., `'index.js'`)

[link-to-electron-forge]: https://www.npmjs.com/package/electron-forge
[link-to-webpack]: https://www.npmjs.com/package/webpack

### Usage
```javascript
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
```typescript
interface Options {
  compileForElectron: boolean; // compiles for electron instead of plain node
}
```

#### Default options
```typescript
new BytenodeWebpackPlugin({
  compileForElectron: false,
})
```

### Contributors

<table>
  <tr>
    <td align="center">
      <a href="https://github.com/herberttn">
        <img src="https://avatars.githubusercontent.com/u/5903869?v=4" width="120;" alt="herberttn"/>
        <br />
        <sub><b>herberttn</b></sub>
      </a>
    </td>
    <td align="center">
      <a href="https://github.com/jjeff">
        <img src="https://avatars.githubusercontent.com/u/321284?v=4" width="120;" alt="jjeff"/>
        <br />
        <sub><b>Jeff Robbins</b></sub>
      </a>
    </td>
    <td align="center">
      <a href="https://github.com/dopry">
        <img src="https://avatars.githubusercontent.com/u/387640?v=4" width="120;" alt="dopry"/>
        <br />
        <sub><b>Darrel O'Pry</b></sub>
      </a>
    </td>
  </tr>
</table>

---
_Source: https://npm.io/package/@dopry/bytenode-webpack-plugin · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
