{"id":13782506,"url":"https://github.com/shff/parcel-plugin-inliner","last_synced_at":"2025-05-11T15:32:33.033Z","repository":{"id":45006960,"uuid":"141182919","full_name":"shff/parcel-plugin-inliner","owner":"shff","description":"Parcel plugin to inline CSS and JS code in your HTML file.","archived":false,"fork":false,"pushed_at":"2022-01-14T09:13:07.000Z","size":123,"stargazers_count":71,"open_issues_count":1,"forks_count":8,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-19T17:07:57.352Z","etag":null,"topics":["frontend","inliner","parcel","parcel-bundler","parcel-plugin"],"latest_commit_sha":null,"homepage":"https://npmjs.com/package/parcel-plugin-inliner","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/shff.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-07-16T19:16:26.000Z","updated_at":"2024-09-04T10:25:18.000Z","dependencies_parsed_at":"2022-09-26T18:00:34.665Z","dependency_job_id":null,"html_url":"https://github.com/shff/parcel-plugin-inliner","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shff%2Fparcel-plugin-inliner","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shff%2Fparcel-plugin-inliner/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shff%2Fparcel-plugin-inliner/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shff%2Fparcel-plugin-inliner/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/shff","download_url":"https://codeload.github.com/shff/parcel-plugin-inliner/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253588747,"owners_count":21932317,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["frontend","inliner","parcel","parcel-bundler","parcel-plugin"],"created_at":"2024-08-03T18:01:38.206Z","updated_at":"2025-05-11T15:32:32.777Z","avatar_url":"https://github.com/shff.png","language":"JavaScript","funding_links":[],"categories":["Plugins"],"sub_categories":["Other"],"readme":"# parcel-plugin-inliner\n\nA Parcel plugin to inline CSS and JS code in your HTML file.\n\nThis plugin uses [PostHTML](https://www.npmjs.com/package/posthtml) and [posthtml-inline-assets](https://www.npmjs.com/package/posthtml-inline-assets) to inline your HTML files.\n\n## IMPORTANT NOTICE:\n\nDue to a change in Parcel 2.0 API, plugins whose package name start with `parcel-plugin-` don't work on it. This plugin needs Parcel 1.x.\n\nIf you want inlining in Parcel 2.0, check their documentation: [Inline script and style tags :: v2.parceljs.org](https://v2.parceljs.org/languages/html/#inline-script-and-style-tags).\n\n## Usage\n\nJust install the plugin as a dependency using yarn or npm and build normally with Parcel. There are no configuration options.\n\n## Installation\n\n```\nyarn add parcel-plugin-inliner\n```\n\nor\n\n```\nnpm install parcel-plugin-inliner\n```\n\n## Caveats\n\nThis library only inlines files that are referenced directly in your entry point HTML file. It doesn't inline dependencies referenced inside JS and CSS files. It also doesn't inline files loaded asyncronously using Javascript. It doesn't affect code-splitting.\n\nIt only inlines the entry point of your app, and only works with HTML files.\n\nIt does not delete the JS and CSS files.\n\n## Example\n\n#### Original HTML file:\n\n```\n\u003c!DOCTYPE html\u003e\n\u003chtml\u003e\n  \u003chead\u003e\n    \u003cmeta charset=\"utf-8\"\u003e\n    \u003cmeta name=\"viewport\" content=\"width=device-width,initial-scale=1.0\"\u003e\n    \u003ctitle\u003eProject\u003c/title\u003e\n    \u003clink rel=\"style.css\" type=\"stylesheet\"\u003e\n  \u003c/head\u003e\n  \u003cbody\u003e\n    \u003cmain\u003e\u003c/main\u003e\n    \u003cscript src=\"main.jsx\"\u003e\u003c/script\u003e\n  \u003c/body\u003e\n\u003c/html\u003e\n```\n\n#### Resulting HTML file:\n\n```\n\u003c!DOCTYPE html\u003e\u003chtml\u003e \u003chead\u003e \u003cmeta charset=\"utf-8\"\u003e \u003cmeta name=\"viewport\" content=\"width=device-width,initial-scale=1.0\"\u003e \u003ctitle\u003eProject\u003c/title\u003e \u003cstyle\u003e html{-webkit-text-size-adjust:100%;line-height:1.15}body{margin:0} ... .h-100{height:100%}\u003c/style\u003e\u003c/head\u003e \u003cbody\u003e \u003cmain\u003e\u003c/main\u003e \u003cscript\u003eparcelRequire=function(e,t,n,r){function o(n,r){ ... },{preact:\"WHr8\",tachyons:\"kuxM\"}]},{},[\"WoLR\"]);\u003c/script\u003e \u003c/body\u003e \u003c/html\u003e\n```\n\nCSS and JS sections were shortened for example.\n\n## License\n\n```\n\nMIT License\n\nCopyright (c) 2018 Silvio Henrique Ferreira\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshff%2Fparcel-plugin-inliner","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fshff%2Fparcel-plugin-inliner","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshff%2Fparcel-plugin-inliner/lists"}