# @reactway/webpack-builder

> A tool to create webpack config easier using plugins.

Latest version **2.0.4** (published 2020-02-20) · MIT license · 0 weekly downloads

## Install

```sh
npm install @reactway/webpack-builder
pnpm add @reactway/webpack-builder
yarn add @reactway/webpack-builder
bun add @reactway/webpack-builder
```

## 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.4 |
| Published | 2020-02-20 |
| First published | 2019-03-18 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 4 |
| Unpacked size | 12.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | martynas-zilinskas, quatrodev, reactway-dev |
| Keywords | webpack, webpack-builder, config, plugins, tool, reactway |

## Links

- npm: https://www.npmjs.com/package/@reactway/webpack-builder
- Repository: https://github.com/reactway/webpack-builder
- Homepage: https://github.com/reactway/webpack-builder#readme
- Issues: https://github.com/reactway/webpack-builder/issues
- npm.io page: https://npm.io/package/@reactway/webpack-builder

## Dependencies (4)

- [tslib](https://npm.io/package/tslib.md) ^1.10.0
- [upath](https://npm.io/package/upath.md) ^1.2.0
- [webpack](https://npm.io/package/webpack.md) ^4.41.2
- [@types/webpack](https://npm.io/package/@types/webpack.md) ^4.41.0

## Alternatives

- [jsforce](https://npm.io/package/jsforce.md) — 851.2K weekly downloads
- [react-native-qrcode-svg](https://npm.io/package/react-native-qrcode-svg.md) — 693.5K weekly downloads
- [@salesforce/plugin-data](https://npm.io/package/@salesforce/plugin-data.md) — 394.9K weekly downloads
- [@backstage/plugin-search-common](https://npm.io/package/@backstage/plugin-search-common.md) — 308.5K weekly downloads
- [@chain-registry/types](https://npm.io/package/@chain-registry/types.md) — 38.4K weekly downloads

## Recent versions

- 2.0.4 (latest) — 2020-02-20
- 0.0.0-canary.44f7dcc (canary) — 2020-02-20
- 1.0.0-alpha.21 (alpha) — 2019-07-29
- 0.0.0-canary.90d60d5 — 2020-02-11
- 0.0.0-canary.d01fbd7 — 2020-02-11
- 0.0.0-canary.bef19f2 — 2019-12-19
- 0.0.0-canary.5045c0e — 2019-12-19
- 0.0.0-canary.15f66be — 2019-12-18
- 0.0.0-canary.a78f22e — 2019-12-18
- 0.0.0-canary.7fa97ee — 2019-11-25
- 2.0.2 — 2019-11-20
- 0.0.0-canary.4c0f806 — 2019-11-19
- 2.0.1 — 2019-10-02
- 0.0.0-canary.aaf1d06 — 2019-10-02
- 2.0.0 — 2019-08-22
- … 23 more at https://npm.io/package/@reactway/webpack-builder/versions

## README

# @reactway/webpack-builder

A tool to create webpack config easier using @reactway plugins.

## Getting started

```sh
$ npm i @reactway/webpack-builder
```

To create a webpack config with builder first you have to create `webpack.config.js` and add import to it. You must define **workspace directory** and base configuration with **`entry`** and **`output`** fields to able use.

## Example config

```js
const webpackBuilder = require("@reactway/webpack-builder");

module.exports = new webpackBuilder.Builder(__dirname, {
    entry: "./src/app.js",
    output: {
        path: "./dist",
        filename: "[name].bundle.js"
    }
}).toConfig();
```

## API

`use()` - Insert plugin to config. Possible to use more than one plugin.

```js
const webpackBuilder = require("@reactway/webpack-builder");
const examplePlugin = require("@reactway/webpack-builder-example-plugin");
const examplePluginOther = require("@reactway/webpack-builder-example-plugin-other");

module.exports = new webpackBuilder.Builder(__dirname, {
    entry: "./src/app.js",
    output: {
        path: "./dist",
        filename: "[name].bundle.js"
    }
})
    .use(examplePlugin)
    .use(examplePluginOther)
    .toConfig();
```

---

`update()` - Update webpack config fields.

```js
const webpackBuilder = require("@reactway/webpack-builder");

module.exports = new webpackBuilder.Builder(__dirname, {
    entry: "./src/app.js",
    output: {
        path: "./dist",
        filename: "[name].bundle.js"
    }
})
    .update(webpack => {
        webpack.mode = "production";
        return webpack;
    })
    .toConfig();
```

---

`toConfig()` - Returns `webpack` config to use. **Required to generate configuration.**

## Documentation

WIP

## License

Released under the [MIT license](LICENSE).

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