# webpack-devserver-url-writer

> Webpack plugin to write devserver's URL into a file.

Latest version **0.1.0** (published 2019-01-25) · MIT license · 0 weekly downloads

## Install

```sh
npm install webpack-devserver-url-writer
pnpm add webpack-devserver-url-writer
yarn add webpack-devserver-url-writer
bun add webpack-devserver-url-writer
```

## Health

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

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.0 |
| Published | 2019-01-25 |
| First published | 2019-01-25 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 4.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Alex Oleshkevich |
| Maintainers | alex.oleshkevich |
| Keywords | webpack, dev server, hot, dev server url |

## Links

- npm: https://www.npmjs.com/package/webpack-devserver-url-writer
- Homepage: https://github.com/alex-oleshkevich/webpack-devserver-url-writer
- Issues: https://github.com/alex-oleshkevich/webpack-devserver-url-writer/issues
- npm.io page: https://npm.io/package/webpack-devserver-url-writer

## Alternatives

- [base64url](https://npm.io/package/base64url.md) — 6.1M weekly downloads
- [get-installed-path](https://npm.io/package/get-installed-path.md) — 502.9K weekly downloads
- [@uppy/url](https://npm.io/package/@uppy/url.md) — 185.8K weekly downloads
- [@d3fc/d3fc-shape](https://npm.io/package/@d3fc/d3fc-shape.md) — 16.2K weekly downloads
- [localizer](https://npm.io/package/localizer.md) — 226 weekly downloads

## Recent versions

- 0.1.0 (latest) — 2019-01-25

## README

# Webpack's dev server URL writer
**DevServerURLWriter** writes the full URL used by dev server into a file when webpack starts dev server.  
The plugin works only in watch mode and when [`devServer.hot`](https://webpack.js.org/configuration/dev-server/#devserver-hot) option is enabled. 

It is very useful in case when you render HTML using backend framework (like Django or Laravel), 
your frontend is served via webpack's dev server and you need somehow to connect them. 


## Installation

```bash
yarn add webpack-devserver-url-writer
```

## Setup
Add plugin to your webpack config:

```js
// webpack.config.js

const DevServerURLWriter = require('webpack-devserver-url-writer');

module.exports = {
    plugins: [
        new DevServerURLWriter(options),
        // other plugins
    ],
}
```

## Configuration

Plugin accepts the following options:

| Option | Default | Description |
|--------|---------|-------------|
| outputFile | 'hot.lock' | An output file path. |
| relativeToOutput | true| when true, `outputFile` is relative to `output.path` configuration option. |


### Example:
```js
new DevServerURLWriter({
    outputFile: '/tmp/out.lock',
    relativeToOutput: false,
});
```

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