{"id":36500293,"url":"https://github.com/dongnaebi/egg-vue-ssr-dev-server","last_synced_at":"2026-01-12T02:20:00.921Z","repository":{"id":57220889,"uuid":"228658537","full_name":"dongnaebi/egg-vue-ssr-dev-server","owner":"dongnaebi","description":"vue ssr webpack dev server for eggjs","archived":false,"fork":false,"pushed_at":"2019-12-29T16:34:34.000Z","size":12,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-09-23T10:58:18.603Z","etag":null,"topics":["egg","egg-plugin","proxy","vue","vuessr","webpack","webpack-dev-server"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dongnaebi.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-12-17T16:35:46.000Z","updated_at":"2022-03-03T03:43:47.000Z","dependencies_parsed_at":"2022-08-28T23:23:32.313Z","dependency_job_id":null,"html_url":"https://github.com/dongnaebi/egg-vue-ssr-dev-server","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/dongnaebi/egg-vue-ssr-dev-server","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dongnaebi%2Fegg-vue-ssr-dev-server","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dongnaebi%2Fegg-vue-ssr-dev-server/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dongnaebi%2Fegg-vue-ssr-dev-server/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dongnaebi%2Fegg-vue-ssr-dev-server/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dongnaebi","download_url":"https://codeload.github.com/dongnaebi/egg-vue-ssr-dev-server/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dongnaebi%2Fegg-vue-ssr-dev-server/sbom","scorecard":{"id":351697,"data":{"date":"2025-08-11","repo":{"name":"github.com/dongnaebi/egg-vue-ssr-dev-server","commit":"1fabb79617af9f338956a74bf9d26403bf136169"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2.6,"checks":[{"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":"Code-Review","score":0,"reason":"Found 0/8 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":"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":"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":"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":"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":"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":"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":"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"}},{"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":"License","score":0,"reason":"license file not detected","details":["Warn: project does not have a license file"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"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":"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"}}]},"last_synced_at":"2025-08-18T08:28:00.241Z","repository_id":57220889,"created_at":"2025-08-18T08:28:00.241Z","updated_at":"2025-08-18T08:28:00.241Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28331985,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-12T00:36:25.062Z","status":"online","status_checked_at":"2026-01-12T02:00:08.677Z","response_time":98,"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":["egg","egg-plugin","proxy","vue","vuessr","webpack","webpack-dev-server"],"created_at":"2026-01-12T02:20:00.326Z","updated_at":"2026-01-12T02:20:00.913Z","avatar_url":"https://github.com/dongnaebi.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# egg-vue-ssr-dev-server\n[![NPM version][npm-image]][npm-url]\n\n[npm-image]: https://img.shields.io/npm/v/egg-vue-ssr-dev-server.svg?style=flat-square\n[npm-url]: https://www.npmjs.com/package/egg-vue-ssr-dev-server\n\n## Demo\nhttps://github.com/dongnaebi/egg-vue-ssr-demo\n\n## Install\n```bash\nnpm i egg-vue-ssr-dev-server -D\n```\n## Configuration\nChange ${app_root}/config/plugin.js to enable egg-vue-ssr-dev-server plugin:\n```javascript\n// config/plugin.js\nexports.vueSsrDevServer = {\n  enable: true,\n  package: 'egg-vue-ssr-dev-server'\n}\n```\n\nConfigure build information and proxy in ${app_root}/config/config.local.js, it's important, you must be use it in local environment\n\n#### simple configure:\n```javascript\n// config/config.local.js\nconfig.vueSsrDevServer = {\n  // server webpack config file\n  serverConfig: path.join(appInfo.baseDir, 'build/webpack.server.config.js'),\n  // client webpack config file\n  clientConfig: path.join(appInfo.baseDir, 'build/webpack.client.config.js'),\n  // webpack public path, make sure it same as your webpackConfig.output.publicPath\n  publicPath: '/public/dist/',\n  // dev api proxy, just use it like webpack-dev-server's proxy\n  proxy: {\n    '/api': {\n      target: 'https://eggjs.org/',\n      changeOrigin: true\n    },\n    '/api2': {\n      target: 'https://github.com/',\n      changeOrigin: true\n    }\n  }\n}\n```\n\n## Usage\n\nyou can see full demo in https://github.com/dongnaebi/egg-vue-ssr-demo\n\n### 1. Move your `src` and `build` dir into ${app_root}, `index.html` into ${app_root}/app\n```bash\negg-project\n├── package.json\n├── app\n|   ├── router.js\n│   ├── controller\n│   |   └── ssr.js\n│   ├── public (可选)\n│   |   └── dist\n│   ├── index.html\n├── build // webpack config files\n|   ├── webpack.base.config.js\n|   ├── webpack.client.config.js\n│   ├── webpack.server.config.js\n├── config\n|   ├── plugin.js\n|   ├── config.default.js\n│   ├── config.prod.js\n|   ├── config.local.js\n└── src // your vue project\n|   ├── entry-client.js\n|   ├── entry-server.js\n│   ├── App.vue\n|   ├── app.js\n|   ├── ...\n```\n\nindex.html\n\n```html\n\u003c!DOCTYPE html\u003e\n\u003chtml\u003e\n  \u003chead\u003e\n    \u003cmeta charset=\"utf-8\"\u003e\n  \u003c/head\u003e\n  \u003cbody\u003e\n    \u003c!--vue-ssr-outlet--\u003e\n  \u003c/body\u003e\n\u003c/html\u003e\n```\n### 2. Create ssr.js in your controller\n```javascript\n// app/controller/ssr.js\n'use strict'\n\nconst fs = require('fs')\nconst path = require('path')\nconst { Controller } = require('egg')\nconst { createBundleRenderer } = require('vue-server-renderer')\n\nlet serverBundle\nlet template\nlet clientManifest\n\nclass SsrController extends Controller {\n  async index () {\n    const { ctx, app } = this\n    if (!template) template = fs.readFileSync(path.resolve(__dirname, '../index.html'), 'utf-8')\n\n    if (app.config.env === 'local') {\n      const serverBundleString = await app.memoryFileWorker.requestServerFile('vue-ssr-server-bundle.json')\n      const clientBundleString = await app.memoryFileWorker.requestClientFile('vue-ssr-client-manifest.json')\n      serverBundle = JSON.parse(serverBundleString)\n      clientManifest = JSON.parse(clientBundleString)\n    } else {\n      if (!serverBundle) serverBundle = path.resolve(__dirname, '../public/dist/vue-ssr-server-bundle.json')\n      if (!clientManifest) clientManifest = require(path.resolve(__dirname, '../public/dist/vue-ssr-client-manifest.json'))\n    }\n\n    const renderer = createBundleRenderer(serverBundle, {\n      runInNewContext: false,\n      template,\n      clientManifest,\n      shouldPreload: (file, type) =\u003e {\n        return false\n      },\n      shouldPrefetch: (file, type) =\u003e {\n        return false\n      }\n    })\n\n    // context for SSR\n    const ssrContext = {\n      url: ctx.url\n    }\n\n    let html = ''\n    try {\n      html = await renderer.renderToString(ssrContext)\n    } catch (err) {\n      if (err.code === 404) {\n        ctx.status = 404\n        html = '404 Not Found'\n      } else {\n        ctx.status = 500\n        if (app.config.env === 'local') {\n          html = err.stack\n        } else {\n          html = `500 | SSR Render Error`\n        }\n        console.error(`error during render : ${ctx.url}`)\n        console.error(err.stack)\n      }\n    }\n    ctx.body = html\n  }\n}\n\nmodule.exports = SsrController\n```\n\n### 3. Add you egg router rule at **last line** (let your other rule can work)\n```javascript\n// app/router.js\nrouter.get('*', controller.ssr.index)\n```\n\n### 4. Run\n```bash\nnpm run dev\n# localhost:7001\n```\n\n## Questions \u0026 Suggestions\n\nPlease open an issue [here](https://github.com/dongnaebi/egg-vue-ssr-demo/issues).\n\n## License\n\n[MIT](LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdongnaebi%2Fegg-vue-ssr-dev-server","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdongnaebi%2Fegg-vue-ssr-dev-server","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdongnaebi%2Fegg-vue-ssr-dev-server/lists"}