{"id":20139227,"url":"https://github.com/lpreterite/vue-component-rollup-example","last_synced_at":"2026-05-08T12:47:02.526Z","repository":{"id":40815094,"uuid":"180515816","full_name":"lpreterite/vue-component-rollup-example","owner":"lpreterite","description":"vue component project example by rollup","archived":false,"fork":false,"pushed_at":"2022-12-30T17:29:08.000Z","size":389,"stargazers_count":2,"open_issues_count":6,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-13T10:11:28.875Z","etag":null,"topics":["example","gulp","rollup","vue-component"],"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/lpreterite.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":"2019-04-10T06:23:46.000Z","updated_at":"2019-04-10T10:31:00.000Z","dependencies_parsed_at":"2023-01-31T12:16:35.451Z","dependency_job_id":null,"html_url":"https://github.com/lpreterite/vue-component-rollup-example","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/lpreterite%2Fvue-component-rollup-example","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lpreterite%2Fvue-component-rollup-example/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lpreterite%2Fvue-component-rollup-example/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lpreterite%2Fvue-component-rollup-example/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lpreterite","download_url":"https://codeload.github.com/lpreterite/vue-component-rollup-example/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241582557,"owners_count":19985846,"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":["example","gulp","rollup","vue-component"],"created_at":"2024-11-13T21:44:30.482Z","updated_at":"2026-05-08T12:46:57.508Z","avatar_url":"https://github.com/lpreterite.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 基于rollup打包的vue组件仓库样例\n\n这个是记录学习如何使用rollup打包项目的仓库，在工作中遇到的问题将会持续在这个仓库提交更新，如果你一样遇到此类问题希望能在issues见到你的反馈，PR更是欢迎👏\n\n包含功能：\n\n- 打包代码（支持Vue文件）\n- 单元测试\n- 测试覆盖报告\n\n## 如何使用\n\n**已做为SAO模板发布了👏**\n\n\u003e sao模板暂时去掉了gulp支持。\n\n先安装sao\n\n```bash\nyarn global add sao\n# or\nnpm i -g sao\n```\n\n### From npm\n\n```bash\nsao esmodule-mold my-project\n```\n\n### From git\n\n```bash\nsao lpreterite/sao-esmodule-mold my-project\n```\n\n\n等待安装完成后就能使用以下命令看效果了👍\n\n### 包含命令\n\n- `build`: 打包构建项目\n- `watch`: 监听文件变化，基于rollup\n- `test`: 测试并显示测试覆盖情况，基于nyc和mocha\n- `pretest`: 测试前调用，构建代码\n- `prepublish`: 发布前调用, 测试代码\n\n#### 如何使用命令\n\n```sh\n// 打包构建项目\nnpm run build\n\n// 监听文件变化\nnpm run watch\n\n// 测试并显示测试覆盖情况\nnpm run test\n```\n\n### gulp命令\n\n在写rollup配置的过程中遇到了一些问题，想用gulp的某些插件解决问题。要说意义嘛！我可以很肯定的说：没有任何意义😒！既然都写了就写完它，之后就有了gulp这部分的样例了🔨，看不下去的欢迎PR补充。\n\n- `gulp` or `gulp:build`: 打包构建项目\n- `watch`: 监听文件变化，基于gulp（目前有bug未解决，欢迎PR）\n- `test`: 测试并显示测试覆盖情况，用`gulp-shell`调起`nyc mocha`\n\n## 各插件功能及分工\n\n- `rollup`：简单易用的打包工具，用在组件（或独立功能模块）的打包上是挺方便的。\n- `mocha`：单元测试工具，你可以使用其他工具来替换他，不过这个仓库暂时没有其他测试工具的例子。\n- `chai`：断言库，一般和测试工具一并使用。\n- `nyc`：生成测试代码的覆盖报告工具，一般和测试工具一并使用。\n- `reify`：能让你放心使用ES2015的库，在执行前引入就可以了，这个仓mocha测试运行时会预先加载所以测试代码也能安心使用ES2015代码。\n- `jsdom`：模拟浏览器环境的工具，在测试vue组件时会用到。","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flpreterite%2Fvue-component-rollup-example","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flpreterite%2Fvue-component-rollup-example","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flpreterite%2Fvue-component-rollup-example/lists"}