{"name":"@rspack/dev-server","version":"1.0.6","license":"MIT","_id":"@rspack/dev-server@1.0.6","maintainers":[{"name":"harpsealjs","email":"wly13201@sina.com"},{"name":"chenjiahan","email":"416417567@163.com"},{"name":"hardfist","email":"1562502418@qq.com"}],"homepage":"https://rspack.dev","bugs":{"url":"https://github.com/web-infra-dev/rspack/issues"},"dist":{"shasum":"5abcb494f8d3a1507b950c3a3f2d8f20962733ee","tarball":"http://registry-npm.ywwl.com/@rspack/dev-server/download/@rspack/dev-server-1.0.6.tgz","fileCount":19,"integrity":"sha512-80IsqqwHHvh1mWioOsRTpx/WF6HahNMC2P6zeVgWVS5lRkz7GRXb0RCFJK7BJuC5QMi0lCCuD7oDV8FUWub93A==","signatures":[{"sig":"MEYCIQC61YWOAfeu9BUflHVZ+agixh+G+j0QsmLdX9ZXh4Rb8AIhAJOfFXIKD7EmTkEhGCY5d/Iod2LaxlA+4H3wdMb9Fthn","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@rspack%2fdev-server@1.0.6","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":36806,"size":11821,"noattachment":false,"key":"/@rspack/dev-server/-/@rspack/dev-server-1.0.6.tgz"},"main":"./dist/index.js","_from":"file:rspack-dev-server-1.0.6.tgz","types":"./dist/index.d.ts","exports":{".":{"default":"./dist/index.js"},"./client/*":"./client/*.js","./client/*.js":"./client/*.js","./package.json":"./package.json"},"scripts":{"dev":"tsc -w -b ./tsconfig.build.json","test":"pnpm run test:install && cross-env NO_COLOR=1 node --expose-gc --max-old-space-size=8192 --experimental-vm-modules ../../node_modules/jest-cli/bin/jest --colors","build":"tsc -b ./tsconfig.build.json","test:install":"cross-env ./node_modules/.bin/puppeteer browsers install chrome","api-extractor":"api-extractor run --verbose","api-extractor:ci":"api-extractor run --verbose || diff temp/api.md etc/api.md"},"_npmUser":{"name":"hardfist","email":"1562502418@qq.com"},"_resolved":"/tmp/ad1d9de72941e1c2f4281aee094c6a59/rspack-dev-server-1.0.6.tgz","_integrity":"sha512-80IsqqwHHvh1mWioOsRTpx/WF6HahNMC2P6zeVgWVS5lRkz7GRXb0RCFJK7BJuC5QMi0lCCuD7oDV8FUWub93A==","repository":{"url":"git+https://github.com/web-infra-dev/rspack.git","type":"git","directory":"packages/rspack-dev-server"},"_npmVersion":"10.8.2","description":"Development server for rspack","directories":{},"_nodeVersion":"20.17.0","dependencies":{"ws":"^8.16.0","express":"^4.19.2","p-retry":"4.6.2","chokidar":"^3.6.0","mime-types":"^2.1.35","webpack-dev-server":"5.0.4","http-proxy-middleware":"^2.0.6","webpack-dev-middleware":"^7.4.2","connect-history-api-fallback":"^2.0.0"},"publishConfig":{"access":"public","provenance":true},"_hasShrinkwrap":false,"devDependencies":{"prettier":"3.2.5","@types/ws":"8.5.10","puppeteer":"^23.2.2","supertest":"^6.1.3","css-loader":"^6.11.0","http-proxy":"^1.18.1","typescript":"5.0.2","graceful-fs":"4.2.10","@rspack/core":"1.0.6","style-loader":"^3.3.3","sockjs-client":"^1.6.1","tcp-port-used":"^1.0.2","@types/express":"4.17.21","wait-for-expect":"^3.0.2","@types/mime-types":"2.1.4","@rspack/dev-server":"1.0.6","require-from-string":"^2.0.2","@jest/test-sequencer":"^29.7.0","jest-serializer-path":"^0.1.15","@rspack/plugin-react-refresh":"1.0.0","@types/connect-history-api-fallback":"1.5.4"},"peerDependencies":{"@rspack/core":"*"},"_npmOperationalInternal":{"tmp":"tmp/dev-server_1.0.6_1727157984601_0.17156242072592143","host":"s3://npm-registry-packages"},"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":1727157984759,"_cnpm_publish_time":1727157984759,"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"}}