{"id":20881287,"url":"https://github.com/peakchen90/assets-manifest-plugin","last_synced_at":"2025-09-01T04:38:19.768Z","repository":{"id":42901668,"uuid":"252100760","full_name":"peakchen90/assets-manifest-plugin","owner":"peakchen90","description":"A webpack plugin for entry assets manifest. 一个生成入口资源清单的webpack插件","archived":false,"fork":false,"pushed_at":"2022-03-26T10:39:18.000Z","size":61,"stargazers_count":4,"open_issues_count":3,"forks_count":0,"subscribers_count":1,"default_branch":"dev","last_synced_at":"2025-04-16T09:15:10.941Z","etag":null,"topics":["assets","entrypoints","manifest","plugin","webpack","webpack-plugin"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/assets-manifest-plugin","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/peakchen90.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-04-01T07:17:21.000Z","updated_at":"2022-12-09T10:47:18.000Z","dependencies_parsed_at":"2022-09-01T23:40:32.653Z","dependency_job_id":null,"html_url":"https://github.com/peakchen90/assets-manifest-plugin","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/peakchen90%2Fassets-manifest-plugin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/peakchen90%2Fassets-manifest-plugin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/peakchen90%2Fassets-manifest-plugin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/peakchen90%2Fassets-manifest-plugin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/peakchen90","download_url":"https://codeload.github.com/peakchen90/assets-manifest-plugin/tar.gz/refs/heads/dev","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253777054,"owners_count":21962621,"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":["assets","entrypoints","manifest","plugin","webpack","webpack-plugin"],"created_at":"2024-11-18T07:24:21.088Z","updated_at":"2025-05-12T16:32:37.927Z","avatar_url":"https://github.com/peakchen90.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# assets-manifest-plugin\nA webpack plugin for entry assets manifest.\n一个生成入口资源清单的webpack插件\n\n[![Travis (.org) branch](https://img.shields.io/travis/peakchen90/assets-manifest-plugin/master.svg)](https://travis-ci.org/peakchen90/assets-manifest-plugin)\n[![npm](https://img.shields.io/npm/v/assets-manifest-plugin.svg)](https://www.npmjs.com/package/assets-manifest-plugin)\n[![GitHub](https://img.shields.io/github/license/mashape/apistatus.svg)](https://github.com/peakchen90/assets-manifest-plugin/blob/master/LICENSE)\n\n## 安装\n\n```bash\nnpm i -D assets-manifest-plugin\n\n# or\n\nyarn add -D assets-manifest-plugin\n```\n\n## 配置\n\n\u003e webpack.config.js\n```js\nconst AssetsManifestPlugin = require('assets-manifest-plugin');\n\nmodule.exports = {\n  // ...\n  plugins: [\n    new AssetsManifestPlugin({\n      filename: 'manifest.js'\n    })\n  ]\n}\n```\n\n打包完成后会输出类似下面的一个文件：\n\u003e dist/manifest.js\n```js\n(function(root, factory) {\n  if (typeof exports === 'object' \u0026\u0026 typeof module === 'object') {\n    module.exports = factory();\n  } else if (typeof define === 'function' \u0026\u0026 define.amd) {\n    define(factory);\n  } else if (typeof exports === 'object') {\n    exports['ASSETS_MANIFEST'] = factory();\n  } else {\n    root['ASSETS_MANIFEST'] = factory();\n  }\n})(typeof window !== 'undefined' ? window : this, function() {\n  return {\n    \"main\": {\n      \"js\": [\n        \"js/runtime.6b509e0d.js\",\n        \"js/vendors.066af6ec2.js\",\n        \"js/main.5f10cd1d.js\"\n      ],\n      \"css\": [\n        \"css/vendors.ac89822e.css\",\n        \"css/main.5ceab323.css\"\n      ]\n    }\n  }\n});\n```\n\n## 配置选项\n\n#### entries\n- 类型: `'all' | Array\u003cstring\u003e`\n- 默认: `'all'`\n- 描述: 需要生成资源清单的 entry 名，如果设置为 `'all'`，表示生成全部入口资源清单\n\n#### publicPath\n- 类型: `string`\n- 默认: `null`\n- 描述: 在生成的资源清单路径前加的一段路径，如果该项未配置，则会去使用 `output.publicPath` 的值\n\n#### filename\n- 类型: `string`\n- 默认: `'manifest.js'`\n- 描述: 生成的入口清单文件名（可以带路径），如果是文件格式是 `.js`，这会输出一个 UMD 模块文件，如果文件格式是 `.json`，则输出一个 JSON 文件，推荐生成 UMD 模块\n\n#### minify\n- 类型: `'auto' | boolean`\n- 默认: `'auto'`\n- 描述: 是否压缩生成的资源清单文件，如果设置为 `'auto'`，表示根据 `optimization.minimize` 自动判断是否需要压缩\n\n#### globalName\n- 类型: `string`\n- 默认: `'ASSETS_MANIFEST'`\n- 描述: 生成 UMD 模块的全局变量名\n\n#### disabled\n- 类型: `boolean`\n- 默认: `false`\n- 描述: 是否禁用插件\n\n#### shouldEmit\n- 类型: `boolean`\n- 默认: `true`\n- 描述: 是否将入口资源清单输出到文件\n\n#### merge\n- 类型: `boolean`\n- 默认: `false`\n- 描述: 是否合并之前的资源清单数据（一般用于多个webpack任务打包时共用一份清单文件）\n\n#### onEmit\n- 类型: `(manifest, mergedManifest) =\u003e void`\n- 默认: `null`\n- 描述: 当生成入口资源清单时，执行回调。回调参数是一个包含资源清单的 JSON 对象\n\n#### devServerAutoPublicPath\n- 类型: `boolean`\n- 默认: `true`\n- 描述: 当前是 devServer 模式时，自动设置 publicPath (`http://[ip]:[port]/[publicPath]`)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpeakchen90%2Fassets-manifest-plugin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpeakchen90%2Fassets-manifest-plugin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpeakchen90%2Fassets-manifest-plugin/lists"}