{"name":"@rspack/dev-server","version":"2.0.0","license":"MIT","_id":"@rspack/dev-server@2.0.0","maintainers":[{"name":"hardfist","email":"1562502418@qq.com"},{"name":"chenjiahan","email":"416417567@163.com"}],"homepage":"https://github.com/rstackjs/rspack-dev-server","bugs":{"url":"https://github.com/rstackjs/rspack-dev-server/issues"},"dist":{"shasum":"e617c6203362d7860e011ca5c493fc4ae1113e3a","tarball":"http://registry-npm.ywwl.com/@rspack/dev-server/download/@rspack/dev-server-2.0.0.tgz","fileCount":45,"integrity":"sha512-bSdIlt8Nq1Q2K0Gv+AMmETMKsLjEgTtL8DNlDtSe14cdtBrF0Z8kfpKUpgUKb5i0O7CZ5pmPzVwHZIEqMrCJNQ==","signatures":[{"sig":"MEQCIF3eavr2BIfUqsdVGEo2Gu5C/pK4iaqvs1lqm2QFuTW5AiBoZSXG/1RqHjwNufe+XxBK/fNUMY8nE3YZoGeeznUHqw==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@rspack%2fdev-server@2.0.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":919371,"size":172611,"noattachment":false,"key":"/@rspack/dev-server/-/@rspack/dev-server-2.0.0.tgz"},"type":"module","types":"./dist/index.d.ts","engines":{"node":"^20.19.0 || >=22.12.0"},"exports":{".":"./dist/index.js","./client/*":"./client/*.js","./client/*.js":"./client/*.js","./package.json":"./package.json"},"gitHead":"30d0906da50ccc4734ab91cc6f1128d63cd99777","scripts":{"dev":"rslib -w","bump":"npx bumpp","lint":"rslint","test":"pnpm run test:install && pnpm run test:type && rstest","build":"rslib","format":"prettier --write .","test:type":"pnpm run build && pnpm --dir tests run type-check","lint:write":"rslint --fix","prettier:ci":"prettier --check .","test:install":"cross-env ./node_modules/.bin/puppeteer browsers install chrome"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:83f74909-e0a9-444e-a812-2fe934570267"}},"repository":{"url":"git+https://github.com/rstackjs/rspack-dev-server.git","type":"git"},"_npmVersion":"11.12.1","description":"Development server for Rspack","directories":{},"nano-staged":{"*.{js,jsx,ts,tsx,mjs,cjs}":["npm run format","rslint --fix"],"*.{yaml,yml,json,md,json5}":["npm run format"]},"_nodeVersion":"24.14.1","dependencies":{"@rspack/dev-middleware":"^2.0.1"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"packageManager":"pnpm@10.33.0","devDependencies":{"ws":"^8.20.0","hono":"^4.12.14","open":"^11.0.0","express":"^5.2.1","p-retry":"^7.1.1","chokidar":"^5.0.0","prettier":"3.8.3","@types/ws":"8.18.1","cross-env":"^10.1.0","ipaddr.js":"^2.3.0","puppeteer":"^24.40.0","http-proxy":"^1.18.1","selfsigned":"^5.5.0","typescript":"^6.0.2","@rslib/core":"^0.21.1","@types/node":"^24.12.2","nano-staged":"^0.9.0","@rslint/core":"^0.4.2","@rspack/core":"2.0.0-rc.0","@rstest/core":"^0.9.7","connect-next":"^4.0.1","serve-static":"^2.2.1","launch-editor":"^2.13.2","react-refresh":"0.18.0","http-compression":"^1.1.3","simple-git-hooks":"^2.13.1","@hono/node-server":"^1.19.14","@types/mime-types":"3.0.1","@types/serve-static":"^2.2.0","require-from-string":"^2.0.2","@types/trusted-types":"^2.0.7","http-proxy-middleware":"4.0.0-beta.3","@microsoft/api-extractor":"^7.58.2","@rspack/plugin-react-refresh":"1.6.2","connect-history-api-fallback":"^2.0.0","@types/connect-history-api-fallback":"^1.5.4"},"peerDependencies":{"selfsigned":"^5.0.0","@rspack/core":"^2.0.0-0"},"simple-git-hooks":{"pre-commit":"npx nano-staged"},"peerDependenciesMeta":{"selfsigned":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/dev-server_2.0.0_1776588681976_0.5598550007034047","host":"s3://npm-registry-packages-npm-production"},"readme":"# @rspack/dev-server\n\n<p>\n  <a href=\"https://npmjs.com/package/@rspack/dev-server?activeTab=readme\"><img src=\"https://img.shields.io/npm/v/@rspack/dev-server?style=flat-square&colorA=564341&colorB=EDED91\" alt=\"npm version\" /></a>\n  <a href=\"https://npmcharts.com/compare/@rspack/dev-server?minimal=true\"><img src=\"https://img.shields.io/npm/dm/@rspack/dev-server.svg?style=flat-square&colorA=564341&colorB=EDED91\" alt=\"downloads\" /></a>\n  <a href=\"https://nodejs.org/en/about/previous-releases\"><img src=\"https://img.shields.io/node/v/@rspack/dev-server.svg?style=flat-square&colorA=564341&colorB=EDED91\" alt=\"node version\"></a>\n  <a href=\"https://github.com/rstackjs/rspack-dev-server/blob/main/LICENSE\"><img src=\"https://img.shields.io/badge/License-MIT-blue.svg?style=flat-square&colorA=564341&colorB=EDED91\" alt=\"license\" /></a>\n</p>\n\nUse Rspack with a development server that provides live reloading. This should be used for development only.\n\n## Versions\n\n- `2.x`: For Rspack v2, see [v1 -> v2](./docs/migrate-v1-to-v2.md) for migration guide.\n- `1.x`: For Rspack v1, see [v1.x - README](https://github.com/rstackjs/rspack-dev-server/tree/v1.x#rspackdev-server) for usage guide.\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 -D @rspack/dev-server @rspack/core\n\n# yarn\n$ yarn add -D @rspack/dev-server @rspack/core\n\n# pnpm\n$ pnpm add -D @rspack/dev-server @rspack/core\n\n# bun\n$ bun add -D @rspack/dev-server @rspack/core\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 -D @rspack/cli\n\n# yarn\n$ yarn add -D @rspack/cli\n\n# pnpm\n$ pnpm add -D @rspack/cli\n\n# bun\n$ bun add -D @rspack/cli\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> See [CLI](https://rspack.rs/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.mjs\nexport default {\n  devServer: {\n    // the configuration of the development server\n    port: 8080,\n  },\n};\n```\n\n> See [Rspack - devServer](https://rspack.rs/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 config from './rspack.config.mjs';\n\nconst compiler = rspack(config);\nconst devServerOptions = {\n  ...config.devServer,\n  // override\n  port: 8888,\n};\n\nconst server = new RspackDevServer(devServerOptions, compiler);\n\nserver.startCallback(() => {\n  console.log('Successfully started server on http://localhost:8888');\n});\n```\n\n## Credits\n\nThis repository is forked from [webpack-dev-server](https://github.com/webpack/webpack-dev-server). It adapts the original implementation for the Rspack ecosystem, bridging behavioral differences with webpack while adding Rspack-specific capabilities.\n\n> Thanks to the [webpack-dev-server](https://github.com/webpack/webpack-dev-server) maintainers and its original creator, [@sokra](https://github.com/sokra).\n\n## License\n\n[MIT licensed](https://github.com/rstackjs/rspack-dev-server/blob/main/LICENSE).\n","publish_time":1776588682185,"_cnpm_publish_time":1776588682185,"dist-tags":{"alpha":"1.0.0-alpha.5","beta":"2.0.0-beta.7","canary":"0.7.6-canary-fd6c40d-20240918093542","latest":"2.2.2","nightly":"0.7.6-canary-f272bd8-20240625122346","rc":"2.0.0-rc.3","snapshot":"0.0.0-canary-2d5264852-20230525090643"}}