{"_id":"@ankumo/esbuild-plugin-html","_rev":"3-1581c4e8aa5aa770f772233299960863","name":"@ankumo/esbuild-plugin-html","dist-tags":{"latest":"0.8.16"},"versions":{"0.8.14":{"name":"@ankumo/esbuild-plugin-html","type":"module","version":"0.8.14","description":"A HTML loader plugin for esbuild.","main":"lib/index.js","typings":"./types/index.d.ts","author":{"name":"Chialab","email":"dev@chialab.io","url":"https://www.chialab.it"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/chialab/rna.git","directory":"packages/esbuild-plugin-html"},"keywords":["esbuild","plugin","html","webapp","bundle"],"scripts":{"types":"tsc","prepack":"npm run types"},"engines":{"node":">=13"},"dependencies":{"cheerio":"^1.0.0-rc.9","esbuild":"^0.12.0","jimp":"^0.16.1"},"devDependencies":{"typescript":"^4.2.3"},"bugs":{"url":"https://github.com/chialab/rna/issues"},"homepage":"https://github.com/chialab/rna#readme","_id":"@ankumo/esbuild-plugin-html@0.8.14","_nodeVersion":"16.4.2","_npmVersion":"7.18.1","dist":{"integrity":"sha512-c7xbY7VTGOtvqe2p/fw9ojHXaSL2AIfQAcxol9P99xKupwA5q6Jr0XBLZ/D9XDHLr0klaT2wbNBDQEzD+IFZmw==","shasum":"1ef814fe930b49adfb3472dcedcd97bb5bec11ef","tarball":"https://registry.npmjs.org/@ankumo/esbuild-plugin-html/-/esbuild-plugin-html-0.8.14.tgz","fileCount":23,"unpackedSize":43231,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg6xFtCRA9TVsSAnZWagAAsJgP/3U6PFI3eil91TwYX85e\nvod1WjQL7XapmIkqj9Wm8FeJTajWoLEko8Xbv/xZ7X+svUwerK1xMAvHEzFS\nQTQtJa2WU4rbBN89rGBMs8tMots6rU4h+Sy/G9Ok2eIKVbm/wRLvXXR2jrQg\n3SmncMAkD3TRQ9PpZm/zgF8sJqlpZl0bi3HRBxX5N5qnHSl+fdwshru1OynK\nq2wMkCLaWXY1IeI0BKTlh5TDOzc6vxF0iY8CTmFdvwTcBD3ONrfbX52tdQ/M\nQ/RnuJdxWx6Rtz9cilfpk4Yn2D4w8w5xGyi9LDgrGzUFF8VbT83WKFmRK/Y2\n4Vu/Qp5Y2mUqKV+fZIEYePyAGiKeZrpjWsrBoH4IG/f3p6ZuFBj6jMBhAm5K\nA2QDljp2Q6vKEB79kO716+d7Fb2K/G04SgKz+zIHd5iWN1/1eGbi5Z/9kSDQ\nuYFgWpJo2j9ovvxZdo8vYUaJSkT2grcqGXIRppxxHH115vY5QR1AGE2OZnBq\ndCSXfbhfhakgenOiaoQvLJxmzaiTgI1bU7/wmzKJsweCHQvuEfG7alPRl3El\n7vFPoP5DDQoQ4ig+kfdf+2tPRpBKY9dUKeVFk5wqhcx8oYOpjKPOdeuu6Txp\nB3SFothAJehdKMyMtyBlV1zM9/s7YM3jT703i0VHY27a6CZ3yGYT/D8ZuiUC\nk5aD\r\n=H6HK\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIA0kEdGOzvpfyYsgbCpUijRDn710JZItRPTh2q4nzuXAAiATTrQtURL+0vd1tKTx69Ci8hVevz7HnFcORmK2TFfttg=="}]},"_npmUser":{"name":"ankumo","email":"ankubear@gmail.com"},"directories":{},"maintainers":[{"name":"ankumo","email":"ankubear@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/esbuild-plugin-html_0.8.14_1626018156691_0.07716822196633655"},"_hasShrinkwrap":false},"0.8.15":{"name":"@ankumo/esbuild-plugin-html","type":"module","version":"0.8.15","description":"A HTML loader plugin for esbuild.","main":"lib/index.js","typings":"./types/index.d.ts","author":{"name":"Chialab","email":"dev@chialab.io","url":"https://www.chialab.it"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/chialab/rna.git","directory":"packages/esbuild-plugin-html"},"keywords":["esbuild","plugin","html","webapp","bundle"],"scripts":{"types":"tsc","prepack":"npm run types"},"engines":{"node":">=13"},"dependencies":{"cheerio":"^1.0.0-rc.9","esbuild":"^0.12.0","jimp":"^0.16.1"},"devDependencies":{"typescript":"^4.2.3"},"bugs":{"url":"https://github.com/chialab/rna/issues"},"homepage":"https://github.com/chialab/rna#readme","_id":"@ankumo/esbuild-plugin-html@0.8.15","_nodeVersion":"12.18.3","_npmVersion":"6.14.6","dist":{"integrity":"sha512-qVyaMOd2Dm8oORVl4mCvDj+O0ZDC6eZn7kaoxb6FFpdQHx6UoRz21D272RdAkbZ3xir2y1BWNou2WMPA2Rtuwg==","shasum":"e6ef2d78916a8bc8f319b05992c4fca97c4615d5","tarball":"https://registry.npmjs.org/@ankumo/esbuild-plugin-html/-/esbuild-plugin-html-0.8.15.tgz","fileCount":23,"unpackedSize":43758,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg65vDCRA9TVsSAnZWagAAROAP/0xuzm9UbXCOxcPSw+9a\nd/xwjxZytrfn0sjUxsDG2iJUGUqbbIv3rOxVJNg3kXdxtk1mQi7fRXZ7NWwl\nD5Ez5armGu/TpWuY10G2aySf1xLeZ1waiWXYOmuU8ZFzbKex5u1BWWHesyQp\nP0A3D6BaHVbxQ5+n5afoiFfmM9MpFE7UDobV4ZMUMbpdNccHdc+1cIpJ/dyc\n+yQmDxY9Iih8vH2qvla8xEhvdMUT6+M1KbLtsdmO64PHSlsOpfbyBiY8zCne\noMQA8XIk/HHhhnN4jJ1EYikK4EywLT6cpDqf3MxWnqAeTQ5DAN3aZ7uhuQ0O\n8aqjtCSEyNVnTskJfdRSHuAScnCBCjaM/OD166SmGXNXPqG3/PPtjP7tqq4w\nRsz4uf5UW1ErO8ogjEChhzjNSAJRdw6sf3B0UozJ9JRWtSOscOn4YdJU01yO\n033TTjRzZpfiQccKdf8YCLK2lK0Mweo354KOSLU8BJ0Bm4pBdGK+pJKA+lQk\nJ1ejJM1uILJ1Bo1FsSu883uLfyOnpcCXuofxbhB/27lQB27e05mS4Ji53mbf\nwAHMV++3tHrgifiRNRIyMWHFnJlDT8EO6fY5m0l053LL2qlpwPAhd6Oeeu1F\nToKtEhaSdz/klhxJ+y/YkgzLCMr9TxM5pnhvzYMABtPXHB7ls0uLpuAQyj39\nt8GK\r\n=R/ZI\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEQxsGllRo1uNtGnw3/JHSVSBPD7LznJNVro+q8a5S/sAiBNyyZn0mp6usz5Wsb8TDTVdm/kwlKZGcEOZcSISZ4N1A=="}]},"_npmUser":{"name":"ankumo","email":"ankubear@gmail.com"},"directories":{},"maintainers":[{"name":"ankumo","email":"ankubear@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/esbuild-plugin-html_0.8.15_1626053571352_0.8661547791291493"},"_hasShrinkwrap":false},"0.8.16":{"name":"@ankumo/esbuild-plugin-html","type":"module","version":"0.8.16","description":"A HTML loader plugin for esbuild.","main":"lib/index.js","typings":"./types/index.d.ts","author":{"name":"Chialab","email":"dev@chialab.io","url":"https://www.chialab.it"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/chialab/rna.git","directory":"packages/esbuild-plugin-html"},"keywords":["esbuild","plugin","html","webapp","bundle"],"scripts":{"types":"tsc","prepack":"npm run types"},"engines":{"node":">=13"},"dependencies":{"cheerio":"^1.0.0-rc.9","esbuild":"^0.12.0","jimp":"^0.16.1"},"devDependencies":{"typescript":"^4.2.3"},"bugs":{"url":"https://github.com/chialab/rna/issues"},"homepage":"https://github.com/chialab/rna#readme","_id":"@ankumo/esbuild-plugin-html@0.8.16","_nodeVersion":"12.18.3","_npmVersion":"6.14.6","dist":{"integrity":"sha512-rXeUHBIH5e4DzRxiA2kgo1+SetLu8FqnBfxwItOekHJ2KrCTNymNujoFxD2jq1IuNoYzIszuP8GAcQcp6MdK4g==","shasum":"18af1fdd01d1ff1ef220c21fe8c9221aca8fb4d2","tarball":"https://registry.npmjs.org/@ankumo/esbuild-plugin-html/-/esbuild-plugin-html-0.8.16.tgz","fileCount":23,"unpackedSize":44201,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg6+wBCRA9TVsSAnZWagAAzTEP/iz2Lb3sHjVDJY/bUWq/\num5sxBA2zR2fDVuwI2sl/zsN+SzxeF1NU2HNlAtwRMBx7JfCTqxVlgsV8A3H\nDrvdjwMliL/IFqpr3fOYBBskDViEpj2TqSjxaxOHoLQLpIAJZjtCCUX6wEAY\nw00V28h7TTWTiqeET9DHHyW9h0zIOOLWnkmnNouIFizwjx0fAFk0X7dwm6IY\nulCxGDYFEVKbRnS2hZdjQJIV/DFcq/s8OqFFHPrKaTlT2ZT2gWxk6Zr6U77A\nRkfzUgAWxdVznrUTPQoU81GHCN2Tal5BaB6ruywVfg/SXdNPIc1snLJrORFY\nPhyXpkscxAUct9slCnH2AFkMA7ts0IpYgWHSzRBsYH5PeCG6uNw1cVNsO0lM\nNysTjRsAXWqt+SJuhak1p0BRk20goXwWd8apY1sDU/5Xx7d/q6SKw8b51lGq\nPuuVfr96G8+ICp0dC20o2S+82scXmvclwgZMp5hwr2SrJyCwYCBzOnHBI2Um\nugunMXWgqkHh64GcIB4zzsxXDffcSqFpkrqhKocBjWzMbMJII2Z9ySCf8bE9\nv6gE0bTMwUnoAnHIGXSI/x34utTIlPxoC7VNM2tfCpjPnqRpkIeh+xB7PEeV\n+Yn/O8xWsNZwIrDndCfN0fFCuwPz5uWLOpUcO9tRCOwqQNS9xhGKIXv8eKIx\n5iUu\r\n=E60Q\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAaJJLdtDu6aub0Mz5gH/ldxLdjdlOcRV/pvkMDiLAlJAiAGToXlVK5sG+PWJe5R7JbS3E9E0Q3mVsWZyZHTcYf6mg=="}]},"_npmUser":{"name":"ankumo","email":"ankubear@gmail.com"},"directories":{},"maintainers":[{"name":"ankumo","email":"ankubear@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/esbuild-plugin-html_0.8.16_1626074113307_0.9302588100313587"},"_hasShrinkwrap":false}},"time":{"created":"2021-07-11T15:42:36.639Z","0.8.14":"2021-07-11T15:42:36.851Z","modified":"2022-04-04T14:13:41.730Z","0.8.15":"2021-07-12T01:32:51.484Z","0.8.16":"2021-07-12T07:15:13.476Z"},"maintainers":[{"name":"ankumo","email":"ankubear@gmail.com"}],"description":"A HTML loader plugin for esbuild.","homepage":"https://github.com/chialab/rna#readme","keywords":["esbuild","plugin","html","webapp","bundle"],"repository":{"type":"git","url":"git+https://github.com/chialab/rna.git","directory":"packages/esbuild-plugin-html"},"author":{"name":"Chialab","email":"dev@chialab.io","url":"https://www.chialab.it"},"bugs":{"url":"https://github.com/chialab/rna/issues"},"license":"MIT","readme":"<p align=\"center\">\r\n    <strong>Esbuild Plugin HTML</strong> • A HTML loader plugin for <a href=\"https://esbuild.github.io/\">esbuild</a>.\r\n</p>\r\n\r\n<p align=\"center\">\r\n    <a href=\"https://www.npmjs.com/package/@chialab/esbuild-plugin-html\"><img alt=\"NPM\" src=\"https://img.shields.io/npm/v/@chialab/esbuild-plugin-html.svg?style=flat-square\"></a>\r\n</p>\r\n\r\n---\r\n\r\n## How it works\r\n\r\n**Esbuild Plugin HTML** instructs esbuild to load a HTML file as entrypoint. It parses the HTML and runs esbuild on scripts, styles, assets and icons.\r\n\r\n### Scripts\r\n\r\nIt handles both inline and file scripts. When the `type=\"module\"` attribute is found in the `<script>` tag, it runs esbuild with `format: 'esm'`, otherwise it will produce an `iife` bundle.\r\n\r\n**Sample**\r\n\r\n```html\r\n<script src=\"src/index.js\" type=\"module\"></script>\r\n<script src=\"src/index.js\" nomodule></script>\r\n```\r\n\r\nThis will result in producing two bundles:\r\n\r\n```html\r\n<script src=\"esm/index-[hash].js\" type=\"module\"></script>\r\n<script src=\"iife/index-[hash].js\" nomodule></script>\r\n```\r\n\r\n### Styles\r\n\r\nIt supports both `<link rel=\"stylesheet\">` and `<style>` nodes for styling.\r\n\r\n**Sample**\r\n\r\n```html\r\n<link rel=\"stylesheet\" href=\"app.css\" />\r\n<style>\r\n    .inline {\r\n        color: red;\r\n    }\r\n</style>\r\n```\r\n\r\nThis will result in producing two css bundles:\r\n\r\n```html\r\n<link rel=\"stylesheet\" href=\"css/app-[hash].css\" />\r\n<style>@import url('css/inline-[hash].css');</style>\r\n```\r\n\r\n### Assets\r\n\r\nReferenced files by `src` and `href` attributes are copy along the html file in the `assets` directory.\r\n\r\n**Sample**\r\n\r\n```html\r\n<img src=\"img/logo.png\" />\r\n```\r\n\r\nThis will result in:\r\n\r\n```html\r\n<img src=\"assets/logo-[hash].png\" />\r\n```\r\n\r\n### Icons\r\n\r\nManually generate favicons can be a pain. This plugin detects a `<link rel=\"icon\">` node and uses its reference to generate icons and launch screens for (almost) every browser.\r\n\r\n**Sample**\r\n\r\n```html\r\n<link rel=\"shortcut icon\" href=\"icon.png\" type=\"image/png\">\r\n```\r\n\r\nThis will result in:\r\n\r\n```html\r\n<link rel=\"icon\" sizes=\"16x16\" href=\"icons/favicon-16x16.png\">\r\n<link rel=\"icon\" sizes=\"32x32\" href=\"icons/favicon-32x32.png\">\r\n<link rel=\"icon\" sizes=\"48x48\" href=\"icons/favicon-48x48.png\">\r\n<link rel=\"shortcut icon\" href=\"icons/favicon-196x196.png\">\r\n<link rel=\"icon\" sizes=\"196x196\" href=\"icons/favicon-196x196.png\">\r\n<link rel=\"apple-touch-icon\" sizes=\"180x180\" href=\"icons/apple-touch-icon.png\">\r\n<link rel=\"apple-touch-icon\" sizes=\"167x167\" href=\"icons/apple-touch-icon-ipad.png\">\r\n<link rel=\"apple-touch-startup-image\" media=\"(device-width: 375px) and (device-height: 812px) and (-webkit-device-pixel-ratio: 3)\" href=\"icons/apple-launch-iphonex.png\">\r\n<link rel=\"apple-touch-startup-image\" media=\"(device-width: 375px) and (device-height: 667px) and (-webkit-device-pixel-ratio: 2)\" href=\"icons/apple-launch-iphone8.png\">\r\n<link rel=\"apple-touch-startup-image\" media=\"(device-width: 414px) and (device-height: 736px) and (-webkit-device-pixel-ratio: 3)\" href=\"icons/apple-launch-iphone8-plus.png\">\r\n<link rel=\"apple-touch-startup-image\" media=\"(device-width: 320px) and (device-height: 568px) and (-webkit-device-pixel-ratio: 2)\" href=\"icons/apple-launch-iphone5.png\">\r\n<link rel=\"apple-touch-startup-image\" media=\"(device-width: 768px) and (device-height: 1024px) and (-webkit-device-pixel-ratio: 2)\" href=\"icons/apple-launch-ipadair.png\">\r\n<link rel=\"apple-touch-startup-image\" media=\"(device-width: 834px) and (device-height: 1112px) and (-webkit-device-pixel-ratio: 2)\" href=\"icons/apple-launch-ipadpro10.png\">\r\n<link rel=\"apple-touch-startup-image\" media=\"(device-width: 1024px) and (device-height: 1366px) and (-webkit-device-pixel-ratio: 2)\" href=\"icons/apple-launch-ipadpro12.png\">\r\n```\r\n\r\nIt also update `<link rel=\"manifest\">` content if found.\r\n\r\n---\r\n\r\n## Install\r\n\r\n```sh\r\n$ npm i @chialab/esbuild-plugin-html -D\r\n$ yarn add @chialab/esbuild-plugin-html -D\r\n```\r\n\r\n## Usage\r\n\r\n```js\r\nimport esbuild from 'esbuild';\r\nimport htmlPlugin from '@chialab/esbuild-plugin-html';\r\n\r\nawait esbuild.build({\r\n    plugins: [\r\n        htmlPlugin({\r\n            // esbuild: esbuild,\r\n            // scriptsTarget: 'es6',\r\n            // modulesTarget: 'es2020',\r\n        }),\r\n    ],\r\n});\r\n```\r\n\r\n### Options\r\n\r\nThe HTML plugin accepts an options object with the following properties:\r\n\r\n#### `esbuild`\r\n\r\nThe esbuild instance module to use\r\n\r\n---\r\n\r\n## License\r\n\r\n**Esbuild Plugin HTML** is released under the [MIT](https://github.com/chialab/rna/blob/master/packages/esbuild-plugin-html/LICENSE) license.\r\n","readmeFilename":"README.md"}