{"name":"@vxna/mini-html-webpack-template","version":"0.1.1","description":"Minimum viable template for mini-html-webpack-plugin","author":{"name":"@vxna"},"license":"MIT","main":"index.js","repository":{"type":"git","url":"git+https://github.com/vxna/mini-html-webpack-template.git"},"engines":{"node":">= 6.9.0 || >= 8.9.0"},"dependencies":{"common-tags":"^1.7.2"},"peerDependencies":{"mini-html-webpack-plugin":"^0.1.1","webpack":"^4.1.0"},"gitHead":"553783ba04db603d55b705bd8929aaf1280826fa","bugs":{"url":"https://github.com/vxna/mini-html-webpack-template/issues"},"homepage":"https://github.com/vxna/mini-html-webpack-template#readme","_id":"@vxna/mini-html-webpack-template@0.1.1","_npmVersion":"5.6.0","_nodeVersion":"9.6.1","_npmUser":{"name":"vxna","email":"vxna@tuta.io"},"dist":{"integrity":"sha512-IC2Q+qu7O/r5zGk7AIcUsYyejSBZDJs+sfDcVY0+4pywPeFEsgkYhNiQG9pLd36Og+34174mxGY4OVVnVC9Pzg==","shasum":"95a26e7530697f2424068f2f76e7a568cc95ba35","tarball":"http://registry-npm.ywwl.com/@vxna/mini-html-webpack-template/download/@vxna/mini-html-webpack-template-0.1.1.tgz","fileCount":5,"unpackedSize":8602,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAMzSfTiET2OrvDbmem+MZsIluCFbiM6Jjmz17Vqi/1ZAiAczmyweOL05BiW9Ju9UtTXGLixvnjVZGNxi94fyTQA3g=="}],"size":3234,"noattachment":false,"key":"/@vxna/mini-html-webpack-template/-/@vxna/mini-html-webpack-template-0.1.1.tgz"},"maintainers":[{"name":"vxna","email":"vxna@tuta.io"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mini-html-webpack-template_0.1.1_1522331310755_0.06703869927227002"},"_hasShrinkwrap":false,"readme":"# @vxna/mini-html-webpack-template\r\n\r\n[![Build Status](https://travis-ci.com/vxna/mini-html-webpack-template.svg)](https://travis-ci.com/vxna/mini-html-webpack-template) [![npm](https://img.shields.io/npm/v/@vxna/mini-html-webpack-template.svg)](https://www.npmjs.com/package/@vxna/mini-html-webpack-template)\r\n\r\nTemplate for [mini-html-webpack-plugin](https://github.com/bebraw/mini-html-webpack-plugin) that extends default features with useful subset of options\r\n\r\n## Warning\r\n\r\nIt does not work with [html-webpack-plugin](https://github.com/jantimon/html-webpack-plugin)\r\n\r\n## Common usage\r\n\r\n**webpack.config.js**\r\n\r\n```js\r\nconst MiniHtmlWebpackPlugin = require('mini-html-webpack-plugin')\r\n\r\nmodule.exports = {\r\n  plugins: [\r\n    new MiniHtmlWebpackPlugin({\r\n      context: {\r\n        title: 'common-usage',\r\n        favicon: 'https://assets-cdn.github.com/favicon.ico',\r\n        container: 'root',\r\n        trimWhitespace: true\r\n      },\r\n      template: require('@vxna/mini-html-webpack-template')\r\n    })\r\n  ]\r\n}\r\n```\r\n\r\n## Common options\r\n\r\n| Name                 | Type        | Default        | Description                        |\r\n| -------------------- | ----------- | -------------- | ---------------------------------- |\r\n| **`lang`**           | `{String}`  | `undefined`    | Set document language              |\r\n| **`title`**          | `{String}`  | `'sample-app'` | Set document title                 |\r\n| **`favicon`**        | `{String}`  | `undefined`    | Set document favicon               |\r\n| **`container`**      | `{String}`  | `undefined`    | Set application mount point        |\r\n| **`trimWhitespace`** | `{Boolean}` | `undefined`    | Safe document whitespace reduction |\r\n\r\n## Extended usage\r\n\r\n**webpack.config.js**\r\n\r\n```js\r\nconst MiniHtmlWebpackPlugin = require('mini-html-webpack-plugin')\r\n\r\nmodule.exports = {\r\n  plugins: [\r\n    new MiniHtmlWebpackPlugin({\r\n      context: {\r\n        title: 'extended-usage',\r\n        head: {\r\n          meta: [\r\n            {\r\n              name: 'description',\r\n              content: 'mini-html-webpack-template'\r\n            }\r\n          ]\r\n        },\r\n        body: {\r\n          raw: '<div id=\"root\"></div>'\r\n        },\r\n        attrs: {\r\n          js: {\r\n            async: '',\r\n            type: 'text/javascript'\r\n          }\r\n        }\r\n      },\r\n      template: require('@vxna/mini-html-webpack-template')\r\n    })\r\n  ]\r\n}\r\n```\r\n\r\n## Extended options\r\n\r\n| Name               | Type              | Default     | Description                               |\r\n| ------------------ | ----------------- | ----------- | ----------------------------------------- |\r\n| **`head.meta`**    | `{Array}`         | `undefined` | Array of objects with key + value pairs   |\r\n| **`head.links`**   | `{Array}`         | `undefined` | Array of objects with key + value pairs   |\r\n| **`head.scripts`** | `{Array}`         | `undefined` | Array of objects with key + value pairs   |\r\n| **`head.raw`**     | `{Array\\|String}` | `undefined` | Generates raw document markup             |\r\n| **`body.scripts`** | `{Array}`         | `undefined` | Array of objects with key + value pairs   |\r\n| **`body.raw`**     | `{Array\\|String}` | `undefined` | Generates raw document markup             |\r\n| **`attrs.js`**     | `{Object}`        | `undefined` | Applies html attributes to webpack output |\r\n| **`attrs.css`**    | `{Object}`        | `undefined` | Applies html attributes to webpack output |\r\n\r\n## Advanced minification\r\n\r\nFor custom needs [html-minifier](https://github.com/kangax/html-minifier) middleware and all of it's [options](https://github.com/kangax/html-minifier#options-quick-reference) could be used\r\n\r\n**webpack.config.js**\r\n\r\n```js\r\nconst { minify } = require('html-minifier')\r\nconst MiniHtmlWebpackPlugin = require('mini-html-webpack-plugin')\r\n\r\nmodule.exports = {\r\n  plugins: [\r\n    new MiniHtmlWebpackPlugin({\r\n      context: {\r\n        title: 'advanced-minification'\r\n      },\r\n      template: ctx =>\r\n        minify(require('@vxna/mini-html-webpack-template')(ctx), {\r\n          collapseWhitespace: true,\r\n          minifyCSS: true,\r\n          minifyJS: true\r\n        })\r\n    })\r\n  ]\r\n}\r\n```\r\n\r\n## Complex security features\r\n\r\n[SRI](https://developer.mozilla.org/en-US/docs/Web/Security/Subresource_Integrity) is out of scope of this project and it's recommended to use [html-webpack-plugin](https://github.com/jantimon/html-webpack-plugin) with it's ecosystem tools.\r\n\r\n## Inspired by\r\n\r\n[html-webpack-template](https://github.com/jaketrent/html-webpack-template)\r\n\r\n## License\r\n\r\nMIT (http://www.opensource.org/licenses/mit-license.php)\r\n","publish_time":1522331310799,"_cnpm_publish_time":1522331310799,"dist-tags":{"latest":"2.0.0"}}