An open API service indexing awesome lists of open source software.

https://github.com/svrxjs/svrx-plugin-webpack

svrx plugin for webpack
https://github.com/svrxjs/svrx-plugin-webpack

svrx svrx-plugin webpack

Last synced: about 2 months ago
JSON representation

svrx plugin for webpack

Awesome Lists containing this project

README

          

# svrx-plugin-webpack

[![svrx](https://img.shields.io/badge/svrx-plugin-%23ff69b4?style=flat-square)](https://svrx.io/)
[![npm](https://img.shields.io/npm/v/svrx-plugin-webpack.svg?style=flat-square)](https://www.npmjs.com/package/svrx-plugin-webpack)

[svrx](https://github.com/x-orpheus/svrx) plugin for [webpack](https://webpack.js.org/)

## Usage

> Please make sure that you have installed [svrx](https://svrx.io/) already.

### Via CLI

```bash
svrx -p "webpack"
```

### Via API

```js
const svrx = require('@svrx/svrx');

svrx({ plugins: ['webpack'] }).start();
```

**with options**

```js

svrx({
plugins: [{
name: 'webpack',
options: {
hot: false
}
}]
}).start();
```

## Options

#### **config \[String|Object]:**

webpack config file or object, default is `$root/webpack.config.js` (`$root` means `options.root`)

#### **hot \[Boolean]:**

Enable webpack Hot Module Replacement feature, default is `true`

#### **client \[Object]:**

options can be passed to the client by adding querystring parameters to the path in the webpack config

see [webpack-hot-middleware#client](https://github.com/webpack-contrib/webpack-hot-middleware#client) for detail

for example, options `{timeout: 3000}` will been encode as `webpack-hot-middleware/client?timeout=3000`

#### **path \[String]:**

The path which the middleware will serve the event stream on, default is `/__webpack_hmr`

## Example

- [simple](https://github.com/x-orpheus/svrx-plugin-webpack/tree/master/example/simple)
- [react-loader](https://github.com/x-orpheus/svrx-plugin-webpack/tree/master/example/react-loader)
- [integrated-with-create-react-app](https://github.com/x-orpheus/svrx-plugin-webpack/tree/master/example/create-react-app)

## License

MIT