{"_id":"@rspack/dev-server@2.2.2","bugs":"https://github.com/rstackjs/rspack-dev-server/issues","dist":{"shasum":"91d4f787237221f22a4672722a42dda4067be9e0","tarball":"http://registry-npm.ywwl.com/@rspack/dev-server/download/@rspack/dev-server-2.2.2.tgz","integrity":"sha512-pK4V9YJW8dkfjy6WYJ2T6DrPkcIn2yjA1HiaU146141j8UCxHok5lsplyqudLzerOhvwqMrNFmnsuXLnFbfn4Q==","fileCount":45,"unpackedSize":959785,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@rspack%2fdev-server@2.2.2","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQD2uqxuua8rEAR28ZMDzt1O9a17M+8hBjZnvYQKQNNNWQIgHf+8P60Scd3UAornZcf8LpOWdi9N+wVW2R9vSyDMihI="}],"size":183480,"noattachment":false,"key":"/@rspack/dev-server/-/@rspack/dev-server-2.2.2.tgz"},"name":"@rspack/dev-server","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"},"license":"MIT","scripts":{"dev":"rs lib -w","bump":"pnpm version -m \"release: v%s\"","lint":"rs lint","test":"pnpm run test:type && rs test","build":"rs lib","check":"rs check","format":"rs fmt","test:type":"pnpm run build && pnpm --dir tests run type-check"},"version":"2.2.2","_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"5de0cf5e-911f-4ddc-b547-6fb791a679cb"},"approver":{"name":"chenjiahan","email":"416417567@163.com"}},"homepage":"https://github.com/rstackjs/rspack-dev-server","repository":{"url":"https://github.com/rstackjs/rspack-dev-server","type":"git"},"description":"Development server for Rspack","directories":{},"maintainers":[{"name":"hardfist3","email":"13738085484@139.com"},{"name":"chenjiahan","email":"416417567@163.com"}],"dependencies":{"@rspack/dev-middleware":"^2.0.6"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"devDependencies":{"ws":"^8.22.0","hono":"^4.13.13","open":"^11.0.4","rstack":"^0.8.5","express":"^5.3.0","p-retry":"^7.1.1","chokidar":"^5.0.0","prettier":"3.9.10","@types/ws":"8.18.2","cross-env":"^10.1.0","ipaddr.js":"^2.5.0","puppeteer":"^24.43.1","http-proxy":"^1.18.1","selfsigned":"^5.5.0","typescript":"^7.0.2","@types/node":"^24.19.2","@rspack/core":"npm:@rspack-canary/core@2.2.10-canary-8ee68a1b-20261014173729","connect-next":"^5.0.0","serve-static":"^2.2.1","launch-editor":"^2.14.2","react-refresh":"0.19.0","http-compression":"^1.1.3","@hono/node-server":"^2.1.5","@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.2.1","@microsoft/api-extractor":"^7.59.4","@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"},"peerDependenciesMeta":{"selfsigned":{"optional":true}},"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/dev-server_2.2.2_1792993181013_0.6170482294346604"},"_hasShrinkwrap":false,"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":1792993181108,"_cnpm_publish_time":1792993181108,"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"}}