{"id":43394711,"url":"https://github.com/webkong/html-webpack-assets-insert-plugin","last_synced_at":"2026-02-02T14:21:07.039Z","repository":{"id":57267707,"uuid":"288143308","full_name":"webkong/html-webpack-assets-insert-plugin","owner":"webkong","description":"Enhances html-webpack-plugin functionality with script and style and html elements insert to html file.","archived":false,"fork":false,"pushed_at":"2020-08-20T10:21:31.000Z","size":90,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-09-26T07:41:29.411Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/webkong.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":"2020-08-17T09:53:25.000Z","updated_at":"2020-08-20T10:21:33.000Z","dependencies_parsed_at":"2022-08-26T13:11:51.441Z","dependency_job_id":null,"html_url":"https://github.com/webkong/html-webpack-assets-insert-plugin","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/webkong/html-webpack-assets-insert-plugin","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/webkong%2Fhtml-webpack-assets-insert-plugin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/webkong%2Fhtml-webpack-assets-insert-plugin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/webkong%2Fhtml-webpack-assets-insert-plugin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/webkong%2Fhtml-webpack-assets-insert-plugin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/webkong","download_url":"https://codeload.github.com/webkong/html-webpack-assets-insert-plugin/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/webkong%2Fhtml-webpack-assets-insert-plugin/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29012811,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-02T12:48:30.580Z","status":"ssl_error","status_checked_at":"2026-02-02T12:46:38.384Z","response_time":58,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":[],"created_at":"2026-02-02T14:21:05.480Z","updated_at":"2026-02-02T14:21:07.032Z","avatar_url":"https://github.com/webkong.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Assets Extension for HTML Webpack Plugin\n\n[![npm version](https://badge.fury.io/js/html-webpack-assets-insert-plugin.svg)](http://badge.fury.io/js/html-webpack-assets-insert-plugin) [![Build status](https://travis-ci.org/webkong/html-webpack-assets-insert-plugin.svg?branch=master)](https://travis-ci.org/webkong/html-webpack-assets-insert-plugin.svg?branch=master)\n\n[![NPM](https://nodei.co/npm/html-webpack-assets-insert-plugin.png?downloads=true\u0026downloadRank=true\u0026stars=true)](https://nodei.co/npm/html-webpack-assets-insert-plugin/)\n\nEnhances [html-webpack-plugin](https://github.com/jantimon/html-webpack-plugin)\nfunctionality with different deployment options for your html.\n\nThis is an extension plugin for the [webpack](http://webpack.github.io) plugin [html-webpack-plugin](https://github.com/jantimon/html-webpack-plugin) - a plugin that simplifies the creation of HTML files to serve your webpack bundles.\n\nThe raw [html-webpack-plugin](https://github.com/jantimon/html-webpack-plugin) incorporates all webpack-generated javascipt as `\u003cscript\u003e` elements and css as `\u003clink\u003e` elements in the generated html. This plugin allows you to:\n\n- add script tags to html file;\n- add style tags to html file;\n\n## Installation\n\nYou must be running webpack (3.x, 4.x) on node 8+.\nInstall the plugin with npm:\n\n```shell\n$ npm install html-webpack-assets-insert-plugin -D\n# or\n$ yarn install html-webpack-assets-insert-plugin -D\n```\n\nNot that you will need v3.x or v4.x of [html-webpack-plugin](https://github.com/jantimon/html-webpack-plugin)\n\nYou may see an `UNMET PEER DEPENDENCY` warnings for webpack and various plugins.\n\n## Basic Usage\n\nAdd the plugin to your webpack config as follows:\n\n```javascript\nplugins: [\n  new HtmlWebpackPlugin(),\n  new HtmlWebpackAssetsInsertPlugin({\n    js: {\n      prepend: true,\n      path: [\n        \"https://cdn.jsdelivr.net/npm/vue\",\n        \"https://cdn.jsdelivr.net/npm/vue-router\",\n      ],\n    },\n    css: {\n      prepend: false,\n      path: [\"http://testcss.com/test.css\"],\n    },\n  }),\n];\n```\n\nThe effect of the compiled:\n\n```html\n\u003chead\u003e\n  ....\n\n  \u003clink href=\"http://testcss.com/test.css\" rel=\"stylesheet\" /\u003e\n\u003c/head\u003e\n\n\u003cbody\u003e\n  ...\n  \u003c!-- add by plugin --\u003e\n  \u003cscript src=\"https://cdn.jsdelivr.net/npm/vue\"\u003e\u003c/script\u003e\n  \u003cscript src=\"https://cdn.jsdelivr.net/npm/vue-router\"\u003e\u003c/script\u003e\n  \u003c!-- add by nuxt --\u003e\n  \u003cscript src=\"/_nuxt/runtime.9458cd8.js\"\u003e\u003c/script\u003e\n  \u003cscript src=\"/_nuxt/commons/app.0872ce0.js\"\u003e\u003c/script\u003e\n  \u003cscript src=\"/_nuxt/vendors~app.7b9299e.js\"\u003e\u003c/script\u003e\n  \u003cscript src=\"/_nuxt/app.28d1ccd.js\"\u003e\u003c/script\u003e\n\u003c/body\u003e\n```\n\nIn the vue-cli configuration file:\n\n```javascript\nconfigureWebpack: (config) =\u003e {\n  config.plugins.push(\n    new HtmlWebpackAssetsInsertPlugin({\n      js: {\n        prepend: true,\n        path: [\"\"],\n      },\n      css: {\n        path: [],\n      },\n    })\n  );\n};\n```\n\nIn the nuxt.js configuration file:\n\n```javascript\nbuild: {\n    extend (config, { isClient }) {\n      if (isClient) {\n        config.plugins.push(new HtmlWebpackAssetsInsertPlugin({\n          js: {\n            prepend: true,\n            path: [\n              '',\n              ''\n            ]\n          },\n          css: {\n            prepend: false\n          }\n        }))\n        // externals config\n        // config.externals = {\n        //   vue: 'Vue',\n        //   axios: 'axios',\n        // }\n      }\n    }\n  }\n```\n\nThe order is important - the plugin must come **after** HtmlWebpackPlugin.\n\n## Options\n\n| Options | Type   | Other |\n| ------- | ------ | ----- |\n| js      | Object |       |\n| css     | Object |       |\n\n### Options(js)\n\n| Options | Type          | Other                                                    |\n| ------- | ------------- | -------------------------------------------------------- |\n| prepend | boolean       | Set the script tags insertion position. Default is true. |\n| path    | Array\u003cstring\u003e | Insert script tags according to array index.             |\n\n### Options(css)\n\n| Options | Type          | Other                                                   |\n| ------- | ------------- | ------------------------------------------------------- |\n| prepend | boolean       | Set the link tags insertion position. Default is false. |\n| path    | Array\u003cstring\u003e | Insert link tags according to array index.              |\n\n## release\nv1.0.4\n- modify readme\n\nv1.0.1\n\n- initial release\n\nv0.0.1\n\n- initial\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwebkong%2Fhtml-webpack-assets-insert-plugin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwebkong%2Fhtml-webpack-assets-insert-plugin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwebkong%2Fhtml-webpack-assets-insert-plugin/lists"}