{"id":21069095,"url":"https://github.com/styx11/vue-ssr-base","last_synced_at":"2026-04-20T19:32:01.853Z","repository":{"id":97161619,"uuid":"245152722","full_name":"Styx11/vue-ssr-base","owner":"Styx11","description":"🔧basic construction of vue ssr, it's a boilerplate that you can start your own app","archived":false,"fork":false,"pushed_at":"2020-05-08T13:46:41.000Z","size":49,"stargazers_count":0,"open_issues_count":0,"forks_count":3,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-10-15T02:02:07.978Z","etag":null,"topics":["koa2","koa2-middleware","vue-ssr","webpack-dev-middleware","webpack-hot-middleware","webpack-v4","webpack4-koa2"],"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/Styx11.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":"2020-03-05T12:05:17.000Z","updated_at":"2021-02-11T04:39:20.000Z","dependencies_parsed_at":null,"dependency_job_id":"3215f311-b896-4f99-8f87-ecaaf7208b2b","html_url":"https://github.com/Styx11/vue-ssr-base","commit_stats":null,"previous_names":[],"tags_count":0,"template":true,"template_full_name":null,"purl":"pkg:github/Styx11/vue-ssr-base","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Styx11%2Fvue-ssr-base","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Styx11%2Fvue-ssr-base/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Styx11%2Fvue-ssr-base/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Styx11%2Fvue-ssr-base/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Styx11","download_url":"https://codeload.github.com/Styx11/vue-ssr-base/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Styx11%2Fvue-ssr-base/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32062317,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-20T11:35:06.609Z","status":"ssl_error","status_checked_at":"2026-04-20T11:34:48.899Z","response_time":94,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6: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":["koa2","koa2-middleware","vue-ssr","webpack-dev-middleware","webpack-hot-middleware","webpack-v4","webpack4-koa2"],"created_at":"2024-11-19T18:31:46.450Z","updated_at":"2026-04-20T19:32:01.830Z","avatar_url":"https://github.com/Styx11.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Vue-SSR-Demo\n\n\u003e basic contraction of vue-ssr project\n\n## 📝Desc\n\n本 repo 只包含一个简单的 Vue SSR 样例，重点在于展示服务端渲染应有的基本配置\n\n由于服务端渲染的配置几乎包含了现代前端构建的所有知识，所以我想借这个项目抽离出具有普适性的基础结构，并方便以后的使用\n\n我额外写了几篇关于这个构建过程的总结，其中包括 Webpack 中间件的源码解析，希望对你有所帮助：\n\n[上篇](https://styx11.github.io/blog/FontEnd_Construction/ssr_first_part.html) 介绍开始一个 Vue SSR 项目所需的基础配置\n\n[中篇](https://styx11.github.io/blog/FontEnd_Construction/ssr_second_part.html) 介绍 Vue SSR 应用如何与 Koa2 服务器结合\n\n[下篇](https://styx11.github.io/blog/FontEnd_Construction/ssr_third_part.html) 重点总结基于 Webpack4 和 Koa2 的开发模式，其中涉及中间件的适配\n\n[devMiddleware 源码解析](https://styx11.github.io/blog/FontEnd_Construction/devMiddleware.html) 总结在适配`webpack-dev-middleware`中间件过程中我所学到的\n\n[hotMiddleware 源码解析](https://styx11.github.io/blog/FontEnd_Construction/hotMiddleware.html) 总结在适配`webpack-hot-middleware`中间件过程中我所学到的\n\n## ✨Features\n这个基础结构提供了以下功能：\n* 基于`.vue`文件\n* `vue-router`共用路由\n* 基于 Wepack4 的构建配置\n* 一个 Koa2 服务器\n* `micro-cacheing`缓存策略\n* `@koa/router`中间件提供路由功能\n* `koa-static-server`中间件提供文件服务\n* 基于 Webpack4 和 Koa2 的开发模式\n\n## 🚨Notes\n* 本 repo 使用 webpack v4+，某些你所熟知的配置，例如 `webpack.optimize.CommonsChunkPlugin` 会不可用，具体的迁移须知参考[To v4 from v3](https://webpack.docschina.org/migrate/4/)\n\n* 本 repo 使用 webpack v4+，其中将 `es6` 模块导出为 `commonjs2` 模块时会将导出函数或默认（default）内容挂载在 `module` 对象上，这会导致   `createBundleRenderer` 无法创建 `renderer`（已知的 `vue-server-renderer v2.6.11` 版本），而不是像 [Vue-SSR](https://ssr.vuejs.org/zh/guide/structure.html#entry-server-js) 文档那样覆盖 `module` 对象，所以在 [server.entry.js](./src/server.entry.js) 中我们直接使用了 `commonjs2` 模块做 **“中间适配”**\n\n* 使用时请确保某些构建工具的版本，例如 Vue 文件编译器 `vue-template-compiler` 必须与 `vue` 版本匹配\n\n## 📦Build\n```\n# install dependencies\nnpm install\n\n# build for production with minification\nnpm run build\n\n# dev mode in webpack4\nnpm run dev\n\n# start the production node server\nnpm run start\n\n```\n\n## 📄LICENSE\nMIT.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstyx11%2Fvue-ssr-base","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstyx11%2Fvue-ssr-base","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstyx11%2Fvue-ssr-base/lists"}