{"_id":"@ndelangen/html-webpack-harddisk-plugin","_rev":"471555","name":"@ndelangen/html-webpack-harddisk-plugin","description":"Write html files to hard disk even when using the webpack dev server or middleware","dist-tags":{"latest":"0.2.0"},"maintainers":[{"name":"ndelangen","email":""}],"time":{"modified":"2021-08-05T08:20:27.000Z","created":"2018-10-11T18:43:18.089Z","0.2.0":"2018-10-11T18:43:18.089Z"},"users":{},"author":{"name":"Jan Nicklas","email":"j.nicklas@me.com","url":"https://github.com/jantimon"},"repository":{"type":"git","url":"git+https://github.com/jantimon/html-webpack-harddisk-plugin.git"},"versions":{"0.2.0":{"name":"@ndelangen/html-webpack-harddisk-plugin","version":"0.2.0","description":"Write html files to hard disk even when using the webpack dev server or middleware","main":"index.js","scripts":{"prepublish":"npm run test","pretest":"semistandard","test":"jasmine","debug":"node-debug jasmine"},"repository":{"type":"git","url":"git+https://github.com/jantimon/html-webpack-harddisk-plugin.git"},"keywords":["webpack","plugin","html-webpack-plugin","disk","template"],"author":{"name":"Jan Nicklas","email":"j.nicklas@me.com","url":"https://github.com/jantimon"},"license":"MIT","bugs":{"url":"https://github.com/jantimon/html-webpack-harddisk-plugin/issues"},"homepage":"https://github.com/jantimon/html-webpack-harddisk-plugin","devDependencies":{"@types/webpack":"^4.4.12","html-webpack-plugin":"^4.0.0-beta.1","jasmine":"^2.4.1","memory-fs":"^0.3.0","rimraf":"^2.5.2","semistandard":"^7.0.5","webpack":"^4.20.2"},"peerDependencies":{"html-webpack-plugin":"^2.0.0 || ^3.0.0","webpack":"^1.0.0 || ^2.0.0 || ^3.0.0 || ^4.0.0"},"dependencies":{"mkdirp":"^0.5.1"},"gitHead":"be92beaf16dec888c78f204504bdf9a405fc8b90","_id":"@ndelangen/html-webpack-harddisk-plugin@0.2.0","_npmVersion":"5.6.0","_nodeVersion":"8.11.3","_npmUser":{"name":"ndelangen","email":"ndelangen@me.com"},"dist":{"shasum":"d2eb570597c83c1aa93d1f2fcb3d874a5855de07","size":2851,"noattachment":false,"key":"/@ndelangen/html-webpack-harddisk-plugin/-/@ndelangen/html-webpack-harddisk-plugin-0.2.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/@ndelangen/html-webpack-harddisk-plugin/download/@ndelangen/html-webpack-harddisk-plugin-0.2.0.tgz"},"maintainers":[{"name":"ndelangen","email":""}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/html-webpack-harddisk-plugin_0.2.0_1539283397974_0.45406627882827943"},"_hasShrinkwrap":false,"publish_time":1539283398089,"_cnpm_publish_time":1539283398089}},"readme":"Harddisk extension for the HTML Webpack Plugin\n========================================\n[![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://travis-ci.org/jantimon/html-webpack-harddisk-plugin.svg)](https://travis-ci.org/jantimon/html-webpack-harddisk-plugin) [![js-semistandard-style](https://img.shields.io/badge/code%20style-semistandard-brightgreen.svg?style=flat-square)](https://github.com/Flet/semistandard)\n\nEnhances [html-webpack-plugin](https://github.com/ampedandwired/html-webpack-plugin)\nfunctionality by adding the `{alwaysWriteToDisk: true|false}` option.\n\nThis is an extension plugin for the [webpack](http://webpack.github.io) plugin [html-webpack-plugin](https://github.com/ampedandwired/html-webpack-plugin) - a plugin that simplifies the creation of HTML files to serve your webpack bundles.\n\nInstallation\n------------\nYou must be running webpack on node 0.12.x or higher\n\nInstall the plugin with npm:\n```shell\n$ npm install --save-dev html-webpack-harddisk-plugin\n```\n\nBasic Usage\n-----------\nRequire the plugin in your webpack config:\n\n```javascript\nvar HtmlWebpackHarddiskPlugin = require('html-webpack-harddisk-plugin');\n```\n\nAdd the plugin to your webpack config as follows:\n\n```javascript\nplugins: [\n  new HtmlWebpackPlugin(),\n  new HtmlWebpackHarddiskPlugin()\n]  \n```\nThe above configuration will actually do nothing due to the configuration defaults.\n\nAs soon as you now set `alwaysWriteToDisk` to `true` the generated output of the HtmlWebpackPlugin will\nalways be written to disk. This is very useful if you want to pick up the output with another middleware.\n```javascript\nplugins: [\n  new HtmlWebpackPlugin({\n\t\talwaysWriteToDisk: true\n\t}),\n  new HtmlWebpackHarddiskPlugin()\n]  \n```\n\nEven if you generate multiple files make sure that you add the HtmlWebpackHarddiskPlugin **only once**:\n\n```javascript\nplugins: [\n  new HtmlWebpackPlugin({\n\t\talwaysWriteToDisk: true\n\t}),\n  new HtmlWebpackPlugin({\n\t\talwaysWriteToDisk: true,\n\t\tfilename: 'demo.html'\n\t}),\n  new HtmlWebpackPlugin({\n\t\talwaysWriteToDisk: false,\n\t\tfilename: 'test.html'\n\t}),\n  new HtmlWebpackHarddiskPlugin()\n]  \n```\n\nIf you need to set the output path explicitly (for example when using with webpack-dev-server middleware) then pass in the `outputPath` option:\n\n```\nnew HtmlWebpackHarddiskPlugin({\n  outputPath: path.resolve(__dirname, 'views')\n})\n```\n","_attachments":{},"homepage":"https://github.com/jantimon/html-webpack-harddisk-plugin","bugs":{"url":"https://github.com/jantimon/html-webpack-harddisk-plugin/issues"},"license":"MIT"}