# webpack-serve

> A CLI for webpack-plugin-serve, providing a premier webpack development server

Latest version **4.0.0** (published 2021-04-01) · MIT license · 0 weekly downloads

## Install

```sh
npm install webpack-serve
pnpm add webpack-serve
yarn add webpack-serve
bun add webpack-serve
```

Provides the command `webpack-serve`.

## Health

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

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

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 4.0.0 |
| Published | 2021-04-01 |
| First published | 2016-04-06 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | separate (@types/webpack-serve) |
| Module format | CommonJS |
| Node | >= 8.0.0 < 9.0.0 \|\| >= 10.0.0 < 10.14.0 \|\| >= 10.15.0 |
| Dependencies | 10 |
| Unpacked size | 37.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 51 |
| Author | Andrew Powell |
| Maintainers | shellscape |
| Keywords | development, devserver, serve, server, webpack |

## Links

- npm: https://www.npmjs.com/package/webpack-serve
- Repository: https://github.com/shellscape/webpack-serve
- Issues: https://github.com/shellscape/webpack-serve/issues
- npm.io page: https://npm.io/package/webpack-serve

## Dependencies (10)

- [chalk](https://npm.io/package/chalk.md) ^4.1.0
- [rechoir](https://npm.io/package/rechoir.md) ^0.7.0
- [pkg-conf](https://npm.io/package/pkg-conf.md) ^3.0.0
- [decamelize](https://npm.io/package/decamelize.md) ^5.0.0
- [object-path](https://npm.io/package/object-path.md) ^0.11.5
- [import-local](https://npm.io/package/import-local.md) ^3.0.1
- [is-plain-obj](https://npm.io/package/is-plain-obj.md) ^3.0.0
- [yargs-parser](https://npm.io/package/yargs-parser.md) ^20.2.7
- [v8-compile-cache](https://npm.io/package/v8-compile-cache.md) ^2.0.2
- [webpack-plugin-serve](https://npm.io/package/webpack-plugin-serve.md) ^1.4.1

## Alternatives

- [raw-loader](https://npm.io/package/raw-loader.md) — 4.3M weekly downloads
- [plop](https://npm.io/package/plop.md) — 1.4M weekly downloads
- [webpack-deadcode-plugin](https://npm.io/package/webpack-deadcode-plugin.md) — 80.3K weekly downloads
- [@storybook/preact-vite](https://npm.io/package/@storybook/preact-vite.md) — 54.2K weekly downloads
- [vite-plugin-transform](https://npm.io/package/vite-plugin-transform.md) — 2.4K weekly downloads

## Recent versions

- 4.0.0 (latest) — 2021-04-01
- 3.0.0-beta.1 (beta) — 2019-03-13
- 1.0.0-beta.1 (next) — 2018-02-12
- 3.2.0 — 2019-09-19
- 3.1.1 — 2019-07-21
- 3.1.0 — 2019-04-08
- 3.0.0 — 2019-04-01
- 3.0.0-beta.3 — 2019-03-14
- 3.0.0-beta.2 — 2019-03-14
- 2.0.3 — 2018-11-20
- 2.0.2 — 2018-07-09
- 2.0.1 — 2018-07-09
- 2.0.0 — 2018-07-09
- 2.0.0-beta.6 — 2018-07-07
- 2.0.0-beta.5 — 2018-07-06
- … 20 more at https://npm.io/package/webpack-serve/versions

## README

[tests]: 	https://img.shields.io/circleci/project/github/shellscape/webpack-serve.svg
[tests-url]: https://circleci.com/gh/shellscape/webpack-serve

[cover]: https://codecov.io/gh/shellscape/webpack-serve/branch/master/graph/badge.svg
[cover-url]: https://codecov.io/gh/shellscape/webpack-serve

[size]: https://packagephobia.now.sh/badge?p=webpack-serve
[size-url]: https://packagephobia.now.sh/result?p=webpack-serve

[https]: https://nodejs.org/api/https.html#https_https_createserver_options_requestlistener
[http2]: https://nodejs.org/api/http2.html#http2_http2_createserver_options_onrequesthandler
[http2tls]: https://nodejs.org/api/http2.html#http2_http2_createsecureserver_options_onrequesthandler

<div align="center">
	<img width="256" src="https://raw.githubusercontent.com/shellscape/webpack-serve/master/assets/serve.svg?sanitize=true" alt="webpack-serve"><br/><br/>
</div>

[![tests][tests]][tests-url]
[![cover][cover]][cover-url]
[![size][size]][size-url]

# webpack-serve

A CLI for [`webpack-plugin-serve`](https://github.com/shellscape/webpack-plugin-serve) - A Webpack development server in a plugin.

_(While using a CLI such as webpack-serve is convenient, we recommend using [`webpack-plugin-serve`](https://github.com/shellscape/webpack-plugin-serve) directly in your webpack config, with [`webpack-nano`](https://github.com/shellscape/webpack-nano), instead.)_

<a href="https://www.patreon.com/shellscape">
  <img src="https://c5.patreon.com/external/logo/become_a_patron_button@2x.png" width="160">
</a>

_Please consider donating if you find this project useful._

## Requirements

`webpack-serve` is an [evergreen 🌲](./.github/FAQ.md#what-does-evergreen-mean) module.

This module requires an [Active LTS](https://github.com/nodejs/Release) Node version (v8.0.0+ or v10.0.0+). The client scripts in this module require [browsers which support `async/await`](https://caniuse.com/#feat=async-functions). Users may also choose to compile the client script via an appropriately configured [Babel](https://babeljs.io/) webpack loader for use in older browsers.

## Feature Parity

Since this CLI leverages `webpack-plugin-serve`, the same feature parity information applies. Please see the [`webpack-plugin-serve` Feature Comparison](https://github.com/shellscape/webpack-plugin-serve/blob/HEAD/.github/FEATURES.md) for more information.

## Install

Using npm:

```console
npm install webpack-serve --save-dev
```

## Usage

```console
A CLI for webpack-plugin-serve, providing a premier webpack development server

Usage
  $ webpack-serve [...options]

Options
  --all               Apply webpack-plugin-serve to all compilers in the config
  --client.address    Overrides the WebSocket address in the client
  --client.retry      Instructs the client to attempt to reconnect all WebSockets when interrupted
  --client.silent     Instructs the client not to log anything to the console.
  --compress          Enables compression middleware which serves files with GZip compression.
  --config            A path to a webpack config file
  --config.{name}     A path to a webpack config file, and the config name to run
  --help              Displays this message
  --history-fallback  Enables History API Fallback
  --hmr               Enables Hot Module Replacement. On by default
  --host              Sets the host the server should listen from
  --http2             Instructs the server to enable HTTP2
  --live-reload       Instructs the client to perform a full page reload after each build
  --no-watch          Does not apply \`watch: true\` to the config, allowing for greater customization
  --open              Opens the default browser to the set host and port
  --port              Sets the port on which the server should listen
  --progress          Shows build progress in the client
  --silent            Instruct the CLI to produce no console output
  --static            Sets the directory from which static files will be served
  --status            Shows build status (errors, warnings) in the client
  --version           Displays webpack-nano and webpack versions
  --wait-for-build    Instructs the server to halt middleware processing until the current build is done.

Examples
  $ webpack-serve
  $ webpack-serve --help
  $ webpack-serve --config webpack.config.js
  $ webpack-serve --config.serve webpack.config.js
```

## Flags

Please reference the [`webpack-plugin-serve` Options](https://github.com/shellscape/webpack-plugin-serve#options) for information and use. Most options are analogous to the flags listed above.

#### `--no-watch`

By default, the CLI will apply `watch: true` to the first config in the targeted webpack config file. To customize watching or `watchOptions`, please use this flag and customize the config(s) accordingly.

## package.json Options

For convenience, `webpack-plugin-serve` options can also be defined in a `package.json` file. This CLI will look for a `serve` key in the nearest `package.json` beginning in the directory containing the specified `webpack.config.js`, up to the current working directory. Please reference the [`webpack-plugin-serve` Options](https://github.com/shellscape/webpack-plugin-serve#options) for information and use.

For Example:

```json
{
	"name": "some-package",
	"version": "1.0.0",
	"serve": {
    "host": "10.10.10.1"
  }
}
```

## Advanced Options

For options which require providing functions or complex objects like `Promises` which cannot be represented by JSON, nor on the command line, please use [`webpack-plugin-serve`](https://github.com/shellscape/webpack-plugin-serve) directly in your webpack config, along with [`webpack-nano`](https://github.com/shellscape/webpack-nano).

## Meta

[CONTRIBUTING](./.github/CONTRIBUTING.md)

[LICENSE (Mozilla Public License)](./LICENSE)

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