{"name":"@rspack/dev-server","version":"1.2.1","license":"MIT","_id":"@rspack/dev-server@1.2.1","maintainers":[{"name":"hardfist","email":"1562502418@qq.com"},{"name":"chenjiahan","email":"416417567@163.com"}],"homepage":"https://rspack.rs","bugs":{"url":"https://github.com/rstackjs/rspack-dev-server/issues"},"dist":{"shasum":"008425971eeb4b4cf063d934151f5e4f9fbbbcec","tarball":"http://registry-npm.ywwl.com/@rspack/dev-server/download/@rspack/dev-server-1.2.1.tgz","fileCount":31,"integrity":"sha512-e/ARvskYn2Qdd02qLvc0i6H9BnOmzP0xGHS2XCr7GZ3t2k5uC5ZlLkeN1iEebU0FkAW+6ot89NahFo3nupKuww==","signatures":[{"sig":"MEYCIQDbAtz+i0EyOt9aSUXgR0moFTY56MKXqsMXAVzioCx/tQIhAL4+2KpbIfBX+oMPyTNnDC6A+sIu2ovflnHC4JJC0aFx","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@rspack%2fdev-server@1.2.1","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":436249,"size":90547,"noattachment":false,"key":"/@rspack/dev-server/-/@rspack/dev-server-1.2.1.tgz"},"main":"./dist/index.js","types":"./dist/index.d.ts","engines":{"node":">= 18.12.0"},"exports":{".":{"default":"./dist/index.js"},"./getPort":"./getPort.js","./client/*":"./client/*.js","./servers/*":"./servers/*.js","./client/*.js":"./client/*.js","./package.json":"./package.json","./servers/*.js":"./servers/*.js"},"gitHead":"edc7dfae8acb192207e8b447c100d1895f38357f","scripts":{"dev":"tsc -b -w","bump":"npx bumpp","lint":"biome check .","test":"pnpm run test:install && pnpm run build && cross-env NO_COLOR=1 node --expose-gc --max-old-space-size=8192 --experimental-vm-modules ./node_modules/jest-cli/bin/jest --colors","build":"pnpm run build:server && pnpm run build:client && pnpm run build:client-modules","format":"prettier --write .","lint:write":"biome check . --write","prettier:ci":"prettier --check .","build:client":"tsc -b ./tsconfig.client.json","build:server":"tsc -b ./tsconfig.build.json","test:install":"cross-env ./node_modules/.bin/puppeteer browsers install chrome","build:client-modules":"node ./scripts/build-client-modules.cjs"},"_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.8.0","description":"Development server for rspack","directories":{},"nano-staged":{"*.{js,jsx,ts,tsx,mjs,cjs}":["npm run format","biome lint --write --no-errors-on-unmatched"],"*.{yaml,yml,json,md,json5}":["npm rum format"]},"_nodeVersion":"24.11.1","dependencies":{"ws":"^8.18.0","open":"^10.0.3","spdy":"^4.0.2","sockjs":"^0.3.24","express":"^4.22.1","p-retry":"^6.2.0","chokidar":"^3.6.0","@types/ws":"^8.5.10","colorette":"^2.0.10","ipaddr.js":"^2.1.0","selfsigned":"^2.4.1","compression":"^1.8.1","graceful-fs":"^4.2.6","serve-index":"^1.9.1","schema-utils":"^4.2.0","@types/sockjs":"^0.3.36","launch-editor":"^2.6.1","@types/bonjour":"^3.5.13","@types/express":"^4.17.25","bonjour-service":"^1.2.1","@types/serve-index":"^1.9.4","@types/serve-static":"^1.15.5","ansi-html-community":"^0.0.8","http-proxy-middleware":"^2.0.9","webpack-dev-middleware":"^7.4.2","connect-history-api-fallback":"^2.0.0","@types/express-serve-static-core":"^4.17.21","@types/connect-history-api-fallback":"^1.5.4"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"packageManager":"pnpm@10.27.0","devDependencies":{"hono":"^4.6.8","jest":"29.7.0","connect":"^3.7.0","express":"^5.2.1","ts-jest":"29.1.2","webpack":"^5.94.0","jest-cli":"29.7.0","prettier":"3.2.5","@types/ws":"8.5.10","cross-env":"^7.0.3","puppeteer":"^24.34.0","supertest":"^6.1.3","css-loader":"^7.1.2","http-proxy":"^1.18.1","typescript":"5.0.2","@types/jest":"29.5.12","@types/node":"^24.0.14","graceful-fs":"4.2.10","nano-staged":"^0.8.0","@rspack/core":"1.7.1","style-loader":"^4.0.0","react-refresh":"0.14.0","sockjs-client":"^1.6.1","tcp-port-used":"^1.0.2","webpack-merge":"^6.0.1","@biomejs/biome":"^1.8.3","@types/express":"5.0.6","@jest/reporters":"29.7.0","wait-for-expect":"^3.0.2","simple-git-hooks":"^2.11.1","@hono/node-server":"^1.13.3","@types/mime-types":"3.0.1","@types/node-forge":"^1.3.1","@types/compression":"^1.7.2","@types/graceful-fs":"^4.1.9","require-from-string":"^2.0.2","@jest/test-sequencer":"^29.7.0","@types/sockjs-client":"^1.5.1","@types/trusted-types":"^2.0.7","jest-serializer-path":"^0.1.15","jest-environment-node":"29.7.0","webpack-dev-middleware":"^7.4.2","@rspack/plugin-react-refresh":"1.0.0"},"peerDependencies":{"@rspack/core":"*"},"simple-git-hooks":{"pre-commit":"npx nano-staged"},"_npmOperationalInternal":{"tmp":"tmp/dev-server_1.2.1_1769146155275_0.36030133535001196","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":1769146155416,"_cnpm_publish_time":1769146155416,"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"}}