{"name":"@vxna/mini-html-webpack-template","version":"2.0.0","description":"Minimum viable template for mini-html-webpack-plugin","author":{"name":"vxna"},"license":"MIT","main":"src/index.js","repository":{"type":"git","url":"git+https://github.com/vxna/mini-html-webpack-template.git"},"keywords":["webpack","mini-html-webpack-plugin"],"engines":{"node":">= 10"},"scripts":{"pretest":"yarn lint","lint":"eslint src/**/*.js --format codeframe --fix","test":"jest","format":"prettier src/**/*.{js,md} --write","posttest":"yarn format"},"dependencies":{"common-tags":"^1.8.0"},"devDependencies":{"@webpack-contrib/test-utils":"^0.1.3","css-loader":"^3.4.2","eslint":"^6.8.0","eslint-config-prettier":"^6.10.0","eslint-config-standard":"^14.1.0","eslint-plugin-import":"^2.20.0","eslint-plugin-node":"^11.0.0","eslint-plugin-promise":"^4.2.1","eslint-plugin-standard":"^4.0.1","husky":"^4.2.1","jest":"^25.1.0","lint-staged":"^10.0.7","mini-css-extract-plugin":"^0.9.0","mini-html-webpack-plugin":"^2.2.1","prettier":"^1.19.1","webpack":"^4.41.5"},"eslintConfig":{"extends":["standard","prettier"]},"prettier":{"singleQuote":true,"semi":false},"husky":{"hooks":{"pre-commit":"lint-staged"}},"lint-staged":{"*.js":["eslint --fix"],"*.{js,md}":["prettier --write"]},"publishConfig":{"access":"public"},"gitHead":"dcded116cb0023140ecfb3c18aa65c8089f590f0","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@2.0.0","_nodeVersion":"12.14.1","_npmVersion":"6.13.4","dist":{"integrity":"sha512-oVrauLwSeWxq1yC4hR9gL2+k8nzrUsy5fJgt+QqartutOmUQAatJWn28BBvrhVMYZvYb+EsmZJt9nZtGTuUTOw==","shasum":"79b012b3385a6f01ae54ef50a3c99dda64d2a29a","tarball":"http://registry-npm.ywwl.com/@vxna/mini-html-webpack-template/download/@vxna/mini-html-webpack-template-2.0.0.tgz","fileCount":4,"unpackedSize":9578,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeNLwQCRA9TVsSAnZWagAAMvAP/093S0Tf1n8tn698oIzk\nDznaEv7JXv9saq/7jS+i4sylSaT3cYhRffEbX4UsIJJoQ0+SCsJv0bH9KQQj\noBZE8wryYjNpWhlpjgqg5JkDHiIuZfdq+WdxrP7Vc9g/bQX1MNa2UyO7SHyU\n2OpWMhsSm7KWmGLNeoO6TtQcxABxy+jkr90oB1cOelIsAJ+N6+iFBK9ETxo6\ntYaO3PuJAEMPkL5tepT2x5303To8E2ccSJyyYP8yo8dw5THZmIykMkebTD5N\nGjhgIWJe1lNcl/OPuFIhMe4494yv1qploHp/YtdPxPLALXat94lPErliZxdq\nbnU0aHU7jg7203eipboYHfME2wWmMn8qxTpaObsrYchuj2ULpHeBF50tPsxI\nofigvH7F/CTtLDL8APcYYbFoRWUlAIc/My1L+IJaQRVy9k0Z6u94WkWCdB3D\naKi9DLNx6sSPb9HgeibSFOcdGdfnXC0Y/W3Mab92XCqN+cXlcgXmvhdF9QNG\nB/aKpBy+6bZ1QklGMevAIJ2QslJxh8GCkgQlSNgP5++qS94h3fgj0AdpKy1M\n7pHEet3S6YIBzCDgLiRZADoUq1rlSaFROFynnGTQHmrSxhBdt33oVafV6EVw\nhqKuaEitMbt3oM2qmf0JNrjhB2wVIEJE0uMIulads72kzLGyEncoJqliuBPN\nrNvr\r\n=VSMi\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEuWfHdYet/OJ4QWoReQZz/ewzpXJ4O4FwOAnVsLaN6cAiBMk7lnPouiseEsWZGEcYdwX+Wcib6PHj1knbCmgkQDnQ=="}],"size":3533,"noattachment":false,"key":"/@vxna/mini-html-webpack-template/-/@vxna/mini-html-webpack-template-2.0.0.tgz"},"maintainers":[{"name":"vxna","email":"vxna@tuta.io"}],"_npmUser":{"name":"vxna","email":"vxna@tuta.io"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mini-html-webpack-template_2.0.0_1580514319828_0.8198570116326043"},"_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":1580514319971,"_cnpm_publish_time":1580514319971,"dist-tags":{"latest":"2.0.0"}}