{"id":19060384,"url":"https://github.com/hxfdarling/html-inline-assets-loader","last_synced_at":"2025-02-22T02:15:45.021Z","repository":{"id":57267419,"uuid":"156091057","full_name":"hxfdarling/html-inline-assets-loader","owner":"hxfdarling","description":"auto compile relative  css/js/image file in html file","archived":false,"fork":false,"pushed_at":"2019-03-25T07:33:10.000Z","size":185,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-19T13:46:44.691Z","etag":null,"topics":["html","html-webpack-plugin","inline-css","inline-javascript","loader","webpack"],"latest_commit_sha":null,"homepage":"","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/hxfdarling.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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-11-04T14:33:13.000Z","updated_at":"2019-03-25T07:33:12.000Z","dependencies_parsed_at":"2022-09-02T03:40:21.048Z","dependency_job_id":null,"html_url":"https://github.com/hxfdarling/html-inline-assets-loader","commit_stats":null,"previous_names":[],"tags_count":17,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hxfdarling%2Fhtml-inline-assets-loader","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hxfdarling%2Fhtml-inline-assets-loader/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hxfdarling%2Fhtml-inline-assets-loader/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hxfdarling%2Fhtml-inline-assets-loader/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hxfdarling","download_url":"https://codeload.github.com/hxfdarling/html-inline-assets-loader/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240114326,"owners_count":19749837,"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":["html","html-webpack-plugin","inline-css","inline-javascript","loader","webpack"],"created_at":"2024-11-09T00:15:09.977Z","updated_at":"2025-02-22T02:15:45.003Z","avatar_url":"https://github.com/hxfdarling.png","language":"JavaScript","readme":"# html-inline-assets-loader\n\n自动处理 html 文件中的相对引用 css/js/html 资源 文件，直接内联到 html 文件中，或者自动编译并拷贝到 dist 目录\n\n# useage\n\n```js\nconst configureHtmlLoader = () =\u003e {\n  return {\n    test: /\\.(html|njk|nunjucks)$/,\n    use: [\n      resolve('html-loader'),\n      // 自动处理html中的相对路径引用 css/js/html文件\n      resolve('html-inline-assets-loader'),\n      {\n        loader: resolve('nunjucks-html-loader'),\n        options: {\n          // Other super important. This will be the base\n          // directory in which webpack is going to find\n          // the layout and any other file index.njk is calling.\n          searchPaths: ['./src'],\n        },\n      },\n    ],\n  };\n};\n```\n\nHTML file\n\n```html\n\u003c!--auto transform and copy--\u003e\n\u003clink rel=\"stylesheet\" href=\"./assets/css/reset.css\"/\u003e\n\u003cscript href='./assets/rem.js'\u003e\u003c/script\u003e\n\n\u003c!--inline code--\u003e\n\u003clink rel='html' href=\"./assets/html/meta.html\"/\u003e\n\u003clink rel=\"stylesheet\" href=\"./assets/css/reset.css?_inline\"/\u003e\n\u003cscript href='./assets/rem.js?_inline'\u003e\u003c/script\u003e\n\n\u003c!-- only process.env.NODE_ENV==='production' --\u003e\n\u003cscript href='./assets/rem.js?_dist'\u003e\u003c/script\u003e\n```\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhxfdarling%2Fhtml-inline-assets-loader","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhxfdarling%2Fhtml-inline-assets-loader","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhxfdarling%2Fhtml-inline-assets-loader/lists"}