{"name":"@vxna/mini-html-webpack-template","version":"0.1.7","description":"Minimum viable template for mini-html-webpack-plugin","author":{"name":"@vxna"},"license":"MIT","main":"index.js","files":["index.js"],"repository":{"type":"git","url":"git+https://github.com/vxna/mini-html-webpack-template.git"},"keywords":["webpack","mini-html-webpack-plugin"],"engines":{"node":">= 6.9.0"},"scripts":{"test":"jest","format":"prettier --write **/*.{js,md}","precommit":"npm run test && npm run format"},"dependencies":{"common-tags":"^1.7.2"},"devDependencies":{"@webpack-contrib/test-utils":"^0.1.2","husky":"^0.14.3","jest":"^22.4.3","mini-html-webpack-plugin":"^0.2.3","prettier":"^1.11.1","webpack":"^4.4.1"},"publishConfig":{"access":"public"},"prettier":{"singleQuote":true,"semi":false},"gitHead":"4fc7ff3683659119b84311efb1cf034d5443952b","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.7","_npmVersion":"6.0.0","_nodeVersion":"9.11.1","_npmUser":{"name":"vxna","email":"vxna@tuta.io"},"dist":{"integrity":"sha512-qV2VslV48ECPwyuG7c4O6JpYgjnvdm88YYkMncIXzakXXwVUxhcg6YipXxWK7U+pixHkWWSnDX/8DIOmWeh+PQ==","shasum":"2a8270e513ee14f395cc17c2ce22ced383c45d22","tarball":"http://registry-npm.ywwl.com/@vxna/mini-html-webpack-template/download/@vxna/mini-html-webpack-template-0.1.7.tgz","fileCount":4,"unpackedSize":8192,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJa85R+CRA9TVsSAnZWagAAzdwP/3ih9QznIVEDxTefOegI\ncsARGsznEFYUAwzm5n2f9R5IgoRLzCC51IGw+3c4/x8//c1wSsemDHyCtSC7\nNecvNpKfS+iojEP3Yrd8GZoMsQmwZfwYY6CPg9+SLu+uP49s0vYi6G7zCkI0\nBfNqkLWo7WrCFJYIiM4TIYEdtel7etswEEGjY4aG2iM8A1ESAwpby+ML2NjA\nPufIjAH89aUqCvNGztZANqVy1okHRdJ1PVAgWminmzdELcrF9i3X7c5ZKbnJ\nEJ8pNxcO44fpekGuq6JDAua80w6COR1RbHzgIwbqfCYt9A5njWJEmyVpjpyL\np2O93AG8Qyw1Bd+tmqH95TC4eUqTHsXU91rrEbfg36n/NxoZ6JcoY4AzlI/Y\nK+xji+FIoNjwd2y2RD/HFKZIZsd23hETAK30eUPQUPescpnkkNpMM5U2bbat\ncJCr5n4yD1SKqm5N/pj+kBMQEZVAlMcyx+4TX5DxBHRD42wR6X75ljszj83D\ndcSdrLCFyHRHi1sqYoSqBWLhQq1Ld4Vllz5/II5DH58LLMc3SctcAAYEgRE5\n4olXK7PUy2m40b6O3zYpHBg5eG/v8KkTgZ/zuWFEqNn9DqYZ1mbOMYtQJG/k\nmdrEEp2WrtWCcMWcxZzkdYH/djAGac3QNL4MO13IUiqOzIdnOrlWY5FjcihM\nLGEM\r\n=e+qY\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCRBzQPxR0KWRTYCb4KaQi4z/qYC6dGmdoskdu+JIV9CgIhAKKcdLlefNGm1EMj68As/gRtFioMoQBDKpy8mBRtZjpI"}],"size":2975,"noattachment":false,"key":"/@vxna/mini-html-webpack-template/-/@vxna/mini-html-webpack-template-0.1.7.tgz"},"maintainers":[{"name":"vxna","email":"vxna@tuta.io"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mini-html-webpack-template_0.1.7_1525912701477_0.7286238840598551"},"_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":1525912701596,"_cnpm_publish_time":1525912701596,"dist-tags":{"latest":"2.0.0"}}