# html-webpack-harddisk-plugin

> Write html files to hard disk even when using the webpack dev server or middleware

Latest version **2.0.0** (published 2021-02-15) · MIT license · 0 weekly downloads

## Install

```sh
npm install html-webpack-harddisk-plugin
pnpm add html-webpack-harddisk-plugin
yarn add html-webpack-harddisk-plugin
bun add html-webpack-harddisk-plugin
```

## 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.0 |
| Published | 2021-02-15 |
| First published | 2016-04-18 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Node | >=10.13 |
| Dependencies | 0 |
| Unpacked size | 8.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 224 |
| Author | Jan Nicklas |
| Maintainers | jantimon |
| Keywords | webpack, plugin, html-webpack-plugin, disk, template |

## Links

- npm: https://www.npmjs.com/package/html-webpack-harddisk-plugin
- Repository: https://github.com/jantimon/html-webpack-harddisk-plugin
- Issues: https://github.com/jantimon/html-webpack-harddisk-plugin/issues
- npm.io page: https://npm.io/package/html-webpack-harddisk-plugin

## Alternatives

- [@tsparticles/shape-image](https://npm.io/package/@tsparticles/shape-image.md) — 303.7K weekly downloads
- [@tsparticles/shape-line](https://npm.io/package/@tsparticles/shape-line.md) — 233.7K weekly downloads
- [stringify-attributes](https://npm.io/package/stringify-attributes.md) — 58.6K weekly downloads
- [mobile-drag-drop](https://npm.io/package/mobile-drag-drop.md) — 46.3K weekly downloads
- [@comunica/actor-rdf-parse-html](https://npm.io/package/@comunica/actor-rdf-parse-html.md) — 29.2K weekly downloads

## Recent versions

- 2.0.0 (latest) — 2021-02-15
- 1.0.2 — 2020-06-16
- 1.0.1 — 2018-10-19
- 1.0.0 — 2018-10-15
- 0.2.0 — 2018-03-09
- 0.1.0 — 2017-02-13
- 0.0.2 — 2016-04-19
- 0.0.1 — 2016-04-18

## README

Harddisk extension for the HTML Webpack Plugin
========================================
[![npm version](https://badge.fury.io/js/html-webpack-harddisk-plugin.svg)](http://badge.fury.io/js/html-webpack-harddisk-plugin) [![Dependency Status](https://david-dm.org/jantimon/html-webpack-harddisk-plugin.svg)](https://david-dm.org/jantimon/html-webpack-harddisk-plugin) [![Build Status](https://github.com/jantimon/html-webpack-harddisk-plugin/workflows/CI/badge.svg)](https://github.com/jantimon/html-webpack-harddisk-plugin/actions/) [![js-semistandard-style](https://img.shields.io/badge/code%20style-semistandard-brightgreen.svg?style=flat-square)](https://github.com/Flet/semistandard)

Enhances [html-webpack-plugin](https://github.com/jantimon/html-webpack-plugin)
functionality by adding the `{alwaysWriteToDisk: true|false}` option.

This is an extension plugin for the [webpack](http://webpack.github.io) plugin [html-webpack-plugin](https://github.com/jantimon/html-webpack-plugin) - a plugin that simplifies the creation of HTML files to serve your webpack bundles.

Installation
------------
You must be running webpack on node 10.x or higher

Install the plugin with npm:
```shell
$ npm install --save-dev html-webpack-harddisk-plugin
```

Basic Usage
-----------
Require the plugin in your webpack config:

```javascript
const HtmlWebpackHarddiskPlugin = require('html-webpack-harddisk-plugin');
```

Add the plugin to your webpack config as follows:

```javascript
plugins: [
  new HtmlWebpackPlugin(),
  new HtmlWebpackHarddiskPlugin()
]  
```
The above configuration will actually do nothing due to the configuration defaults.

As soon as you now set `alwaysWriteToDisk` to `true` the generated output of the HtmlWebpackPlugin will
always be written to disk. This is very useful if you want to pick up the output with another middleware.
```javascript
plugins: [
  new HtmlWebpackPlugin({
		alwaysWriteToDisk: true
	}),
  new HtmlWebpackHarddiskPlugin()
]  
```

Even if you generate multiple files make sure that you add the HtmlWebpackHarddiskPlugin **only once**:

```javascript
plugins: [
  new HtmlWebpackPlugin({
		alwaysWriteToDisk: true
	}),
  new HtmlWebpackPlugin({
		alwaysWriteToDisk: true,
		filename: 'demo.html'
	}),
  new HtmlWebpackPlugin({
		alwaysWriteToDisk: false,
		filename: 'test.html'
	}),
  new HtmlWebpackHarddiskPlugin()
]  
```

If you need to set the output path explicitly (for example when using with webpack-dev-server middleware) then pass in the `outputPath` option:

```js
new HtmlWebpackHarddiskPlugin({
  outputPath: path.resolve(__dirname, 'views')
})
```

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