# @neutrinojs/dev-server

> Neutrino middleware for starting a webpack-dev-server

Latest version **9.5.0** (published 2020-12-23) · MPL-2.0 license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install @neutrinojs/dev-server
pnpm add @neutrinojs/dev-server
yarn add @neutrinojs/dev-server
bun add @neutrinojs/dev-server
```

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 9.5.0 |
| Published | 2020-12-23 |
| First published | 2017-12-07 |
| Weekly downloads | 0 |
| License | MPL-2.0 |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=10 |
| Dependencies | 0 |
| Unpacked size | 20.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 3905 |
| Author | Constantine Genchevsky |
| Maintainers | edmorley, helfi92, timkelty, eliperelman |
| Keywords | neutrino, neutrino-middleware, webpack, dev, server, hmr, hot module replacement |

## Links

- npm: https://www.npmjs.com/package/@neutrinojs/dev-server
- Repository: https://github.com/neutrinojs/neutrino
- Homepage: https://neutrinojs.org
- Issues: https://github.com/neutrinojs/neutrino/issues
- npm.io page: https://npm.io/package/@neutrinojs/dev-server

## Alternatives

- [@sindresorhus/slugify](https://npm.io/package/@sindresorhus/slugify.md) — 3.7M weekly downloads
- [solid-js](https://npm.io/package/solid-js.md) — 2.7M weekly downloads
- [expo-glass-effect](https://npm.io/package/expo-glass-effect.md) — 2.5M weekly downloads
- [nanoassert](https://npm.io/package/nanoassert.md) — 780.8K weekly downloads
- [@ffmpeg/ffmpeg](https://npm.io/package/@ffmpeg/ffmpeg.md) — 529.5K weekly downloads

## Recent versions

- 9.5.0 (latest) — 2020-12-23
- 9.4.0 — 2020-08-28
- 9.3.0 — 2020-07-16
- 9.2.0 — 2020-06-07
- 9.1.0 — 2020-01-28
- 9.0.0 — 2019-12-13
- 9.0.0-rc.5 — 2019-11-13
- 9.0.0-rc.4 — 2019-10-06
- 9.0.0-rc.3 — 2019-05-08
- 9.0.0-rc.2 — 2019-05-08
- 9.0.0-rc.1 — 2019-04-16
- 9.0.0-rc.0 — 2018-11-26
- 9.0.0-beta.1 — 2018-10-23
- 9.0.0-beta.0 — 2018-09-20
- 8.3.0 — 2018-06-27
- … 37 more at https://npm.io/package/@neutrinojs/dev-server/versions

## README

# Neutrino Dev Server Middleware

`@neutrinojs/dev-server` is Neutrino middleware for starting a webpack Dev
Server for fast development cycles.

[![NPM version][npm-image]][npm-url] [![NPM downloads][npm-downloads]][npm-url]

## Requirements

- Node.js 10+
- Yarn v1.2.1+, or npm v5.4+
- Neutrino 9
- webpack 4
- webpack-dev-server 3

## Installation

`@neutrinojs/dev-server` can be installed via the Yarn or npm clients.

#### Yarn

```bash
❯ yarn add --dev @neutrinojs/dev-server
```

#### npm

```bash
❯ npm install --save-dev @neutrinojs/dev-server
```

## Usage

`@neutrinojs/dev-server` can be consumed from the Neutrino API, middleware, or
presets. Require this package and plug it into Neutrino:

```js
const devServer = require('@neutrinojs/dev-server');

// Usage with default options
neutrino.use(devServer());

// Usage with custom options (default options are shown)
neutrino.use(
  devServer({
    port: 5000,
    hot: true,
    // Redirect 404s to index.html, so that apps that use the HTML 5 History API work.
    historyApiFallback: true,
    // Only display compile duration and errors/warnings, to reduce noise when rebuilding.
    stats: {
      all: false,
      errors: true,
      timings: true,
      warnings: true,
    },
  }),
);
```

```js
// Using in .neutrinorc.js
const devServer = require('@neutrinojs/dev-server');

// Usage with default options
module.exports = {
  use: [devServer()],
};

// Usage with custom options (default options are shown)
module.exports = {
  use: [
    devServer({
      port: 5000,
      hot: true,
      // Redirect 404s to index.html, so that apps that use the HTML 5 History API work.
      historyApiFallback: true,
      // Only display compile duration and errors/warnings, to reduce noise when rebuilding.
      stats: {
        all: false,
        errors: true,
        timings: true,
        warnings: true,
      },
    }),
  ],
};
```

By default this middleware will start a development server with Hot Module
Replacement support on `http://localhost:5000`. To enable HMR with your
application, read the documentation of corresponding Neutrino preset or
middleware.

## Middleware options

`@neutrinojs/dev-server` optionally accepts an object with several options to
override the default behavior. This object, as seen used above, can accept any
[property that is accepted by webpack Dev Server](https://webpack.js.org/configuration/dev-server/).

## Contributing

This middleware is part of the
[neutrino](https://github.com/neutrinojs/neutrino) repository, a monorepo
containing all resources for developing Neutrino and its core presets and
middleware. Follow the
[contributing guide](https://neutrinojs.org/contributing/) for details.

[npm-image]: https://img.shields.io/npm/v/@neutrinojs/dev-server.svg
[npm-downloads]: https://img.shields.io/npm/dt/@neutrinojs/dev-server.svg
[npm-url]: https://www.npmjs.com/package/@neutrinojs/dev-server

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