{"id":21022953,"url":"https://github.com/cklwblove/vue-cli-plugin-dll","last_synced_at":"2026-04-17T06:33:15.614Z","repository":{"id":80970421,"uuid":"185386735","full_name":"cklwblove/vue-cli-plugin-dll","owner":"cklwblove","description":"Vue CLI 3 plugin for Webpack DllPlugin and DllReferencePlugin,improve compilation speed.","archived":false,"fork":false,"pushed_at":"2019-05-31T04:32:32.000Z","size":30,"stargazers_count":0,"open_issues_count":1,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-09-10T07:43:38.707Z","etag":null,"topics":["dll-plugin","dllreferenceplugin","vue-cli3","webpack"],"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/cklwblove.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-05-07T11:22:30.000Z","updated_at":"2019-05-31T04:32:34.000Z","dependencies_parsed_at":null,"dependency_job_id":"f77fc72d-b4f7-44aa-8f9b-552910ec4a50","html_url":"https://github.com/cklwblove/vue-cli-plugin-dll","commit_stats":{"total_commits":13,"total_committers":1,"mean_commits":13.0,"dds":0.0,"last_synced_commit":"7ca080ef7f5e588cc8713996b6c217cb33b26259"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/cklwblove/vue-cli-plugin-dll","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cklwblove%2Fvue-cli-plugin-dll","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cklwblove%2Fvue-cli-plugin-dll/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cklwblove%2Fvue-cli-plugin-dll/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cklwblove%2Fvue-cli-plugin-dll/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cklwblove","download_url":"https://codeload.github.com/cklwblove/vue-cli-plugin-dll/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cklwblove%2Fvue-cli-plugin-dll/sbom","scorecard":{"id":284732,"data":{"date":"2025-08-11","repo":{"name":"github.com/cklwblove/vue-cli-plugin-dll","commit":"7ca080ef7f5e588cc8713996b6c217cb33b26259"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3,"checks":[{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Code-Review","score":0,"reason":"Found 0/13 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}}]},"last_synced_at":"2025-08-17T16:56:50.433Z","repository_id":80970421,"created_at":"2025-08-17T16:56:50.433Z","updated_at":"2025-08-17T16:56:50.433Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31918558,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-16T18:22:33.417Z","status":"online","status_checked_at":"2026-04-17T02:00:06.879Z","response_time":62,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["dll-plugin","dllreferenceplugin","vue-cli3","webpack"],"created_at":"2024-11-19T11:15:33.030Z","updated_at":"2026-04-17T06:33:15.572Z","avatar_url":"https://github.com/cklwblove.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# vue-cli-plugin-dll \n\nVue CLI 3 plugin for Dll and DllReference\n\n## 起步\n\n\u003e 确保你安装的是 vue-cli 3.x.x 版本\n```\n$ vue -V\n```\n\n### 安装\n``` bash\n$ vue add @liwb/vue-cli-plugin-dll \n\n# OR \n\n$ vue invoke @liwb/vue-cli-plugin-dll \n```\n\n\n### 快速开始\n\u003e 最方便的配置\n\n#### 你可以在`vue.config.js` 文件中的pluginOptions中定义一个dll参数对象。\n```javascript\n// vue.config.js\n\n module.exports = {\n    pluginOptions: {\n        dll: {\n            entry: ['vue', 'vue-router']\n        }\n    }\n }\n```\n\n### 生成Dll文件\n\n```bash\n$ npm run dll\n\n#OR\n\n$ npx vue-cli-service dll\n```\n\n## 配置参数\n\u003e vue.config.js:\n``` javascript\nmodule.exports = {\n  // Other options...\n\n  pluginOptions: {\n     dll: {\n       // 入口配置\n      entry: ['vue'],\n      // dll 资源输出目录，但不是最终 dist 目录下 index.html 引用的路径\n      output: path.join(__dirname, './public/vendor'),\n\n      // 是否开启 DllReferencePlugin,\n\n      // 1. 如果你需要在开发环境中不采用开启分包模式，你可以配置open为false。\n      // 例如，我们入口配置为 entry: ['vue']， 我们执行npm run dll 构建了vendor包。\n      // 在npm run serve的时候，如果默认open开启的情况下，其实开发环境采用的vue是生成环境的包，因为我们dll命令构建的就是生成环境的包。\n      // 这会让我们在开发环境中无法看到vue给我们带来的友好提示建议。\n      // 我们可以配置open : process.env.NODE_ENV === 'production'，只在生成环境开启DllReferencePlugin\n\n      // 2. 'auto' 参数会自动识别是否有先执行npm run dll生成分包，如果没有的情况下则不开启dll。\n      open: 'auto',\n\n      // 自动注入到index.html\n      // 在构建其他命令的时候，如果开启了自动注入。程序会手动将output中生成的*.dll.js 文件自动注入到index.html中。\n      inject: true,\n    }\n  }\n}\n```\n\n## options\n\n| 参数 | 类型/值集 | 描述| 默认值 | 是否必填 |\n| :--- | :--- | :--- | :--- | :--- |\n| entry | Object/Array/String | 入口配置 | null | true \n| open | true/false/'auto' | 启用 DllReferencePlugin  | 'auto' | false \n| output | Object | 打包输出配置 |  | false \n| output.path | String | 打包后chunk和manifest.json存放的目录 | 'yourProjectPath/public/vendor' | false \n| inject | Boolean | 自动将打包的vendor注入到index.html | true |  false\n| cacheFilePath | String | 将打包后的所有资源路径保存到一个文件(绝对目录路径) | 'yourProjectPath/node_modules/vue-cli-plugin-dll/src' |  false\n\n\n\n\n## 更多示例\n### entry config\n``` javascript\nmodule.exports = {\n  // Other options...\n\n  pluginOptions: {\n      dll: {\n           // 单入口\n          entry: ['vue', 'axios'],\n\n          // 多入口\n          entry: {\n            vendorNameOne: ['vue-router'],\n            vendorNameTwo: ['vue-vuex'], \n         }\n      }\n   }\n}\n```\n\n### open config\n\u003e 增加 webpack.DllReferencePlugin 插件\n``` javascript\nmodule.exports = {\n  // Other options...\n\n  pluginOptions: {\n      dll: {\n          entry: ['vue'],\n          // 只在生产环境加入 webpack.DllReferencePlugin 插件\n          open: process.env.NODE_ENV === 'production',      \n      }\n   }\n}\n```\n### inject config\n\u003e  是否自动将执行dll命令执行打包的vendor包自动注入到index.html中去\n``` javascript\nmodule.exports = {\n  // Other options...\n\n  pluginOptions: {\n      dll: {\n        entry: ['vue'],\n        // 如果你手动的在index.html 中引用了 打包完成后的vendor, 你可以关闭注入。\n        inject: false\n      }\n   }\n}\n```\n\n### output config\n\u003e  打包vendor文件输出配置\n``` javascript\nmodule.exports = {\n  // Other options...\n\n  pluginOptions: {\n      dll: {\n        entry: ['vue'],\n        // 可以打包完的vendor文件放到指定的位置\n        output: path.resolve(__dirname, './public/vendor')\n\n        // or\n        output: {\n          path: path.resolve(__dirname, './public/vendor')\n        }\n      }\n   }\n}\n```\n\n\n### cacheFilePath config\n\n在了解这个配置之前，先简单了解一下`vue-cli-plugin-dll`的vendor文件获取机制，在获取vendor文件的时候有两种方式实现。\n1. 在生成vendor文件的时候将所有文件路径以文件（cache.dll.json）的方式存储起来，在自动注入的时候去获取，这样能准确获取最新一次打包完成的所有文件路径。\n2. 通过入口名模糊匹配到文件手动注入。这种方式有很大的不可确定因素，可能导致多余文件的匹配从而引用混乱。\n所以建议采用第一种方式（默认方式）进行，第二种方式只是作为备选方案。\n\n在第一种方式的实现上，`vue-cli-plugin-dll`插件默认将文件存储在 `vue-cli-plugin-dll`的src目录下，这种情况会导致两个问题\n1. 在线上部署机器中不存在缓存文件导致构建出现问题，\n2. 在升级插件包的时候缓存丢失导致构建出现问题。\n   \n了解了手动注入的文件获取机制后，为了解决此项问题，我们加入了`cache.dll.json`文件目录路径的配置，该配置可以将`npm run dll`生成的`cache.dll.json`存放在指定位置，从而避免以上问题\n``` javascript\nmodule.exports = {\n  // Other options...\n\n  pluginOptions: {\n      dll: {\n        entry: ['vue'],\n        // 目录的绝对路径\n        cacheFilePath: path.resolve(__dirname, './public')\n      }\n   }\n}\n```\n\n\n\n### 按需加载\n由于预打包机制跟主打包机制是完全分割的，所以我们只能采用另外一种方式进行模拟按需打包\n\u003e\u003e 在这个例子中，以element-ui为例子，做按需加载部分组件。\n新建一个element.js文件在项目中（此例子将element.js和main.js入口文件同级）\n```\n// 引入css\nimport 'element-ui/lib/theme-chalk/index.css'\n// 你需要在这里加载你需要用到的组件\nimport  {Input} from 'element-ui'\n\nconst element = {\n\n  install: function (Vue) {\n    Vue.component(Input.name, Input)\n  }\n}\nexport default elemen\n```\n然后在vue.config.js中加上配置\n```\n// vue.config.js\nmodule.exports = {\n  // 其他配置..\n\n  pluginOptions: {\n    dll: {\n      entry: {\n        // 你新加的element.js文件路径\n        index: ['./src/element.js'],\n      }\n    }\n  },\n} \n```\n在你的入口文件(main.js)引入这个文件并且注册， eg:\n```\nimport element from './element.js'\nVue.use(element)\n```\n然后执行： npn run dll\n\n注意点：\n\n1. 在使用这个分包之前，你要确定好你已经按照elementUI做好按需加载的步骤，配置好babel-plugin-component\n2. 每一次有element.js有改动，需要重新打包一次最新的。执行命令 npm run dll\n\n## 参考\n[fingerpan/vue-cli-plugin-dll](https://github.com/fingerpan/vue-cli-plugin-dll)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcklwblove%2Fvue-cli-plugin-dll","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcklwblove%2Fvue-cli-plugin-dll","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcklwblove%2Fvue-cli-plugin-dll/lists"}