{"id":15228235,"url":"https://github.com/web-infra-dev/rspack-dev-server","last_synced_at":"2025-04-14T10:22:15.095Z","repository":{"id":257804159,"uuid":"861620940","full_name":"web-infra-dev/rspack-dev-server","owner":"web-infra-dev","description":"Dev server for Rspack, provides the same API as webpack-dev-server.","archived":false,"fork":false,"pushed_at":"2025-03-13T09:34:45.000Z","size":278,"stargazers_count":10,"open_issues_count":3,"forks_count":3,"subscribers_count":7,"default_branch":"main","last_synced_at":"2025-03-23T13:02:22.985Z","etag":null,"topics":["devserver","rspack"],"latest_commit_sha":null,"homepage":"https://rspack.dev/config/dev-server","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/web-infra-dev.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2024-09-23T08:33:14.000Z","updated_at":"2025-03-17T20:39:47.000Z","dependencies_parsed_at":null,"dependency_job_id":"766524f3-3ffe-43b4-9dce-752d333add4c","html_url":"https://github.com/web-infra-dev/rspack-dev-server","commit_stats":{"total_commits":29,"total_committers":6,"mean_commits":4.833333333333333,"dds":"0.24137931034482762","last_synced_commit":"48c33707ba7d60c76af5c8a197b5afe252b18b75"},"previous_names":["web-infra-dev/rspack-dev-server"],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/web-infra-dev%2Frspack-dev-server","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/web-infra-dev%2Frspack-dev-server/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/web-infra-dev%2Frspack-dev-server/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/web-infra-dev%2Frspack-dev-server/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/web-infra-dev","download_url":"https://codeload.github.com/web-infra-dev/rspack-dev-server/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248860115,"owners_count":21173365,"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":["devserver","rspack"],"created_at":"2024-09-29T00:01:01.826Z","updated_at":"2025-04-14T10:22:15.073Z","avatar_url":"https://github.com/web-infra-dev.png","language":"JavaScript","readme":"\u003cpicture\u003e\n  \u003csource media=\"(prefers-color-scheme: dark)\" srcset=\"https://assets.rspack.dev/rspack/rspack-banner-plain-dark.png\"\u003e\n  \u003cimg alt=\"Rspack Banner\" src=\"https://assets.rspack.dev/rspack/rspack-banner-plain-light.png\"\u003e\n\u003c/picture\u003e\n\n# @rspack/dev-server\n\n\u003cp\u003e\n  \u003ca href=\"https://npmjs.com/package/@rspack/dev-server?activeTab=readme\"\u003e\u003cimg src=\"https://img.shields.io/npm/v/@rspack/dev-server?style=flat-square\u0026colorA=564341\u0026colorB=EDED91\" alt=\"npm version\" /\u003e\u003c/a\u003e\n  \u003ca href=\"https://npmcharts.com/compare/@rspack/dev-server?minimal=true\"\u003e\u003cimg src=\"https://img.shields.io/npm/dm/@rspack/dev-server.svg?style=flat-square\u0026colorA=564341\u0026colorB=EDED91\" alt=\"downloads\" /\u003e\u003c/a\u003e\n  \u003ca href=\"https://nodejs.org/en/about/previous-releases\"\u003e\u003cimg src=\"https://img.shields.io/node/v/@rspack/dev-server.svg?style=flat-square\u0026colorA=564341\u0026colorB=EDED91\" alt=\"node version\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://github.com/web-infra-dev/rspack-dev-server/blob/main/LICENSE\"\u003e\u003cimg src=\"https://img.shields.io/badge/License-MIT-blue.svg?style=flat-square\u0026colorA=564341\u0026colorB=EDED91\" alt=\"license\" /\u003e\u003c/a\u003e\n\u003c/p\u003e\n\nUse Rspack with a development server that provides live reloading. This should be used for development only.\n\n\u003e `@rspack/dev-server` is based on `webpack-dev-server@5`\n\n## Installation\n\nFirst of all, install `@rspack/dev-server` and `@rspack/core` by your favorite package manager:\n\n```bash\n# npm\n$ npm install @rspack/dev-server @rspack/core --save-dev\n\n# yarn\n$ yarn add @rspack/dev-server @rspack/core --dev\n\n# pnpm\n$ pnpm add @rspack/dev-server @rspack/core --save-dev\n\n# bun\n$ bun add @rspack/dev-server @rspack/core -D\n```\n\n## Usage\n\nThere are two recommended ways to use `@rspack/dev-server`:\n\n### With the CLI\n\nThe easiest way to use it is with the [`@rspack/cli`](https://www.npmjs.com/package/@rspack/cli).\n\nYou can install it in your project by:\n\n```bash\n# npm\n$ npm install @rspack/cli --save-dev\n\n# yarn\n$ yarn add @rspack/cli --dev\n\n# pnpm\n$ pnpm add @rspack/cli --save-dev\n\n# bun\n$ bun add @rspack/cli -D\n```\n\nAnd then start the development server by:\n\n```bash\n# with rspack.config.js\n$ rspack serve\n\n# with custom config file\n$ rspack serve -c ./your.config.js\n```\n\n\u003e See [CLI](https://rspack.dev/api/cli) for more details.\n\nWhile starting the development server, you can specify the configuration by the `devServer` field of your Rspack config file:\n\n```js\n// rspack.config.js\nmodule.exports = {\n  // ...\n  devServer: {\n    // the configuration of the development server\n    port: 8080\n  },\n};\n```\n\n\u003e See [DevServer](https://rspack.dev/config/dev-server) for all configuration options.\n\n### With the API\n\nWhile it's recommended to run `@rspack/dev-server` via the CLI, you may also choose to start a server via the API.\n\n```js\nimport { RspackDevServer } from \"@rspack/dev-server\";\nimport rspack from \"@rspack/core\";\nimport rspackConfig from './rspack.config.js';\n\nconst compiler = rspack(rspackConfig);\nconst devServerOptions = {\n  ...rspackConfig.devServer,\n  // override\n  port: 8888\n};\n\nconst server = new RspackDevServer(devServerOptions, compiler);\n\nserver.startCallback(() =\u003e {\n  console.log('Successfully started server on http://localhost:8888');\n});\n```\n\n\u003e Cause `@rspack/dev-server` is based on `webpack-dev-server@5`, you can see the [webpack-dev-server API](https://webpack.js.org/api/webpack-dev-server/) for more methods of the server instance.\n\n## Credits\n\nThanks to the [webpack-dev-server](https://github.com/webpack/webpack-dev-server) project created by [@sokra](https://github.com/sokra)\n\n## License\n\n[MIT licensed](https://github.com/web-infra-dev/rspack-dev-server/blob/main/LICENSE).\n","funding_links":[],"categories":["Libraries"],"sub_categories":["Unplugin"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fweb-infra-dev%2Frspack-dev-server","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fweb-infra-dev%2Frspack-dev-server","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fweb-infra-dev%2Frspack-dev-server/lists"}