{"name":"@rspack/dev-server","version":"2.1.0","license":"MIT","_id":"@rspack/dev-server@2.1.0","maintainers":[{"name":"hardfist3","email":"1562502418@qq.com"},{"name":"chenjiahan","email":"416417567@163.com"}],"homepage":"https://github.com/rstackjs/rspack-dev-server","bugs":"https://github.com/rstackjs/rspack-dev-server/issues","dist":{"shasum":"733386d7e6f53138d8cc210cd8e750e61d5ee991","tarball":"http://registry-npm.ywwl.com/@rspack/dev-server/download/@rspack/dev-server-2.1.0.tgz","fileCount":45,"integrity":"sha512-WkCi6bWThVX5Ziv04srPaRoCoUY5FJolO4gqzE7xPO0XbXShsGnwn0vGD0DFfnYFcw9VSsxlmeCDV799lNYclA==","signatures":[{"sig":"MEYCIQDlDS/fvcHyscZxAExAivQ03CY31JG5jwo5gel2ndMebAIhANcKvFpOkO5uQThmyBii70PlJPcjFE4nwDBsNsvpvssc","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@rspack%2fdev-server@2.1.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":946936,"size":180413,"noattachment":false,"key":"/@rspack/dev-server/-/@rspack/dev-server-2.1.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"},"scripts":{"dev":"rslib -w","bump":"npx bumpp","lint":"rslint","test":"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 ."},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","approver":{"name":"chenjiahan","email":"416417567@163.com"},"trustedPublisher":{"id":"github","oidcConfigId":"oidc:5de0cf5e-911f-4ddc-b547-6fb791a679cb"}},"repository":{"url":"https://github.com/rstackjs/rspack-dev-server","type":"git"},"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.16.0","dependencies":{"@rspack/dev-middleware":"^2.0.3"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"devDependencies":{"ws":"^8.21.0","hono":"^4.12.25","open":"^11.0.0","express":"^5.2.1","p-retry":"^7.1.1","chokidar":"^5.0.0","prettier":"3.8.4","@types/ws":"8.18.1","cross-env":"^10.1.0","ipaddr.js":"^2.4.0","puppeteer":"^24.43.1","http-proxy":"^1.18.1","selfsigned":"^5.5.0","typescript":"^6.0.3","@rslib/core":"^0.22.1","@types/node":"^24.13.2","nano-staged":"^1.0.2","@rslint/core":"^0.6.1","@rspack/core":"2.0.0-rc.0","@rstest/core":"^0.10.4","connect-next":"^4.0.3","serve-static":"^2.2.1","launch-editor":"^2.14.1","react-refresh":"0.18.0","http-compression":"^1.1.3","simple-git-hooks":"^2.13.1","@hono/node-server":"^2.0.4","@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.1.1","@microsoft/api-extractor":"^7.58.9","@rspack/plugin-react-refresh":"2.0.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"},"simple-git-hooks":{"pre-commit":"npx nano-staged"},"peerDependenciesMeta":{"selfsigned":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/dev-server_2.1.0_1782104059507_0.8936152116386642","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":1782104059631,"_cnpm_publish_time":1782104059631,"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"}}