[
  {
    "path": ".cspell.json",
    "content": "{\n  \"version\": \"0.2\",\n  \"language\": \"en,en-gb\",\n  \"words\": [\n    \"apos\",\n    \"camelcase\",\n    \"tapable\",\n    \"sockjs\",\n    \"spdy\",\n    \"memfs\",\n    \"execa\",\n    \"networkidle\",\n    \"ipaddr\",\n    \"pageerror\",\n    \"unmock\",\n    \"testhost\",\n    \"USEPOLLING\",\n    \"colorette\",\n    \"selfsigned\",\n    \"portfinder\",\n    \"xlink\",\n    \"instanceof\",\n    \"Heyo\",\n    \"domcontentloaded\",\n    \"historyapifallback\",\n    \"pems\",\n    \"localdomain\",\n    \"unshift\",\n    \"Zeroconf\",\n    \"webworker\",\n    \"devserver\",\n    \"logspam\",\n    \"Sindre\",\n    \"Sorhus\",\n    \"esmodules\",\n    \"CAFC\",\n    \"FACCA\",\n    \"darkgrey\",\n    \"Consolas\",\n    \"peerigon\",\n    \"Ichigo\",\n    \"Kurosaki\",\n    \"typeof\",\n    \"parseable\",\n    \"proxyfalse\",\n    \"klona\",\n    \"sessionattached\",\n    \"zenitsu\",\n    \"chuntaro\",\n    \"nwjs\",\n    \"myhost\",\n    \"ƕrrn\",\n    \"Fƅsq\",\n    \"G'RД\",\n    \"ECONNREFUSED\",\n    \"taskkill\",\n    \"testhouse\",\n    \"mwarn\",\n    \"mansi\",\n    \"nosources\",\n    \"Heyyy\",\n    \"oipqj\",\n    \"breakpad\",\n    \"infobars\",\n    \"omnibox\",\n    \"swiftshader\",\n    \"hoge\",\n    \"subsubcomain\",\n    \"noselect\",\n    \"commitlint\",\n    \"eslintcache\",\n    \"hono\",\n    \"privkey\",\n    \"geomanist\",\n    \"nodenext\"\n  ],\n  \"ignorePaths\": [\n    \"CHANGELOG.md\",\n    \"coverage\",\n    \"package.json\",\n    \"dist/**\",\n    \"client/**\",\n    \"**/__snapshots__/**\",\n    \"package-lock.json\",\n    \"node_modules\",\n    \"coverage\",\n    \"*.log\"\n  ]\n}\n"
  },
  {
    "path": ".editorconfig",
    "content": "# editorconfig.org\n\n[*]\ncharset = utf-8\nindent_style = space\nindent_size = 2\nend_of_line = lf\ninsert_final_newline = true\ntrim_trailing_whitespace = true\n\n[*.md]\ninsert_final_newline = false\ntrim_trailing_whitespace = false\n"
  },
  {
    "path": ".gitattributes",
    "content": "* text=auto\nbin/* eol=lf\n"
  },
  {
    "path": ".github/dependabot.yml",
    "content": "version: 2\nupdates:\n  - package-ecosystem: npm\n    directory: \"/\"\n    schedule:\n      interval: daily\n      time: \"04:00\"\n      timezone: Europe/Berlin\n    open-pull-requests-limit: 10\n    versioning-strategy: lockfile-only\n    groups:\n      dependencies:\n        patterns:\n          - \"*\"\n"
  },
  {
    "path": ".github/workflows/dependency-review.yml",
    "content": "name: \"Dependency Review\"\non: [pull_request]\n\npermissions:\n  contents: read\n\njobs:\n  dependency-review:\n    runs-on: ubuntu-latest\n    steps:\n      - name: \"Checkout Repository\"\n        uses: actions/checkout@v4\n      - name: \"Dependency Review\"\n        uses: actions/dependency-review-action@v4\n"
  },
  {
    "path": ".github/workflows/nodejs.yml",
    "content": "name: webpack-dev-server\n\non:\n  push:\n    branches:\n      - main\n      - next\n      - v4\n  pull_request:\n    branches:\n      - main\n      - next\n      - v4\n\npermissions:\n  contents: read\n\njobs:\n  lint:\n    name: Lint - ${{ matrix.os }} - Node v${{ matrix.node-version }}\n\n    env:\n      GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}\n\n    strategy:\n      matrix:\n        os: [ubuntu-latest]\n        node-version: [lts/*]\n\n    runs-on: ${{ matrix.os }}\n\n    concurrency:\n      group: lint-${{ matrix.os }}-v${{ matrix.node-version }}-${{ github.ref }}\n      cancel-in-progress: true\n\n    steps:\n      - uses: actions/checkout@v4\n        with:\n          fetch-depth: 0\n\n      - name: Use Node.js ${{ matrix.node-version }}\n        uses: actions/setup-node@v4\n        with:\n          node-version: ${{ matrix.node-version }}\n          cache: \"npm\"\n\n      - name: Install dependencies\n        run: npm ci\n\n      - name: Lint\n        run: npm run lint\n\n      - name: Build types\n        run: npm run build:types\n\n      - name: Check types\n        run: if [ -n \"$(git status types --porcelain)\" ]; then echo \"Missing types. Update types by running 'npm run build:types'\"; exit 1; else echo \"All types are valid\"; fi\n\n      - name: Security audit\n        run: npm audit --production\n\n      - name: Validate PR commits with commitlint\n        if: github.event_name == 'pull_request'\n        run: npx commitlint --from ${{ github.event.pull_request.head.sha }}~${{ github.event.pull_request.commits }} --to ${{ github.event.pull_request.head.sha }} --verbose\n\n  test:\n    name: Test - ${{ matrix.os }} - Node v${{ matrix.node-version }}, Webpack ${{ matrix.webpack-version }} (${{ matrix.shard }})\n\n    strategy:\n      matrix:\n        os: [ubuntu-latest, windows-latest, macos-latest]\n        node-version: [18.x, 20.x, 22.x, 24.x]\n        shard: [\"1/4\", \"2/4\", \"3/4\", \"4/4\"]\n        webpack-version: [latest]\n\n    runs-on: ${{ matrix.os }}\n\n    concurrency:\n      group: test-${{ matrix.os }}-v${{ matrix.node-version }}-${{ matrix.webpack-version }}-${{ matrix.shard }}-${{ github.ref }}\n      cancel-in-progress: true\n\n    steps:\n      - uses: actions/checkout@v4\n\n      - name: Use Node.js ${{ matrix.node-version }}\n        uses: actions/setup-node@v4\n        with:\n          node-version: ${{ matrix.node-version }}\n          cache: \"npm\"\n\n      - name: Install dependencies\n        run: npm ci\n\n      - name: Install dependencies for Node.js@18\n        run: |\n          npm i p-retry@^4.5.0 open@^8.0.9\n          node ./scripts/prepare-test-for-old-node.js\n        if: matrix.node-version == '18.x'\n\n      - name: Setup firefox\n        if: matrix.os != 'windows-latest'\n        uses: browser-actions/setup-firefox@latest\n        with:\n          firefox-version: latest\n\n      - name: Link webpack-dev-server\n        run: |\n          cp -R client tmp-client\n          npm link --ignore-scripts || true\n          npm link webpack-dev-server --ignore-scripts || true\n          rm -r client\n          cp -R tmp-client client\n\n      - name: Run tests for webpack version ${{ matrix.webpack-version }}\n        run: node_modules/.bin/jest --coverage --ci --shard=${{ matrix.shard }}\n        if: matrix.node-version == '18.x'\n\n      - name: Run tests for webpack version ${{ matrix.webpack-version }}\n        run: npm run test:coverage -- --ci --shard=${{ matrix.shard }}\n        if: matrix.node-version != '18.x'\n\n      - name: Submit coverage data to codecov\n        uses: codecov/codecov-action@v5\n        with:\n          token: ${{ secrets.CODECOV_TOKEN }}\n"
  },
  {
    "path": ".gitignore",
    "content": ".DS_Store\n\nnpm-debug.log\n\n.idea\n\nclient\n!/examples/client\n!/test/client\ncoverage\nnode_modules\n.vscode\nyarn.lock\nyarn-error.log\n\n.eslintcache\n.cspellcache\n\ntest/fixtures/static-config/public/assets/non-exist.txt\ntest/fixtures/watch-files-config/public/assets/non-exist.txt\ntest/fixtures/reload-config/main.css\ntest/fixtures/reload-config-2/main.css\ntest/fixtures/worker-config-dev-server-false/public\n!/test/fixtures/static-config/public/node_modules\n"
  },
  {
    "path": ".husky/commit-msg",
    "content": "commitlint --edit $1\n"
  },
  {
    "path": ".husky/pre-commit",
    "content": "lint-staged\n"
  },
  {
    "path": ".prettierignore",
    "content": "/client\n!/test/client\ncoverage\nnode_modules\nCHANGELOG.md\nexamples/client/trusted-types-overlay/app.js\n"
  },
  {
    "path": ".versionrc",
    "content": "{\n  \"types\": [\n    {\"type\":\"feat\",\"section\":\"Features\"},\n    {\"type\":\"fix\",\"section\":\"Bug Fixes\"},\n    {\"type\":\"test\", \"hidden\": true}\n  ]\n}\n"
  },
  {
    "path": "CHANGELOG.md",
    "content": "# Changelog\n\nAll notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.\n\n### [5.2.3](https://github.com/webpack/webpack-dev-server/compare/v5.2.2...v5.2.3) (2026-01-12)\n\n\n### Bug Fixes\n\n* add `cause` for `errorObject` ([#5518](https://github.com/webpack/webpack-dev-server/issues/5518)) ([37b033d](https://github.com/webpack/webpack-dev-server/commit/37b033da2c48335178495a1987c469a26ef3de60))\n* compatibility with event target and universal target and lazy compilation  ([574026c](https://github.com/webpack/webpack-dev-server/commit/574026c44b9c51f0bbd2f5a2836c54607289a071))\n* **overlay:** add ESC key to dismiss overlay ([#5598](https://github.com/webpack/webpack-dev-server/issues/5598)) ([f91baa8](https://github.com/webpack/webpack-dev-server/commit/f91baa8831e061e2998849966b8002b40b83fb07))\n* progress indicator styles ([#5557](https://github.com/webpack/webpack-dev-server/issues/5557)) ([41a53a1](https://github.com/webpack/webpack-dev-server/commit/41a53a1accdb0a90785d82cbe8a079794eeed3c8))\n* upgrade selfsigned to v5\n\n### [5.2.2](https://github.com/webpack/webpack-dev-server/compare/v5.2.1...v5.2.2) (2025-06-03)\n\n\n### Bug Fixes\n\n* \"Overlay enabled\" false positive ([18e72ee](https://github.com/webpack/webpack-dev-server/commit/18e72ee3e57a6e7598a6c068c0ff7c7bb6a857f1))\n* do not crush when error is null for runtime errors ([#5447](https://github.com/webpack/webpack-dev-server/issues/5447)) ([309991f](https://github.com/webpack/webpack-dev-server/commit/309991f947baa0354140b9930a9654ac792e20c4))\n* remove unnecessary header `X_TEST` ([#5451](https://github.com/webpack/webpack-dev-server/issues/5451)) ([64a6124](https://github.com/webpack/webpack-dev-server/commit/64a6124bf1b4d158bb42a4341dd03121ae3759fa))\n* respect the `allowedHosts` option for cross-origin header check ([#5510](https://github.com/webpack/webpack-dev-server/issues/5510)) ([03d1214](https://github.com/webpack/webpack-dev-server/commit/03d12141bf7be09dfb14e91e5c834ee63bd9a9a2))\n\n## [5.2.1](https://github.com/webpack/webpack-dev-server/compare/v5.2.0...v6.0.0) (2025-03-26)\n\n### Security\n\n* cross-origin requests are not allowed unless allowed by `Access-Control-Allow-Origin` header\n* requests with an IP addresses in the `Origin` header are not allowed to connect to WebSocket server unless configured by `allowedHosts` or it different from the `Host` header\n\nThe above changes may make the dev server not work if you relied on such behavior, but unfortunately they carry security risks, so they were considered as fixes.\n\n### Bug Fixes\n\n* prevent overlay for errors caught by React error boundaries ([#5431](https://github.com/webpack/webpack-dev-server/issues/5431)) ([8c1abc9](https://github.com/webpack/webpack-dev-server/commit/8c1abc903ab444d9ce99e567b9a6c603e1ec06be))\n* take the first network found instead of the last one, this restores the same behavior as 5.0.4 ([#5411](https://github.com/webpack/webpack-dev-server/issues/5411)) ([ffd0b86](https://github.com/webpack/webpack-dev-server/commit/ffd0b86b790d372f90e17aea92cfd9def83fee96))\n\n## [5.2.0](https://github.com/webpack/webpack-dev-server/compare/v5.1.0...v5.2.0) (2024-12-11)\n\n\n### Features\n\n* added `getClientEntry` and `getClientHotEntry` methods to get clients entries ([dc642a8](https://github.com/webpack/webpack-dev-server/commit/dc642a832d45c23c5c7a08fbf29995e0db7e0d95))\n\n\n### Bug Fixes\n\n* speed up initial client bundling ([145b5d0](https://github.com/webpack/webpack-dev-server/commit/145b5d01610a16468fc32719a20366682b0e8572))\n\n## [5.1.0](https://github.com/webpack/webpack-dev-server/compare/v5.0.4...v5.1.0) (2024-09-03)\n\n\n### Features\n\n* add visual progress indicators ([a8f40b7](https://github.com/webpack/webpack-dev-server/commit/a8f40b74e6439a8281b9fe8868eb9db7e4c5de50))\n* added the `app` option to be `Function` (by default only with `connect` compatibility frameworks) ([3096148](https://github.com/webpack/webpack-dev-server/commit/3096148746c906105c4424352f5b5ad1bff0fd4f))\n* allow the `server` option to be `Function` ([#5275](https://github.com/webpack/webpack-dev-server/issues/5275)) ([02a1c6d](https://github.com/webpack/webpack-dev-server/commit/02a1c6d788f5fc47c11cc7d910fd1b5e17aed886))\n* http2 support for `connect` and `connect` compatibility frameworks which support HTTP2 ([#5267](https://github.com/webpack/webpack-dev-server/issues/5267)) ([6509a3f](https://github.com/webpack/webpack-dev-server/commit/6509a3fd3eb5decb61f60a9f2db97d76f71ecb99))\n\n\n### Bug Fixes\n\n* check the `platform` property to determinate the target ([#5269](https://github.com/webpack/webpack-dev-server/issues/5269)) ([c3b532c](https://github.com/webpack/webpack-dev-server/commit/c3b532c6360317319793dcda22c76fbfc05fbdcf))\n* ipv6 output ([#5270](https://github.com/webpack/webpack-dev-server/issues/5270)) ([06005e7](https://github.com/webpack/webpack-dev-server/commit/06005e7cb99e4c412b968ed3fb786acfb8c2e037))\n* replace `rimraf` with `rm` ([#5162](https://github.com/webpack/webpack-dev-server/issues/5162)) ([1a1561f](https://github.com/webpack/webpack-dev-server/commit/1a1561f09bdfa7a98434d7d9cd62e323b887dfbf))\n* replace default gateway ([#5255](https://github.com/webpack/webpack-dev-server/issues/5255)) ([f5f0902](https://github.com/webpack/webpack-dev-server/commit/f5f09024ff4fe6625aa94bcd69439462d74013f0))\n* support `devServer: false` ([#5272](https://github.com/webpack/webpack-dev-server/issues/5272)) ([8b341cb](https://github.com/webpack/webpack-dev-server/commit/8b341cb8c1dc01cef62c70959620cd0cbd87fee7))\n\n### [5.0.4](https://github.com/webpack/webpack-dev-server/compare/v5.0.3...v5.0.4) (2024-03-19)\n\n\n### Bug Fixes\n\n* **security:** bump webpack-dev-middleware ([#5112](https://github.com/webpack/webpack-dev-server/issues/5112)) ([aab576a](https://github.com/webpack/webpack-dev-server/commit/aab576a9e4930a1731e8b0380c859552fc9a6e11))\n\n### [5.0.3](https://github.com/webpack/webpack-dev-server/compare/v5.0.2...v5.0.3) (2024-03-12)\n\n\n### Bug Fixes\n\n* **types:** proxy ([#5101](https://github.com/webpack/webpack-dev-server/issues/5101)) ([6e1aed3](https://github.com/webpack/webpack-dev-server/commit/6e1aed30ffd6456935b4fe22851cd560b0eae176))\n\n### [5.0.2](https://github.com/webpack/webpack-dev-server/compare/v5.0.1...v5.0.2) (2024-02-16)\n\n\n### Bug Fixes\n\n* types ([#5057](https://github.com/webpack/webpack-dev-server/issues/5057)) ([da2c24d](https://github.com/webpack/webpack-dev-server/commit/da2c24ddd92198a1337553457eedcece6af38195))\n\n### [5.0.1](https://github.com/webpack/webpack-dev-server/compare/v5.0.0...v5.0.1) (2024-02-13)\n\n\n### Bug Fixes\n\n* avoid using eval in client ([#5045](https://github.com/webpack/webpack-dev-server/issues/5045)) ([7681477](https://github.com/webpack/webpack-dev-server/commit/76814771dcebe80628b4462f5e1d30064ae226d5))\n* overlay and `require-trusted-types-for` ([#5046](https://github.com/webpack/webpack-dev-server/issues/5046)) ([e115436](https://github.com/webpack/webpack-dev-server/commit/e11543677120b004d1f20e11fdf34c07897c7b0c))\n\n## [5.0.0](https://github.com/webpack/webpack-dev-server/compare/v4.15.1...v5.0.0) (2024-02-12)\n\n[Migration Guide and Changes](https://github.com/webpack/webpack-dev-server/blob/main/migration-v5.md).\n\n### [4.15.1](https://github.com/webpack/webpack-dev-server/compare/v4.15.0...v4.15.1) (2023-06-09)\n\n\n### Bug Fixes\n\n* replace `::` with `localhost` before openBrowser() ([#4856](https://github.com/webpack/webpack-dev-server/issues/4856)) ([874c44b](https://github.com/webpack/webpack-dev-server/commit/874c44b072d55fe42a29d366dbe1c71ca3a94db4))\n* **types:** compatibility with `@types/ws` ([#4899](https://github.com/webpack/webpack-dev-server/issues/4899)) ([34bcec2](https://github.com/webpack/webpack-dev-server/commit/34bcec242b8bc64c26e9455a8fd5781a59fbcf24))\n\n## [4.15.0](https://github.com/webpack/webpack-dev-server/compare/v4.14.0...v4.15.0) (2023-05-07)\n\n\n### Features\n\n* overlay displays unhandled promise rejection ([#4849](https://github.com/webpack/webpack-dev-server/issues/4849)) ([d1dd430](https://github.com/webpack/webpack-dev-server/commit/d1dd4305bf3861c43caf374c101a80e65e18b138))\n\n## [4.14.0](https://github.com/webpack/webpack-dev-server/compare/v4.13.3...v4.14.0) (2023-05-06)\n\n\n### Features\n\n* allow CLI to be ESM ([#4837](https://github.com/webpack/webpack-dev-server/issues/4837)) ([bb4a5d9](https://github.com/webpack/webpack-dev-server/commit/bb4a5d9e8f87a89c81d4024085ff6c9ebb6c551b))\n* allow filter overlay errors/warnings with function ([#4813](https://github.com/webpack/webpack-dev-server/issues/4813)) ([aab01b3](https://github.com/webpack/webpack-dev-server/commit/aab01b3c4e4fb9ca9ae1c1bbc860a52a06026de6))\n\n### [4.13.3](https://github.com/webpack/webpack-dev-server/compare/v4.13.2...v4.13.3) (2023-04-15)\n\n\n### Bug Fixes\n\n* **perf:** reduced initial start time ([#4818](https://github.com/webpack/webpack-dev-server/issues/4818)) ([fcf01d1](https://github.com/webpack/webpack-dev-server/commit/fcf01d1b8eb67aa1c93486e1b34ceefc33d9ee73))\n\n### [4.13.2](https://github.com/webpack/webpack-dev-server/compare/v4.13.1...v4.13.2) (2023-03-31)\n\n\n### Bug Fixes\n\n* prevent open 0.0.0.0 in browser due windows problems ([04e74f2](https://github.com/webpack/webpack-dev-server/commit/04e74f2ba32963932c0ab46ac4862e92c3e4e1e1))\n\n### [4.13.1](https://github.com/webpack/webpack-dev-server/compare/v4.13.0...v4.13.1) (2023-03-18)\n\n\n### Bug Fixes\n\n* make webpack optional peer dependency ([#4778](https://github.com/webpack/webpack-dev-server/issues/4778)) ([71be54e](https://github.com/webpack/webpack-dev-server/commit/71be54edcb890f53d2cd900c2801989a17c2c9b1))\n\n## [4.13.0](https://github.com/webpack/webpack-dev-server/compare/v4.12.0...v4.13.0) (2023-03-17)\n\n\n### Features\n\n* added `client.overlay.runtimeErrors` option to control runtime errors ([#4773](https://github.com/webpack/webpack-dev-server/issues/4773)) ([dca2366](https://github.com/webpack/webpack-dev-server/commit/dca2366e22a262e6052dae060c8b237f4e6fd26b))\n\n## [4.12.0](https://github.com/webpack/webpack-dev-server/compare/v4.11.1...v4.12.0) (2023-03-14)\n\n\n### Features\n\n* allow to set the `sockjs_url` option (only `sockjs`) using the `webSocketServer.options.sockjsUrl` option ([#4586](https://github.com/webpack/webpack-dev-server/issues/4586)) ([69a2fba](https://github.com/webpack/webpack-dev-server/commit/69a2fba4e915b4814de1c3cb27930a13dc994945))\n* catch runtime error ([#4605](https://github.com/webpack/webpack-dev-server/issues/4605)) ([87a26cf](https://github.com/webpack/webpack-dev-server/commit/87a26cf4c1fd9ac8140d345a8520a8d5cb059556))\n* improve styles for overlay ([#4576](https://github.com/webpack/webpack-dev-server/issues/4576)) ([791fb85](https://github.com/webpack/webpack-dev-server/commit/791fb85931299eea052b3c37d4353d48ea34fa5e))\n* open editor when clicking error on overlay ([#4587](https://github.com/webpack/webpack-dev-server/issues/4587)) ([efb2cec](https://github.com/webpack/webpack-dev-server/commit/efb2cec3f8acbbe5113aad20529e268c01ac29c2))\n\n\n### Bug Fixes\n\n* compatibility with `experiments.buildHttp` ([#4585](https://github.com/webpack/webpack-dev-server/issues/4585)) ([5b846cb](https://github.com/webpack/webpack-dev-server/commit/5b846cbe9bfb8444bc7605654fcebf4e87766aa4))\n* respect `NODE_PATH` env variable ([#4581](https://github.com/webpack/webpack-dev-server/issues/4581)) ([b857e6f](https://github.com/webpack/webpack-dev-server/commit/b857e6fa3b86facc63811438eef17be92dc36dc6))\n\n### [4.11.1](https://github.com/webpack/webpack-dev-server/compare/v4.11.0...v4.11.1) (2022-09-19)\n\n\n### Bug Fixes\n\n* respect `client.logging` option for all logs ([#4572](https://github.com/webpack/webpack-dev-server/issues/4572)) ([375835c](https://github.com/webpack/webpack-dev-server/commit/375835c926ec03fdfecae9ab1b54fd43b1ff4b31))\n\n## [4.11.0](https://github.com/webpack/webpack-dev-server/compare/v4.10.1...v4.11.0) (2022-09-07)\n\n\n### Features\n\n* make allowedHosts accept localhost subdomains by default ([#4357](https://github.com/webpack/webpack-dev-server/issues/4357)) ([0a33e6a](https://github.com/webpack/webpack-dev-server/commit/0a33e6a7529ef20ec8841c3fd501c37da179be3e))\n\n\n### Bug Fixes\n\n* auto reply to OPTIONS requests only when unhandled ([#4559](https://github.com/webpack/webpack-dev-server/issues/4559)) ([984af02](https://github.com/webpack/webpack-dev-server/commit/984af026a50f3e77c58abe24475da40a4ed038f1)), closes [#4551](https://github.com/webpack/webpack-dev-server/issues/4551)\n\n### [4.10.1](https://github.com/webpack/webpack-dev-server/compare/v4.10.0...v4.10.1) (2022-08-29)\n\n\n### Bug Fixes\n\n* compatibility with old browsers ([#4544](https://github.com/webpack/webpack-dev-server/issues/4544)) ([6a430d4](https://github.com/webpack/webpack-dev-server/commit/6a430d495e3e616304000e21e72deba27eb5303f))\n\n## [4.10.0](https://github.com/webpack/webpack-dev-server/compare/v4.9.3...v4.10.0) (2022-08-10)\n\n\n### Features\n\n* allow to configure more `client` options via resource URL ([#4274](https://github.com/webpack/webpack-dev-server/issues/4274)) ([216e3cb](https://github.com/webpack/webpack-dev-server/commit/216e3cbe62dc90b9345995cb4f33ca9dd7b6aaba))\n\n\n### Bug Fixes\n\n* response correctly when receive an OPTIONS request ([#4185](https://github.com/webpack/webpack-dev-server/issues/4185)) ([2b3b7e0](https://github.com/webpack/webpack-dev-server/commit/2b3b7e000f688e086c68ba821ed2edc3cd56a219))\n\n### [4.9.3](https://github.com/webpack/webpack-dev-server/compare/v4.9.2...v4.9.3) (2022-06-29)\n\n\n### Bug Fixes\n\n* avoid creation unnecessary stream for static sockjs file ([#4482](https://github.com/webpack/webpack-dev-server/issues/4482)) ([049b153](https://github.com/webpack/webpack-dev-server/commit/049b153b87ab908ae53b71356e0716bb3fc5bf07))\n* history-api-fallback now supports HEAD requests and handles them the same as GET ([8936082](https://github.com/webpack/webpack-dev-server/commit/8936082809a9575f231afbcad6a32bb8e14d6dce))\n\n### [4.9.2](https://github.com/webpack/webpack-dev-server/compare/v4.9.1...v4.9.2) (2022-06-06)\n\n\n### Bug Fixes\n\n* add `@types/serve-static` to dependencies ([#4468](https://github.com/webpack/webpack-dev-server/issues/4468)) ([af83deb](https://github.com/webpack/webpack-dev-server/commit/af83deb199dc1d8cae4365ec2c5acf07e29358df))\n\n### [4.9.1](https://github.com/webpack/webpack-dev-server/compare/v4.9.0...v4.9.1) (2022-05-31)\n\n\n### Bug Fixes\n\n* security problem with sockjs ([#4465](https://github.com/webpack/webpack-dev-server/issues/4465)) ([e765182](https://github.com/webpack/webpack-dev-server/commit/e765182e426cbca9c3c09294b02ac2d9737c1d74))\n\n## [4.9.0](https://github.com/webpack/webpack-dev-server/compare/v4.8.1...v4.9.0) (2022-05-04)\n\n\n### Features\n\n* support Trusted Types for client overlay ([#4404](https://github.com/webpack/webpack-dev-server/issues/4404)) ([8132e1d](https://github.com/webpack/webpack-dev-server/commit/8132e1d029badab7b1e836f8f240844c2d843ecc))\n\n\n### Bug Fixes\n\n* ie11 runtime ([#4403](https://github.com/webpack/webpack-dev-server/issues/4403)) ([256d5fb](https://github.com/webpack/webpack-dev-server/commit/256d5fb5fea7ee5a6683f77ea347ac79816ad639))\n* replace portfinder with custom implementation and fix security problem ([#4384](https://github.com/webpack/webpack-dev-server/issues/4384)) ([eea50f3](https://github.com/webpack/webpack-dev-server/commit/eea50f342e3090483f6da4932b84ed52bba44c58))\n* use the host in options to check if port is available ([#4385](https://github.com/webpack/webpack-dev-server/issues/4385)) ([a10c7cf](https://github.com/webpack/webpack-dev-server/commit/a10c7cfd290d29384d14405d7cf79e105c7b5d15))\n\n### [4.8.1](https://github.com/webpack/webpack-dev-server/compare/v4.8.0...v4.8.1) (2022-04-06)\n\n\n### Bug Fixes\n\n* types ([#4373](https://github.com/webpack/webpack-dev-server/issues/4373)) ([f6fe6be](https://github.com/webpack/webpack-dev-server/commit/f6fe6be27656c9cc1e65a894a889d7443be7e6a8))\n\n## [4.8.0](https://github.com/webpack/webpack-dev-server/compare/v4.7.4...v4.8.0) (2022-04-05)\n\n\n### Features\n\n* export initialized socket client ([#4304](https://github.com/webpack/webpack-dev-server/issues/4304)) ([7920364](https://github.com/webpack/webpack-dev-server/commit/7920364d6b6ac29e1b7fdbb38c8a9fe22eec61de))\n\n\n### Bug Fixes\n\n* update description for `--no-client-reconnect` ([#4248](https://github.com/webpack/webpack-dev-server/issues/4248)) ([317648d](https://github.com/webpack/webpack-dev-server/commit/317648df21562f9dfe1b9f8069642b91ac3bffae))\n* update description for `--no-client` ([#4250](https://github.com/webpack/webpack-dev-server/issues/4250)) ([c3b6690](https://github.com/webpack/webpack-dev-server/commit/c3b669077089802412774079f38a13bce054eee7))\n* update description for `--no-history-api-fallback` ([#4277](https://github.com/webpack/webpack-dev-server/issues/4277)) ([d63a0a2](https://github.com/webpack/webpack-dev-server/commit/d63a0a298739d599f2161b237a750220c314deef))\n* update negated descriptions for more options ([#4287](https://github.com/webpack/webpack-dev-server/issues/4287)) ([c64bd94](https://github.com/webpack/webpack-dev-server/commit/c64bd94fb75c30984281f71ad3c20393fcb5ee67))\n* update schema to have `negatedDescription` only for type `boolean` ([#4280](https://github.com/webpack/webpack-dev-server/issues/4280)) ([fcf8e8e](https://github.com/webpack/webpack-dev-server/commit/fcf8e8e6a9951f4283e796df3ad72cc803e634a3))\n\n### [4.7.4](https://github.com/webpack/webpack-dev-server/compare/v4.7.3...v4.7.4) (2022-02-02)\n\n\n### Bug Fixes\n\n* add @types/express ([#4226](https://github.com/webpack/webpack-dev-server/issues/4226)) ([e55f728](https://github.com/webpack/webpack-dev-server/commit/e55f728d3b5262884aa80daf9b021198b4bc65a9))\n* negative descriptions ([#4216](https://github.com/webpack/webpack-dev-server/issues/4216)) ([fd854c0](https://github.com/webpack/webpack-dev-server/commit/fd854c07c2a4654f479bdbad1b717d9406ce15c6))\n* types for the `proxy` option ([#4173](https://github.com/webpack/webpack-dev-server/issues/4173)) ([efec2f5](https://github.com/webpack/webpack-dev-server/commit/efec2f5bfb5ff4b99258b12317aa0d922836738e))\n* use CLI specific description for `--open-app-name` and `--web-socket-server` ([#4215](https://github.com/webpack/webpack-dev-server/issues/4215)) ([329679a](https://github.com/webpack/webpack-dev-server/commit/329679a434219adc43f2d73c2ceeda14787dc64d))\n\n### [4.7.3](https://github.com/webpack/webpack-dev-server/compare/v4.7.2...v4.7.3) (2022-01-11)\n\n### Security\n\n* update `selfsigned` to `2.0.0` version\n\n### [4.7.2](https://github.com/webpack/webpack-dev-server/compare/v4.7.1...v4.7.2) (2021-12-29)\n\n\n### Bug Fixes\n\n* apply `onAfterSetupMiddleware` after `setupMiddlewares` (as behavior earlier) ([f6bc644](https://github.com/webpack/webpack-dev-server/commit/f6bc644bb81b966e030d8f8a54d5a99cd61ec8f2))\n\n### [4.7.1](https://github.com/webpack/webpack-dev-server/compare/v4.7.0...v4.7.1) (2021-12-22)\n\n\n### Bug Fixes\n\n* removed `url` package, fixed compatibility with future webpack defaults ([#4132](https://github.com/webpack/webpack-dev-server/issues/4132)) ([4e5d8ea](https://github.com/webpack/webpack-dev-server/commit/4e5d8eae654ef382697722c6406dbc96207594aa))\n\n## [4.7.0](https://github.com/webpack/webpack-dev-server/compare/v4.6.0...v4.7.0) (2021-12-21)\n\n\n### Features\n\n* added the `setupMiddlewares` option and deprecated `onAfterSetupMiddleware` and `onBeforeSetupMiddleware` options ([#4068](https://github.com/webpack/webpack-dev-server/issues/4068)) ([c13aa56](https://github.com/webpack/webpack-dev-server/commit/c13aa560651a3bb4c4a7b1b4363c04383596c7e9))\n* added types ([8f02c3f](https://github.com/webpack/webpack-dev-server/commit/8f02c3f3d6131fd37f58ef4d5cbe15578c94a6fd))\n* show deprecation warning for `cacert` option ([#4115](https://github.com/webpack/webpack-dev-server/issues/4115)) ([c73ddfb](https://github.com/webpack/webpack-dev-server/commit/c73ddfb934ec748e3dd34456d4293b933e9c6c99))\n\n\n### Bug Fixes\n\n* add description for `watchFiles` options ([#4057](https://github.com/webpack/webpack-dev-server/issues/4057)) ([75f3817](https://github.com/webpack/webpack-dev-server/commit/75f381751e5377ae297c32f9fcdcd096ef28c5c2))\n* allow passing options for custom server ([#4110](https://github.com/webpack/webpack-dev-server/issues/4110)) ([fc8bed9](https://github.com/webpack/webpack-dev-server/commit/fc8bed95251f27a24c1441307c44782f3836edd6))\n* correct schema for `ClientLogging` ([#4084](https://github.com/webpack/webpack-dev-server/issues/4084)) ([9b7ae7b](https://github.com/webpack/webpack-dev-server/commit/9b7ae7b5f4ac4a920b1ae3b47a8eb15d093cb369))\n* mark `--open-app` deprecated in favor of `--open-app-name` ([#4091](https://github.com/webpack/webpack-dev-server/issues/4091)) ([693c28a](https://github.com/webpack/webpack-dev-server/commit/693c28a0499e431b09274b8b7ecce71adb292c8f))\n* show deprecation warning for both `https` and `http2` ([#4069](https://github.com/webpack/webpack-dev-server/issues/4069)) ([d8d5d71](https://github.com/webpack/webpack-dev-server/commit/d8d5d71c8ca495098e1ee30ebc72ffd657ad5ba0))\n* update `--web-socket-server` description ([#4098](https://github.com/webpack/webpack-dev-server/issues/4098)) ([65955e9](https://github.com/webpack/webpack-dev-server/commit/65955e96cf7869dd4294699fd2a3878c2179c656))\n* update `listen` and `close` deprecation warning message ([#4097](https://github.com/webpack/webpack-dev-server/issues/4097)) ([b217a19](https://github.com/webpack/webpack-dev-server/commit/b217a191d09a93e8dcc1fff2ee26e97857e096d3))\n* update descriptions of `https` and `server` options ([#4094](https://github.com/webpack/webpack-dev-server/issues/4094)) ([f97c9e2](https://github.com/webpack/webpack-dev-server/commit/f97c9e2df460ef9a84c8ab2016c6bce3c90d93ac))\n\n## [4.6.0](https://github.com/webpack/webpack-dev-server/compare/v4.5.0...v4.6.0) (2021-11-25)\n\n\n### Features\n\n* allow to pass all `chokidar` options ([#4025](https://github.com/webpack/webpack-dev-server/issues/4025)) ([5026601](https://github.com/webpack/webpack-dev-server/commit/5026601bd670eb65bdddabc208ec9ae73a58e592))\n\n\n### Bug Fixes\n\n* reconnection logic ([#4044](https://github.com/webpack/webpack-dev-server/issues/4044)) ([9b32c96](https://github.com/webpack/webpack-dev-server/commit/9b32c968fd96a57f5bab36416f79e649ab3a4a2c))\n* reload on warnings ([#4056](https://github.com/webpack/webpack-dev-server/issues/4056)) ([1ba9720](https://github.com/webpack/webpack-dev-server/commit/1ba97201f71b8a5b8f67281059f4834e55bf8f67))\n\n## [4.5.0](https://github.com/webpack/webpack-dev-server/compare/v4.4.0...v4.5.0) (2021-11-13)\n\n\n### Features\n\n* add `--web-socket-server-type` option for CLI ([#4001](https://github.com/webpack/webpack-dev-server/issues/4001)) ([17c390a](https://github.com/webpack/webpack-dev-server/commit/17c390a04e474a675255eb25132b423e0614253f))\n* show deprecation warning for `https`/`http2` option, [migration guide for `https`](https://github.com/webpack/webpack-dev-server/tree/main/examples/server/https) and [migration guide for `http2`](https://github.com/webpack/webpack-dev-server/tree/main/examples/server/spdy) (because we use [`spdy`](https://github.com/spdy-http2/node-spdy) for http2 due `express` doesn't support http2) ([#4003](https://github.com/webpack/webpack-dev-server/issues/4003)) ([521cf85](https://github.com/webpack/webpack-dev-server/commit/521cf852a81c5913e17cf36c90140c566d4218e5))\n\n\n### Bug Fixes\n\n* infinity refresh on warnings ([#4006](https://github.com/webpack/webpack-dev-server/issues/4006)) ([10da223](https://github.com/webpack/webpack-dev-server/commit/10da2238b0fce26973160ef03ba0dd35d5bc0568))\n* invalid host message is missing on client with https ([#3997](https://github.com/webpack/webpack-dev-server/issues/3997)) ([#3998](https://github.com/webpack/webpack-dev-server/issues/3998)) ([ff0869c](https://github.com/webpack/webpack-dev-server/commit/ff0869cb08cd886ed5b1f8265736d514358c7305))\n* remove process listeners after stopping the server ([#4013](https://github.com/webpack/webpack-dev-server/issues/4013)) ([d198e4e](https://github.com/webpack/webpack-dev-server/commit/d198e4e138c194427af596663c129515353db9c4))\n\n## [4.4.0](https://github.com/webpack/webpack-dev-server/compare/v4.3.1...v4.4.0) (2021-10-27)\n\n\n### Features\n\n* added the `server` option, now you can pass server options, example `{ server: { type: 'http', options: { maxHeaderSize: 32768 } } }`, available options for [`http`](https://nodejs.org/api/http.html#httpcreateserveroptions-requestlistener) and [`https`](https://nodejs.org/api/https.html#httpscreateserveroptions-requestlistener), note - for `http2` is used [`spdy`](https://github.com/spdy-http2/node-spdy), options specified in the `server.options` option take precedence over `https`/`http2` options ([#3940](https://github.com/webpack/webpack-dev-server/issues/3940)) ([a70a7ef](https://github.com/webpack/webpack-dev-server/commit/a70a7ef025f07ec6be69cee0b3b5204c7e3a0c5b))\n* added the `client.reconnect` option ([#3912](https://github.com/webpack/webpack-dev-server/issues/3912)) ([5edad76](https://github.com/webpack/webpack-dev-server/commit/5edad76bb099713210b2a8c5c29d22371df7371e))\n* improve error handling within `startCallback` and `endCallback` ([#3969](https://github.com/webpack/webpack-dev-server/issues/3969)) ([b0928ac](https://github.com/webpack/webpack-dev-server/commit/b0928acadccd2251a9eb165bfae0c63c84d0d745))\n\n\n### Bug Fixes\n\n* schema for web socket server type ([#3913](https://github.com/webpack/webpack-dev-server/issues/3913)) ([f6aa6f7](https://github.com/webpack/webpack-dev-server/commit/f6aa6f7979dae5a44ff4597b7338027c5aab869a))\n* typo in SSL information log ([#3939](https://github.com/webpack/webpack-dev-server/issues/3939)) ([4c6103b](https://github.com/webpack/webpack-dev-server/commit/4c6103ba9495a29c6e142373c8dad084a20b6bc8))\n\n### [4.3.1](https://github.com/webpack/webpack-dev-server/compare/v4.3.0...v4.3.1) (2021-10-04)\n\n\n### Bug Fixes\n\n* perf ([#3906](https://github.com/webpack/webpack-dev-server/issues/3906)) ([f6e2a19](https://github.com/webpack/webpack-dev-server/commit/f6e2a1981d4c552368cd06ccf5dc400db298c2d6))\n\n## [4.3.0](https://github.com/webpack/webpack-dev-server/compare/v4.2.1...v4.3.0) (2021-09-25)\n\n\n### Features\n\n* allow array for `headers` option ([#3847](https://github.com/webpack/webpack-dev-server/issues/3847)) ([9911437](https://github.com/webpack/webpack-dev-server/commit/9911437186a28b2249adfb282524361d7afe6c25))\n* gracefully and force shutdown ([#3880](https://github.com/webpack/webpack-dev-server/issues/3880)) ([db24b16](https://github.com/webpack/webpack-dev-server/commit/db24b16e66a63a51e5bacead47ed30c3bf21ff5b))\n\n\n### Bug Fixes\n\n* avoid web socket connection when web socket server is not running ([#3879](https://github.com/webpack/webpack-dev-server/issues/3879)) ([8874d72](https://github.com/webpack/webpack-dev-server/commit/8874d72f2ee8f11c8420de131e8335982e516727))\n* display file name for warnings/errors in overlay ([#3867](https://github.com/webpack/webpack-dev-server/issues/3867)) ([d20def5](https://github.com/webpack/webpack-dev-server/commit/d20def5c71609ad97ea783716c53070235f398cc))\n* formatting errors/warnings ([#3877](https://github.com/webpack/webpack-dev-server/issues/3877)) ([f0dbea0](https://github.com/webpack/webpack-dev-server/commit/f0dbea019c822e7e4b7e5ed81a6a9588e9521d73))\n* handle 0 value of the `port` option property ([ed67f66](https://github.com/webpack/webpack-dev-server/commit/ed67f66fc41eb1dd83fb84ecaa18703559dbe2ae))\n\n### [4.2.1](https://github.com/webpack/webpack-dev-server/compare/v4.2.0...v4.2.1) (2021-09-13)\n\n\n### Bug Fixes\n\n* infinity loop for multi compiler mode ([#3840](https://github.com/webpack/webpack-dev-server/issues/3840)) ([e019bd2](https://github.com/webpack/webpack-dev-server/commit/e019bd24ea061c4839a4667f8bd75a04b9a48128))\n* reloading logic for multi compiler mode ([#3841](https://github.com/webpack/webpack-dev-server/issues/3841)) ([ef148ec](https://github.com/webpack/webpack-dev-server/commit/ef148ec1feb66d0f72457d0b2de853b76b06b3c9))\n\n### [4.2.0](https://github.com/webpack/webpack-dev-server/compare/v4.1.1...v4.2.0) (2021-09-09)\n\n\n### Features\n\n* added the `http.ca` option (CLI option added too) (should be used instead `cacert`, because we will remove it in the next major release in favor the `https.ca` option)\n* added the `https.crl` option (CLI options added too), [more information](https://nodejs.org/api/tls.html#tls_tls_createsecurecontext_options)\n* `https.ca`/`https.cacert`/ `https.cert`/`https.crl`/`https.key`/`https.pfx` options are now accept Arrays of `Buffer`/`string`/Path to file, using `--https-*-reset` CLI options you can reset these options\n* `https.pfx`/`https.key` can be `Object[]`, [more information](https://nodejs.org/api/tls.html#tls_tls_createsecurecontext_options)\n* `https` options can now accept custom options, you can use:\n\n```js\nmodule.exports = {\n  // Other options\n  devServer: {\n    https: {\n      // Allow to set additional TSL options https://nodejs.org/api/tls.html#tls_tls_createsecurecontext_options\n      minVersion: \"TLSv1.1\",\n      ca: path.join(httpsCertificateDirectory, \"ca.pem\"),\n      pfx: path.join(httpsCertificateDirectory, \"server.pfx\"),\n      key: path.join(httpsCertificateDirectory, \"server.key\"),\n      cert: path.join(httpsCertificateDirectory, \"server.crt\"),\n      passphrase: \"webpack-dev-server\",\n    },\n  }\n};\n```\n\n### Bug Fixes\n\n* accept connections with `file:` and `chrome-extensions:` protocol by default ([#3822](https://github.com/webpack/webpack-dev-server/issues/3822)) ([138f064](https://github.com/webpack/webpack-dev-server/commit/138f0641a4aa040fa2ff66dfd8891c920aa17808))\n* close overlay on disconnection ([#3825](https://github.com/webpack/webpack-dev-server/issues/3825)) ([011bcf1](https://github.com/webpack/webpack-dev-server/commit/011bcf15c7eba8f7dcd45731f8e434b2eccf781e))\n* respect `https.cacert` option ([#3820](https://github.com/webpack/webpack-dev-server/issues/3820)) ([0002ebf](https://github.com/webpack/webpack-dev-server/commit/0002ebfbc8f36e92f91013372c9e2bca97022825))\n\n### [4.1.1](https://github.com/webpack/webpack-dev-server/compare/v4.1.0...v4.1.1) (2021-09-07)\n\n\n### Bug Fixes\n\n* improve the description of the `magicHtml` option ([#3772](https://github.com/webpack/webpack-dev-server/issues/3772)) ([b80610f](https://github.com/webpack/webpack-dev-server/commit/b80610f07357c3b2ae8557f6d371e4d563ae3c53))\n* replace `ansi-html` with `ansi-html-community` to avoid CVE ([#3801](https://github.com/webpack/webpack-dev-server/issues/3801)) ([36fd214](https://github.com/webpack/webpack-dev-server/commit/36fd21477dac5131ec266cc1d717d87051f10a2b))\n\n## [4.1.0](https://github.com/webpack/webpack-dev-server/compare/v4.0.0...v4.1.0) (2021-08-31)\n\n\n### Features\n\n* added the `magicHtml` option ([#3717](https://github.com/webpack/webpack-dev-server/issues/3717)) ([4831f58](https://github.com/webpack/webpack-dev-server/commit/4831f58a75d12f75f4d5e5064ff3245f1a3770ba))\n* allow to set `hot` and `live-reload` for client using search params ([1c57680](https://github.com/webpack/webpack-dev-server/commit/1c576802bff4a4be78b1771ed2fc8f343780663b))\n* show warning when the `hot` option is enabled with the HMR plugin in config ([#3744](https://github.com/webpack/webpack-dev-server/issues/3744)) ([6cb1e4e](https://github.com/webpack/webpack-dev-server/commit/6cb1e4e6a25de3fb284be84d2ad67fc701800b96))\n\n### Bug Fixes\n\n* change log type of `Disconnected!` to `info` ([fde27f5](https://github.com/webpack/webpack-dev-server/commit/fde27f5002ae3d679b2cee2215287f6e3a16febf))\n* handle `--allowed-hosts all` correctly ([#3720](https://github.com/webpack/webpack-dev-server/issues/3720)) ([326ed56](https://github.com/webpack/webpack-dev-server/commit/326ed567638944bc3b64e185b118f9e723383e44))\n* output documentation link on errors ([#3680](https://github.com/webpack/webpack-dev-server/issues/3680)) ([e16221b](https://github.com/webpack/webpack-dev-server/commit/e16221b1aed48f93c31c8659438834fdbf1e62bf))\n* respect the `bypass` option with `target`/`router` options for proxy ([b5dd568](https://github.com/webpack/webpack-dev-server/commit/b5dd5687e521cd70e7e13b397280d8bda38df255))\n\n## [4.0.0](https://github.com/webpack/webpack-dev-server/compare/v4.0.0-rc.1...v4.0.0) (2021-08-18)\n\n## Notes:\n\n- migration guide from v3 to v4 can be found [here](https://github.com/webpack/webpack-dev-server/blob/main/migration-v4.md)\n\n### Bug Fixes\n\n* improve https CLI output ([#3673](https://github.com/webpack/webpack-dev-server/issues/3673)) ([f2d87fb](https://github.com/webpack/webpack-dev-server/commit/f2d87fb2dc3f9545dd9203beda8bf9ac056c70f6))\n* initial reloading for lazy compilation ([#3662](https://github.com/webpack/webpack-dev-server/issues/3662)) ([1768d6b](https://github.com/webpack/webpack-dev-server/commit/1768d6b7913055dad02318a49de65df2e93baa4f))\n* respect protocol from browser for manual setup ([#3675](https://github.com/webpack/webpack-dev-server/issues/3675)) ([cdcabb2](https://github.com/webpack/webpack-dev-server/commit/cdcabb240f9afcab504ca26fbf71d3af013dd806))\n\n## [4.0.0-rc.1](https://github.com/webpack/webpack-dev-server/compare/v4.0.0-rc.0...v4.0.0-rc.1) (2021-08-17)\n\n## Notes:\n\n- migration guide from v3 to v4 can be found [here](https://github.com/webpack/webpack-dev-server/blob/main/migration-v4.md)\n\n### Features\n\n* async API ([#3608](https://github.com/webpack/webpack-dev-server/issues/3608)) ([974ce25](https://github.com/webpack/webpack-dev-server/commit/974ce25669ef6a4f55e8a7576fc140bc7ccb55f1))\n* use ECMA modules in client ([#3550](https://github.com/webpack/webpack-dev-server/issues/3550)) ([9307755](https://github.com/webpack/webpack-dev-server/commit/93077552c2bac020650936316dc93e03245b7a19))\n\n\n### Bug Fixes\n\n* fix usage legacy API ([#3660](https://github.com/webpack/webpack-dev-server/issues/3660)) ([c4678bc](https://github.com/webpack/webpack-dev-server/commit/c4678bc467370e7dc74d06a8b898515e448d0da0))\n* proxy logging and allow to pass options without the `target` option ([#3651](https://github.com/webpack/webpack-dev-server/issues/3651)) ([6e2cbde](https://github.com/webpack/webpack-dev-server/commit/6e2cbde16b0d071b6dd5c243b1b0e867b69575c5))\n* render ansi formatted error messages correctly in overlay ([#3579](https://github.com/webpack/webpack-dev-server/issues/3579)) ([9313454](https://github.com/webpack/webpack-dev-server/commit/9313454066c2a830b425965837a2756d8f945e97))\n* use value of the `infastructureLogging.level` option by default for `client.logging`. ([#3613](https://github.com/webpack/webpack-dev-server/issues/3613)) ([c9ccc96](https://github.com/webpack/webpack-dev-server/commit/c9ccc96f9d5cd9930f69b927b248d52509ec1e55))\n* schema for the `host` option ([#3549](https://github.com/webpack/webpack-dev-server/issues/3549)) ([7200d31](https://github.com/webpack/webpack-dev-server/commit/7200d3101403864b3ca795c6bf028197e9f62183))\n* show deprecation warning for incorrect usage of Node.js API ([#3563](https://github.com/webpack/webpack-dev-server/issues/3563)) ([62b21ff](https://github.com/webpack/webpack-dev-server/commit/62b21ffb028685e76ee715babfe53d5a9606fbbc))\n\n## [4.0.0-rc.0](https://github.com/webpack/webpack-dev-server/compare/v4.0.0-beta.3...v4.0.0-rc.0) (2021-07-19)\n\n\n## Notes:\n\n- migration guide from v3 to v4 can be found [here](https://github.com/webpack/webpack-dev-server/blob/main/migration-v4.md)\n\n### ⚠ BREAKING CHANGES\n\n* rename `client.transport` to `client.webSocketTransport`\n* move web socket client to web socket server class, i.e. to get web socket clients use `this.webSocketServer.clients`\n* remove entry options (i.e. `hotEntry` and `needClientEntry`) in favor manual setup entries (#3494)\n* you need to reset CLI options using `reset` option, please look them in `webpack serve --help`\n* `host` and `port` options can't be `null` or empty string\n\n### Features\n\n* allow to close overlay in browser ([#3433](https://github.com/webpack/webpack-dev-server/issues/3433)) ([307f2e7](https://github.com/webpack/webpack-dev-server/commit/307f2e7879b6c1ee18f279eb8f6d30509d550a86))\n* add port `auto` ([#3297](https://github.com/webpack/webpack-dev-server/issues/3297)) ([437c8d3](https://github.com/webpack/webpack-dev-server/commit/437c8d3be7041e4203920d3d8a6af5a8071406fd))\n* added `<url>` pattern for open and allow to use multiple browsers ([#3496](https://github.com/webpack/webpack-dev-server/issues/3496)) ([7c7ccf9](https://github.com/webpack/webpack-dev-server/commit/7c7ccf9c6cf2a26f980b725e9ba8ee9e48e5d397))\n* allow string value for `client.webSocketURL.port` ([#3354](https://github.com/webpack/webpack-dev-server/issues/3354)) ([f5e7f8f](https://github.com/webpack/webpack-dev-server/commit/f5e7f8f6d2236d01b8e9562a23d9db077ce4032e))\n* allow to disable web socket server using `webSocketServer: false` ([f62f20f](https://github.com/webpack/webpack-dev-server/commit/f62f20f301e39ac16be089f2d51129443838b921))\n* allow `username` and `password` in clientURL ([#3452](https://github.com/webpack/webpack-dev-server/issues/3452)) ([a7225d5](https://github.com/webpack/webpack-dev-server/commit/a7225d5efc473549619f6121570b33c76b4fda7e))\n* display documentation links on errors ([#3512](https://github.com/webpack/webpack-dev-server/issues/3512)) ([54790ab](https://github.com/webpack/webpack-dev-server/commit/54790abab19ccfc6a96461c32675d410551f902a))\n* enable `compress` by default ([#3303](https://github.com/webpack/webpack-dev-server/issues/3303)) ([4d251b5](https://github.com/webpack/webpack-dev-server/commit/4d251b5c29418aba447021517158e0348dc37d32))\n* implement the `client.webSocketURL.protocol` option ([#3380](https://github.com/webpack/webpack-dev-server/issues/3380)) ([8998d6b](https://github.com/webpack/webpack-dev-server/commit/8998d6b3a28251c5f8a6481d134f7557c5dc8e2b))\n* the `ipc` option was added for unix socket ([#3479](https://github.com/webpack/webpack-dev-server/issues/3479)) ([b559738](https://github.com/webpack/webpack-dev-server/commit/b559738047bbe6f9bf508747c8ed188dacdec258))\n* support `Function` in headers option ([#3267](https://github.com/webpack/webpack-dev-server/issues/3267)) ([28f9597](https://github.com/webpack/webpack-dev-server/commit/28f95978f6494885a5f6402ec14e9290bcae6bf4))\n\n\n### Bug Fixes\n\n* allow to use `80` port for dev server ([#3487](https://github.com/webpack/webpack-dev-server/issues/3487)) ([22f18eb](https://github.com/webpack/webpack-dev-server/commit/22f18ebfae77df0d75a44f2fa136cfecd655bce7))\n* avoid duplicate `App updated. Recompiling...` ([#3488](https://github.com/webpack/webpack-dev-server/issues/3488)) ([a2e3ead](https://github.com/webpack/webpack-dev-server/commit/a2e3eaddd400e77668b8ab6585fef89ffb963ede))\n* do not allow empty string for `port` ([#3372](https://github.com/webpack/webpack-dev-server/issues/3372)) ([8c53102](https://github.com/webpack/webpack-dev-server/commit/8c53102840c2a0310931c43ccf320226bec74766))\n* don't allow empty array for `allowedHosts` option ([#3451](https://github.com/webpack/webpack-dev-server/issues/3451)) ([17aa345](https://github.com/webpack/webpack-dev-server/commit/17aa345b36fa8d70c9242015303b814de55cfa71))\n* get rid of Symbol core-js polyfill ([#3535](https://github.com/webpack/webpack-dev-server/issues/3535)) ([7afe3d2](https://github.com/webpack/webpack-dev-server/commit/7afe3d2559d7f4145fe67bbffa8994498ee3a3b6))\n* the `host` option can't be `null` or empty string ([#3352](https://github.com/webpack/webpack-dev-server/issues/3352)) ([216b0d3](https://github.com/webpack/webpack-dev-server/commit/216b0d3c71a617eeef32cff523f95fcd8916af72))\n* improve message for static content changes ([#3289](https://github.com/webpack/webpack-dev-server/issues/3289)) ([970a7d7](https://github.com/webpack/webpack-dev-server/commit/970a7d7bbee1be33c749ee3faae344fc6567a599))\n* improve processing of CLI flags ([#3313](https://github.com/webpack/webpack-dev-server/issues/3313)) ([32bc877](https://github.com/webpack/webpack-dev-server/commit/32bc877f378af5fbf893d9e152369ed68ab127ee))\n* rename `firewall` option to `allowedHosts` option ([#3345](https://github.com/webpack/webpack-dev-server/issues/3345)) ([81e4e55](https://github.com/webpack/webpack-dev-server/commit/81e4e557a07381980083efdeb99eb26265b38aae))\n* pass own logger in historyApiFallback ([#3373](https://github.com/webpack/webpack-dev-server/issues/3373)) ([3ba2fa5](https://github.com/webpack/webpack-dev-server/commit/3ba2fa5817c49e95424f7dfab2ca0a94af82996b))\n* polling usage in watchFiles option ([#3366](https://github.com/webpack/webpack-dev-server/issues/3366)) ([2afb223](https://github.com/webpack/webpack-dev-server/commit/2afb223fb5384da2416ecf4b39ac45963d9ee2d5))\n* postpone initialize ([#3467](https://github.com/webpack/webpack-dev-server/issues/3467)) ([80087de](https://github.com/webpack/webpack-dev-server/commit/80087dec9a816e6d68984b18a82e875b1a826835))\n* regression with `port` and `bonjour` ([c2805fe](https://github.com/webpack/webpack-dev-server/commit/c2805fe5a3c359809e315d9ba55849a5bbbe3ecf))\n* rename `path` to `pathname` for `client.webSocketURL` ([#3466](https://github.com/webpack/webpack-dev-server/issues/3466)) ([fd63e02](https://github.com/webpack/webpack-dev-server/commit/fd63e02ff58ed7e3ab2dcb84a36f0d49c1d553a2))\n* respect `logLevel` and `logProvider` option for proxy ([#3257](https://github.com/webpack/webpack-dev-server/issues/3257)) ([199baec](https://github.com/webpack/webpack-dev-server/commit/199baec187376213f55d8d0542798f4945b8cce5))\n* show plugin name in progress log ([#3337](https://github.com/webpack/webpack-dev-server/issues/3337)) ([b8a0932](https://github.com/webpack/webpack-dev-server/commit/b8a09323cb0d6f009459f77b618722408dfbe68c))\n\n## [4.0.0-beta.3](https://github.com/webpack/webpack-dev-server/compare/v4.0.0-beta.2...v4.0.0-beta.3) (2021-05-06)\n\n\n### ⚠ BREAKING CHANGES\n\n* the `https.ca` option was removed in favor the `https.cacert` option\n* the `dev` option was renamed to `devMiddleware`\n* the `client.overlay` option is `true` by default and show warnings by default\n* use server port for websocket connection by default, if you proxied `webpack-dev-server`, please update `webpack-cli` to `v4.7.0` ([#3185](https://github.com/webpack/webpack-dev-server/issues/3185)) ([0c3f817](https://github.com/webpack/webpack-dev-server/commit/0c3f8178bc80d7272246fe810964561ae747ec49))\n* minimum supported Node.js version is `12.13.0`\n\n### Features\n\n* added `https.cacert` ([#3240](https://github.com/webpack/webpack-dev-server/issues/3240)) ([b212a2c](https://github.com/webpack/webpack-dev-server/commit/b212a2ce73c3e58f3450708801c8b413ca65fb5b))\n* added more CLI options, please run `webpack server --help` to look at them ([#3238](https://github.com/webpack/webpack-dev-server/issues/3238)) ([469e558](https://github.com/webpack/webpack-dev-server/commit/469e558d1d772006a1057954331ccecd34dfdefa))\n* support `bonjour` options ([#3202](https://github.com/webpack/webpack-dev-server/issues/3202)) ([5534583](https://github.com/webpack/webpack-dev-server/commit/55345836c2d8e22e45c2150a8f003019d8a0bd56))\n\n### Bug Fixes\n\n* improve warning message for `open` ([#3191](https://github.com/webpack/webpack-dev-server/issues/3191)) ([d473fd9](https://github.com/webpack/webpack-dev-server/commit/d473fd9a55334efd8d349aa2b37c64b395dea025))\n* respect the `client.logging` option for HMR logging ([#3159](https://github.com/webpack/webpack-dev-server/issues/3159)) ([6f3c6ba](https://github.com/webpack/webpack-dev-server/commit/6f3c6bacb1b7f6eae95e5b688dc22b5a42628360))\n* respect `client.needClientEntry` and `client.needHotEntry` options ([#3178](https://github.com/webpack/webpack-dev-server/issues/3178)) ([a2b6db9](https://github.com/webpack/webpack-dev-server/commit/a2b6db9417eb289a488584e8b244fcedc416ac56))\n* overlay with warnings ([#3215](https://github.com/webpack/webpack-dev-server/issues/3215)) ([7e18161](https://github.com/webpack/webpack-dev-server/commit/7e181618ba7a8ce995bf39ded00a789a9714a14b))\n* help description for options\n* error description for options\n* improve warning message for the `open` option\n\n## [4.0.0-beta.2](https://github.com/webpack/webpack-dev-server/compare/v4.0.0-beta.1...v4.0.0-beta.2) (2021-04-06)\n\n\n### ⚠ BREAKING CHANGES\n\n* the `openPage` option and the `--open-page` CLI option were removed in favor `{ open: ['/my-page', '/my-other-page/'] }` for Node.js API and `--open-target [URL]` (without `[URL]` dev server will open a browser using the `host` option value) and `--open-app <browser>` for CLI\n* the `useLocalIp` option was removed in favor `{ host: 'local-ip' }`, alternative you can provide values: `local-ipv4` for IPv4 and `local-ipv6` for IPv6\n* `stdin` option was removed in favor `--watch-options-stdin`\n* `injectClient` and `injectHot` was removed in favor `client.needClientEntry` and `client.needHotEntry`\n\n### Features\n\n* added the `watchFiles` option, now you can reload server on file changes, for example `{ watchFiles: ['src/**/*.php', 'public/**/*'] }` ([#3136](https://github.com/webpack/webpack-dev-server/issues/3136)) ([d73213a](https://github.com/webpack/webpack-dev-server/commit/d73213ab04b9cae38364a0c68dfc3bdfd8df227f))\n* added more CLI options, please run `webpack server --help` ([#3148](https://github.com/webpack/webpack-dev-server/issues/3148)) ([03a2b27](https://github.com/webpack/webpack-dev-server/commit/03a2b27011098b6b98b3d20c4c46a949c4f05355))\n* enable overlay by default ([#3108](https://github.com/webpack/webpack-dev-server/issues/3108)) ([5e05e48](https://github.com/webpack/webpack-dev-server/commit/5e05e48a56232038c1341f2c0deae3d35a1add47))\n* you can specify multiple targets and browsers for the `open` option, i.e. `{ open: { target: ['/my-page', '/my-other-page'], app: ['google-chrome', '--incognito'] } }` ([e3c2683](https://github.com/webpack/webpack-dev-server/commit/e3c26835fae88a478baad477d537bd0ff1424db9))\n\n\n### Bug Fixes\n\n* `/webpack-dev-server` url shows list of files ([#3101](https://github.com/webpack/webpack-dev-server/issues/3101)) ([b3374c3](https://github.com/webpack/webpack-dev-server/commit/b3374c3ec2e07e4ba41e4ef40beaff5b9da2eccc))\n* dev server client compatibility with `IE11`/`IE10`/`IE9` ([#3129](https://github.com/webpack/webpack-dev-server/issues/3129)) ([1e3e656](https://github.com/webpack/webpack-dev-server/commit/1e3e656b5871456a483401f829a4dd4e67d48863))\n\n  * For `IE11`/`IE10` you need polyfill `fetch()` and `Promise`, example:\n  \n  ```js\n  module.exports = {\n    entry: {\n      entry: [\n        \"whatwg-fetch\", \n        \"core-js/features/promise\", \n        \"./entry.js\"\n      ],\n    },\n  };\n  ```\n  \n  * For `IE9` you need polyfill `fetch()` and `Promise` and use `sockjs` for communications (because `WebSocket` is not supported), example:\n  \n  ```js\n  module.exports = {\n    entry: {\n      entry: [\n        \"whatwg-fetch\", \n        \"core-js/features/promise\", \n        \"./entry.js\"\n      ],\n    },\n    devServer: {\n      transportMode: \"sockjs\",\n    },\n  };\n  ```\n  \n  IE8 is not supported\n\n* hostname resolving ([#3128](https://github.com/webpack/webpack-dev-server/issues/3128)) ([cd39491](https://github.com/webpack/webpack-dev-server/commit/cd39491ea395c985f2014dfc03379db5c894f711))\n* improve CLI options ([#3151](https://github.com/webpack/webpack-dev-server/issues/3151)) ([09fa827](https://github.com/webpack/webpack-dev-server/commit/09fa827c0abbce271fa70f3553b004ff64d16b32))\n* output description on invalid options ([#3154](https://github.com/webpack/webpack-dev-server/issues/3154)) ([2e02978](https://github.com/webpack/webpack-dev-server/commit/2e02978f921ebdbda020f746f35c86048de9b2ee))\n* prefer to open the `host` option ([#3115](https://github.com/webpack/webpack-dev-server/issues/3115)) ([7e525eb](https://github.com/webpack/webpack-dev-server/commit/7e525ebe35201996d047d14af05709b0b082ae7a))\n* reduce number of `dependencies`\n\n## [4.0.0-beta.1](https://github.com/webpack/webpack-dev-server/compare/v4.0.0-beta.0...v4.0.0-beta.1) (2021-03-23)\n\n\n### ⚠ BREAKING CHANGES\n\n* `--hot-only` option was removed\n* default value of the `static` option is `path.resolve(process.cwd(), 'public')`, previously `path.resolve(process.cwd(), 'static')`\n* the `overlay` option was moved into the `client` option\n\n### Features\n\n* add more negative flags - `--no-https`, `--no-http2`, `--no-compress` and `--no-history-api-fallback` ([#3070](https://github.com/webpack/webpack-dev-server/issues/3070)) ([ebc966f](https://github.com/webpack/webpack-dev-server/commit/ebc966f398c38c23c6d36b4be47f303ddfd29e7d))\n* allow `Boolean` type for the `--firewall` option ([#3041](https://github.com/webpack/webpack-dev-server/issues/3041)) ([6711c1d](https://github.com/webpack/webpack-dev-server/commit/6711c1dd175820d781eac0cad6287582e8def950))\n* improve output for localhost and fix open ([#2892](https://github.com/webpack/webpack-dev-server/issues/2892)) ([9e65c24](https://github.com/webpack/webpack-dev-server/commit/9e65c24214666241334b89c9e070f4d03bb0f317))\n* improve output for IPv4 and IPv6 ([#3092](https://github.com/webpack/webpack-dev-server/issues/3092)) ([f362665](https://github.com/webpack/webpack-dev-server/commit/f3626654f7af58c159971b4059a741c25ce58249))\n\n\n### Bug Fixes\n\n* allow to open browser with `--open-page` ([#3032](https://github.com/webpack/webpack-dev-server/issues/3032)) ([581ee07](https://github.com/webpack/webpack-dev-server/commit/581ee07b0c511cabb6c531d8a680fdcdfafbc003))\n* content security policy issue in client log ([2de2e01](https://github.com/webpack/webpack-dev-server/commit/2de2e010005f0424f872950abf6155b4aa9a1963))\n* empty and multiple entries support ([#2920](https://github.com/webpack/webpack-dev-server/issues/2920)) ([45f6592](https://github.com/webpack/webpack-dev-server/commit/45f65923ac808d77a70b3fd695cf3deeab0b6585))\n* improve descriptions for CLI options ([#3021](https://github.com/webpack/webpack-dev-server/issues/3021)) ([7d339d4](https://github.com/webpack/webpack-dev-server/commit/7d339d40a74842cbeae0b9c8ef20147af3a0f468))\n* improve descriptions for negative flags ([#3029](https://github.com/webpack/webpack-dev-server/issues/3029)) ([2e2190a](https://github.com/webpack/webpack-dev-server/commit/2e2190a4c54ddebafc729857e5650772635a50ec))\n* multi compiler mode with proxy ([#2905](https://github.com/webpack/webpack-dev-server/issues/2905)) ([247a92b](https://github.com/webpack/webpack-dev-server/commit/247a92b90c105a2e29432de4de8a32d147139c42))\n* remove double brackets from the ws url when using raw IPv6 address ([#2951](https://github.com/webpack/webpack-dev-server/issues/2951)) ([2ec8160](https://github.com/webpack/webpack-dev-server/commit/2ec81605127cec82fae5064dd59da2798a628e02))\n* show correct url in output status ([#3013](https://github.com/webpack/webpack-dev-server/issues/3013)) ([06b3d91](https://github.com/webpack/webpack-dev-server/commit/06b3d91918ed87c2b18f8df0ae4b6a5edee06137))\n* show detailed error in overlay ([ba01b05](https://github.com/webpack/webpack-dev-server/commit/ba01b051d3455d99fa88a8dd3279e74e420b2f42))\n* support `file:` and `chrome-extension:` protocols in client ([#2954](https://github.com/webpack/webpack-dev-server/issues/2954)) ([163bdce](https://github.com/webpack/webpack-dev-server/commit/163bdce5f067dd5bd1ed138b764657f8465586eb))\n* warnings in overlay ([#3054](https://github.com/webpack/webpack-dev-server/issues/3054)) ([6144c8d](https://github.com/webpack/webpack-dev-server/commit/6144c8dabd144413d4e86bfb0cd9d82d7363fb9d))\n* webpack-cli installation message ([#2955](https://github.com/webpack/webpack-dev-server/issues/2955)) ([b9ce07f](https://github.com/webpack/webpack-dev-server/commit/b9ce07fd83a53a1047c2f0f1f49d511aef2f7b29))\n\n\n## [4.0.0-beta.0](https://github.com/webpack/webpack-dev-server/compare/v3.11.0...v4.0.0-beta.0) (2020-11-27)\n\n### ⚠ BREAKING CHANGES\n\n* drop support `Node.js@6` and `Node.js@8`, minimum supported `Node.js` version is `Node@10`\n* the `hot` option is `true` by default\n* the `hotOnly` option was removed, if you need hot only mode, use `hot: 'only'` value\n* the default `transportMode` is switched from `sockjs` to `ws` (IE 11 and other old browsers doesn't support WebSocket, set `sockjs` value for `transportMode` if you need supports IE 11)\n* `before`, `after` and `setup` were removed in favor `onBeforeSetupMiddleware` (previously `before`) and `onAfterSetupMiddleware` options (previously `after`)\n* the `clientOptions` was renamed to the `client` option\n* the `key`, `cert`, `pfx`, `pfx-passphrase`, `cacert`, `ca` and `requestCert` options were moved to `https` options, please use `https.{key|cert|pfx|passphrase|requestCert|cacert|ca|requestCert}`\n* the `sockHost`, `sockPath` and `sockPort` options were removed in `client` option\n* the `inline` option (`iframe` live mode) was removed\n* the `lazy` and `filename` options were removed\n* the `features` option was removed\n* the `log`, `logLevel`, `logTime`, `noInfo`, `quiet`, `reporter` and `warn` options were removed in favor of built-in webpack logger, please read [this](https://webpack.js.org/configuration/other-options/#infrastructurelogginglevel) to enable and setup logging output\n* the `fs`, `index`, `mimeTypes`, `publicPath`, `serverSideRender`, and `writeToDisk` options were moved in the `dev` option (`webpack-dev-middleware` options)\n* updating `webpack-dev-middleware` to v4, which includes many breaking options changes, please [read](https://github.com/webpack/webpack-dev-middleware/releases)\n* the `stats` option was removed, please use the [`stats`](https://webpack.js.org/configuration/stats/) option from `webpack.config.js`\n* the `socket` option was removed\n* the `contentBase`, `contentBasePublicPath`, `serveIndex`, `staticOptions`, `watchContentBase`, `watchOptions` were removed in favor of the `static` option\n* the `disableHostCheck` and `allowedHosts` options were removed in favor of the `firewall` option\n* `server.listen()` will find free port if the `port` is not set and the `port` argument is not passed, also print a warning if the `port` option and the `port` argument passed to `server.listen()` are different\n* the `progress` option is moved to the `client` option, set `client: {progress: true}`\n* the `profile` option was removed, to print profile data, set `client: { progress: 'profile' }`\n* client uses the port of the current location (`location.port`, equivalent to `sockPort: 'location'`), by default. To get previously behavior, set the `client.port` with the port you'd like to set\n* client uses the hostname of the current location (`location.hostname`), by default. To get previously behavior, set the `client.host` with the hostname you'd like to set\n\n### Features\n\n* compatibility with `webpack@5`\n* compatibility with `webpack-cli@4`\n* added the `setupExitSignals` option, it takes a boolean and if true (default on CLI), the server will close and exit the process on SIGINT and SIGTERM\n* update `chokidar` to v3\n\n### Notes\n\nUnfortunately, due to the huge amount of changes it is very difficult to display all changes in a convenient form. Therefore, we offer you a couple of popular examples (feel free to send a PR with more examples).\n\n#### `static`\n\nPreviously `contentBase`, `contentBasePublicPath`, `serveIndex`, `staticOptions`, `watchContentBase` and `watchOptions`\n\n```js\nmodule.exports = {\n  // ...\n  devServer: {\n    // Can be:\n    // static: path.resolve(__dirname, 'static')\n    // static: false\n    static: [\n      // Simple example\n      path.resolve(__dirname, \"static\"),\n      // Complex example\n      {\n        directory: path.resolve(__dirname, \"static\"),\n        staticOptions: {},\n        // Don't be confused with `dev.publicPath`, it is `publicPath` for static directory\n        // Can be:\n        // publicPath: ['/static-public-path-one/', '/static-public-path-two/'],\n        publicPath: \"/static-public-path/\",\n        // Can be:\n        // serveIndex: {} (options for the `serveIndex` option you can find https://github.com/expressjs/serve-index)\n        serveIndex: true,\n        // Can be:\n        // watch: {} (options for the `watch` option you can find https://github.com/paulmillr/chokidar)\n        watch: true,\n      },\n    ],\n  },\n};\n```\n\n#### `publicPath`\n\n```js\nmodule.exports = {\n  // ...\n  devServer: {\n    dev: {\n      publicPath: \"/publicPathForDevServe\",\n    },\n  },\n};\n```\n\n#### `firewall`\n\nPreviously `disableHostCheck` and `allowedHosts`\n\n```js\nmodule.exports = {\n  // ...\n  devServer: {\n    // Can be\n    // firewall: ['192.168.0.1', 'domain.com']\n    firewall: false,\n  },\n};\n```\n\n#### logging\n\n```js\nmodule.exports = {\n  // ...\n  infrastructureLogging: {\n    // Only warnings and errors\n    // level: 'none' disable logging\n    // Please read https://webpack.js.org/configuration/other-options/#infrastructurelogginglevel\n    level: \"warn\",\n  },\n};\n```\n\n## [3.11.0](https://github.com/webpack/webpack-dev-server/compare/v3.10.3...v3.11.0) (2020-05-08)\n\n\n### Features\n\n* add icons for directory viewer ([#2441](https://github.com/webpack/webpack-dev-server/issues/2441)) ([e953d01](https://github.com/webpack/webpack-dev-server/commit/e953d01ca93764dabe38cedad8e7b9ef4e7f04bc))\n* allow multiple `contentBasePublicPath` paths ([#2489](https://github.com/webpack/webpack-dev-server/issues/2489)) ([c6bdfe4](https://github.com/webpack/webpack-dev-server/commit/c6bdfe4afb2ce3612c02142954c68a8e657c3915))\n* emit progress-update ([#2498](https://github.com/webpack/webpack-dev-server/issues/2498)) ([4808abd](https://github.com/webpack/webpack-dev-server/commit/4808abd434bac0511da688aee861f7e2d8b0c81c)), closes [#1666](https://github.com/webpack/webpack-dev-server/issues/1666)\n* add invalidate endpoint ([#2493](https://github.com/webpack/webpack-dev-server/issues/2493)) ([89ffb86](https://github.com/webpack/webpack-dev-server/commit/89ffb86cd26425c59e3937ca06a2c804a01b8f1d))\n* allow open option to accept an object ([#2492](https://github.com/webpack/webpack-dev-server/issues/2492)) ([adeb92e](https://github.com/webpack/webpack-dev-server/commit/adeb92e1e37551a6cbf3063942d6c2c7efbdff10))\n\n\n### Bug Fixes\n\n* do not swallow errors from server ([#2512](https://github.com/webpack/webpack-dev-server/issues/2512)) ([06583f2](https://github.com/webpack/webpack-dev-server/commit/06583f268b70f4a9715e4b747b1557055c419086))\n* security vulnerability in yargs-parser ([#2566](https://github.com/webpack/webpack-dev-server/issues/2566)) ([41d1d0c](https://github.com/webpack/webpack-dev-server/commit/41d1d0cf99f53df0569991a85489d3c8bc095af5))\n* don't crash on setupExitSignals(undefined) ([#2507](https://github.com/webpack/webpack-dev-server/issues/2507)) ([0d5c681](https://github.com/webpack/webpack-dev-server/commit/0d5c68143d780e631cdaf09081822fc87d7cb3ba))\n* support entry descriptor (closes [#2453](https://github.com/webpack/webpack-dev-server/issues/2453)) ([#2465](https://github.com/webpack/webpack-dev-server/issues/2465)) ([8bbef6a](https://github.com/webpack/webpack-dev-server/commit/8bbef6adf6ae5f6a3109ecd4a6246223d2f77cb2))\n* update jquery ([#2516](https://github.com/webpack/webpack-dev-server/issues/2516)) ([99ccfd8](https://github.com/webpack/webpack-dev-server/commit/99ccfd84d1db566aa4ed77c441c4674bc4e986df))\n\n### [3.10.3](https://github.com/webpack/webpack-dev-server/compare/v3.10.2...v3.10.3) (2020-02-05)\n\n\n### Bug Fixes\n\n* forward error requests to the proxy ([#2425](https://github.com/webpack/webpack-dev-server/issues/2425)) ([e291cd4](https://github.com/webpack/webpack-dev-server/commit/e291cd4922f66c5c69dfd1fd3839812cfa502de5))\n\n### [3.10.2](https://github.com/webpack/webpack-dev-server/compare/v3.10.0...v3.10.2) (2020-01-31)\n\n\n### Bug Fixes\n\n* fallthrough non `GET` and `HEAD` request to routes ([#2374](https://github.com/webpack/webpack-dev-server/issues/2374)) ([ebe8eca](https://github.com/webpack/webpack-dev-server/commit/ebe8eca37957a9009f8627e7dfb82699606846de))\n* add an optional peer dependency on webpack-cli ([#2396](https://github.com/webpack/webpack-dev-server/issues/2396)) ([aa365df](https://github.com/webpack/webpack-dev-server/commit/aa365dfd7e86c5dca31304bd5dcfe9bb9b767b40))\n* add heartbeat for the websocket server ([#2404](https://github.com/webpack/webpack-dev-server/issues/2404)) ([1a7c827](https://github.com/webpack/webpack-dev-server/commit/1a7c8273de5a5b164c63c9919950babd7ecfaadb))\n\n### [3.10.1](https://github.com/webpack/webpack-dev-server/compare/v3.10.0...v3.10.1) (2019-12-19)\n\n\n### Bug Fixes\n\n* ie11 compatibility ([1306abe](https://github.com/webpack/webpack-dev-server/commit/1306abeb8c5fd125952cdc177fdf38c2c31b3c4f))\n\n## [3.10.0](https://github.com/webpack/webpack-dev-server/compare/v3.9.0...v3.10.0) (2019-12-18)\n\n\n### Features\n\n* **client:** allow sock port to use location's port (`sockPort: 'location'`) ([#2341](https://github.com/webpack/webpack-dev-server/issues/2341)) ([dc10d06](https://github.com/webpack/webpack-dev-server/commit/dc10d0647413ad57814b684b5f6ef3659531f0f6))\n* **server:** add `contentBasePublicPath` option ([#2150](https://github.com/webpack/webpack-dev-server/issues/2150)) ([cee700d](https://github.com/webpack/webpack-dev-server/commit/cee700d59aff644a499ee310c4a32d5c5693e559))\n\n\n### Bug Fixes\n\n* **client:** don't override protocol for socket connection to 127.0.0.1 ([#2303](https://github.com/webpack/webpack-dev-server/issues/2303)) ([3a31917](https://github.com/webpack/webpack-dev-server/commit/3a31917a02818dabb3dc549e3e4994618475d131)), closes [#2302](https://github.com/webpack/webpack-dev-server/issues/2302)\n* **server:** respect sockPath on transportMode: 'ws' ([#2310](https://github.com/webpack/webpack-dev-server/issues/2310)) ([#2311](https://github.com/webpack/webpack-dev-server/issues/2311)) ([e188542](https://github.com/webpack/webpack-dev-server/commit/e188542d888dbb55be64c9da2f747343b73c319f))\n* https on chrome linux ([#2330](https://github.com/webpack/webpack-dev-server/issues/2330)) ([dc8b475](https://github.com/webpack/webpack-dev-server/commit/dc8b47510e24649edb38e5a07579be389898189e))\n* support webpack@5 ([#2359](https://github.com/webpack/webpack-dev-server/issues/2359)) ([8f89c01](https://github.com/webpack/webpack-dev-server/commit/8f89c0188579a419dc68021f8bc0fbeae70cbe5d))\n\n## [3.9.0](https://github.com/webpack/webpack-dev-server/compare/v3.8.2...v3.9.0) (2019-10-22)\n\n\n### Bug Fixes\n\n* add `hostname` and `port` to bonjour name to prevent name collisions ([#2276](https://github.com/webpack/webpack-dev-server/issues/2276)) ([d8af2d9](https://github.com/webpack/webpack-dev-server/commit/d8af2d9))\n* add `extKeyUsage` to self-signed cert ([#2274](https://github.com/webpack/webpack-dev-server/issues/2274)) ([a4dbc3b](https://github.com/webpack/webpack-dev-server/commit/a4dbc3b))\n\n\n### Features\n\n* add multiple `openPage` support ([#2266](https://github.com/webpack/webpack-dev-server/issues/2266)) ([c9e9178](https://github.com/webpack/webpack-dev-server/commit/c9e9178))\n\n### [3.8.2](https://github.com/webpack/webpack-dev-server/compare/v3.8.1...v3.8.2) (2019-10-02)\n\n### Security\n\n* update `selfsigned` package\n\n### [3.8.1](https://github.com/webpack/webpack-dev-server/compare/v3.8.0...v3.8.1) (2019-09-16)\n\n\n### Bug Fixes\n\n* add null check for connection.headers ([#2200](https://github.com/webpack/webpack-dev-server/issues/2200)) ([7964997](https://github.com/webpack/webpack-dev-server/commit/7964997))\n* false positive for an absolute path in the `ContentBase` option on windows ([#2202](https://github.com/webpack/webpack-dev-server/issues/2202)) ([68ecf78](https://github.com/webpack/webpack-dev-server/commit/68ecf78))\n* add status in quiet log level ([#2235](https://github.com/webpack/webpack-dev-server/issues/2235)) ([7e2224e](https://github.com/webpack/webpack-dev-server/commit/7e2224e))\n* scriptHost in client ([#2246](https://github.com/webpack/webpack-dev-server/issues/2246)) ([00903f6](https://github.com/webpack/webpack-dev-server/commit/00903f6))\n\n## [3.8.0](https://github.com/webpack/webpack-dev-server/compare/v3.7.2...v3.8.0) (2019-08-09)\n\n\n### Bug Fixes\n\n* **server:** fix setupExitSignals usage ([#2181](https://github.com/webpack/webpack-dev-server/issues/2181)) ([bbe410e](https://github.com/webpack/webpack-dev-server/commit/bbe410e))\n* **server:** set port before instantiating server ([#2143](https://github.com/webpack/webpack-dev-server/issues/2143)) ([cfbf229](https://github.com/webpack/webpack-dev-server/commit/cfbf229))\n* check for name of HotModuleReplacementPlugin to avoid RangeError ([#2146](https://github.com/webpack/webpack-dev-server/issues/2146)) ([4579775](https://github.com/webpack/webpack-dev-server/commit/4579775))\n* **server:** check for external urls in array ([#1980](https://github.com/webpack/webpack-dev-server/issues/1980)) ([fa78347](https://github.com/webpack/webpack-dev-server/commit/fa78347))\n* **server:** fix header check for socket server ([#2077](https://github.com/webpack/webpack-dev-server/issues/2077)) ([7f51859](https://github.com/webpack/webpack-dev-server/commit/7f51859))\n* **server:** stricter headers security check ([#2092](https://github.com/webpack/webpack-dev-server/issues/2092)) ([078ddca](https://github.com/webpack/webpack-dev-server/commit/078ddca))\n\n\n### Features\n\n* **server:** add transportMode ([#2116](https://github.com/webpack/webpack-dev-server/issues/2116)) ([b5b9cb4](https://github.com/webpack/webpack-dev-server/commit/b5b9cb4))\n* **server:** serverMode 'ws' option ([#2082](https://github.com/webpack/webpack-dev-server/issues/2082)) ([04483f4](https://github.com/webpack/webpack-dev-server/commit/04483f4))\n* **server/client:** made progress option available to API ([#1961](https://github.com/webpack/webpack-dev-server/issues/1961)) ([56274e4](https://github.com/webpack/webpack-dev-server/commit/56274e4))\n\n### Potential Breaking changes\n\nWe have migrated `serverMode` and `clientMode` to `transportMode` as an experimental option. If you want to use this feature, you have to change your settings. \n\nRelated PR: https://github.com/webpack/webpack-dev-server/pull/2116\n\n\n### [3.7.2](https://github.com/webpack/webpack-dev-server/compare/v3.7.1...v3.7.2) (2019-06-17)\n\n\n### Bug Fixes\n\n* **client:** add default fallback for client ([#2015](https://github.com/webpack/webpack-dev-server/issues/2015)) ([d26b444](https://github.com/webpack/webpack-dev-server/commit/d26b444))\n* **open:** set `wait: false` to run server.close successfully ([#2001](https://github.com/webpack/webpack-dev-server/issues/2001)) ([2b4cb52](https://github.com/webpack/webpack-dev-server/commit/2b4cb52))\n* **test:** fixed ProvidePlugin.test.js ([#2002](https://github.com/webpack/webpack-dev-server/issues/2002)) ([47453cb](https://github.com/webpack/webpack-dev-server/commit/47453cb))\n\n\n\n### [3.7.1](https://github.com/webpack/webpack-dev-server/compare/v3.7.0...v3.7.1) (2019-06-07)\n\n\n### Bug Fixes\n\n* retry finding port when port is null and get ports in sequence ([#1993](https://github.com/webpack/webpack-dev-server/issues/1993)) ([bc57514](https://github.com/webpack/webpack-dev-server/commit/bc57514))\n\n\n\n## [3.7.0](https://github.com/webpack/webpack-dev-server/compare/v3.6.0...v3.7.0) (2019-06-06)\n\n\n### Bug Fixes\n\n* change clientLogLevel order to be called first ([#1973](https://github.com/webpack/webpack-dev-server/issues/1973)) ([57c8c92](https://github.com/webpack/webpack-dev-server/commit/57c8c92))\n* es6 syntax in client ([#1982](https://github.com/webpack/webpack-dev-server/issues/1982)) ([802aa30](https://github.com/webpack/webpack-dev-server/commit/802aa30))\n\n\n\n## [3.6.0](https://github.com/webpack/webpack-dev-server/compare/v3.5.1...v3.6.0) (2019-06-05)\n\n\n### Bug Fixes\n\n* **config:** enable `--overlay` ([#1968](https://github.com/webpack/webpack-dev-server/issues/1968)) ([dc81e23](https://github.com/webpack/webpack-dev-server/commit/dc81e23))\n* **server:** don't ignore node_modules by default ([#1970](https://github.com/webpack/webpack-dev-server/issues/1970)) ([699f8b4](https://github.com/webpack/webpack-dev-server/commit/699f8b4)), closes [#1794](https://github.com/webpack/webpack-dev-server/issues/1794)\n\n\n### Features\n\n* **server:** add serverMode option ([#1937](https://github.com/webpack/webpack-dev-server/issues/1937)) ([44a8cde](https://github.com/webpack/webpack-dev-server/commit/44a8cde))\n\n\n\n### [3.5.1](https://github.com/webpack/webpack-dev-server/compare/v3.5.0...v3.5.1) (2019-06-01)\n\n\n### Bug Fixes\n\n* allow passing promise function of webpack.config.js ([#1947](https://github.com/webpack/webpack-dev-server/issues/1947)) ([8cf1053](https://github.com/webpack/webpack-dev-server/commit/8cf1053))\n\n\n\n## [3.5.0](https://github.com/webpack/webpack-dev-server/compare/v3.4.1...v3.5.0) (2019-05-31)\n\n\n### Bug Fixes\n\n* add client code for `electron-renderer` target ([#1935](https://github.com/webpack/webpack-dev-server/issues/1935)) ([9297988](https://github.com/webpack/webpack-dev-server/commit/9297988))\n* add client code for `node-webkit` target ([#1942](https://github.com/webpack/webpack-dev-server/issues/1942)) ([c6b2b1f](https://github.com/webpack/webpack-dev-server/commit/c6b2b1f))\n\n\n### Features\n\n* **server:** `onListening` option ([#1930](https://github.com/webpack/webpack-dev-server/issues/1930)) ([61d0cdf](https://github.com/webpack/webpack-dev-server/commit/61d0cdf))\n* **server:** add callback support for invalidate ([#1900](https://github.com/webpack/webpack-dev-server/issues/1900)) ([cd218ef](https://github.com/webpack/webpack-dev-server/commit/cd218ef))\n* **server:** add `WEBPACK_DEV_SERVER` env variable ([#1929](https://github.com/webpack/webpack-dev-server/issues/1929)) ([856169e](https://github.com/webpack/webpack-dev-server/commit/856169e))\n\n\n\n### [3.4.1](https://github.com/webpack/webpack-dev-server/compare/v3.4.0...v3.4.1) (2019-05-17)\n\n\n### Bug Fixes\n\n* add none and warning to clientLogLevel ([#1901](https://github.com/webpack/webpack-dev-server/issues/1901)) ([0ae9be8](https://github.com/webpack/webpack-dev-server/commit/0ae9be8))\n* broken hot reload ([#1903](https://github.com/webpack/webpack-dev-server/issues/1903)) ([6a444cd](https://github.com/webpack/webpack-dev-server/commit/6a444cd))\n\n\n\n## [3.4.0](https://github.com/webpack/webpack-dev-server/compare/v3.3.1...v3.4.0) (2019-05-17)\n\n\n### Bug Fixes\n\n* don't use self.location.port ([#1838](https://github.com/webpack/webpack-dev-server/issues/1838)) ([6d31984](https://github.com/webpack/webpack-dev-server/commit/6d31984))\n* do not include config files in dist ([#1883](https://github.com/webpack/webpack-dev-server/issues/1883)) ([c535bb2](https://github.com/webpack/webpack-dev-server/commit/c535bb2))\n* only add client entry to web targets ([#1775](https://github.com/webpack/webpack-dev-server/issues/1775)) ([cf4d0d0](https://github.com/webpack/webpack-dev-server/commit/cf4d0d0))\n* update clientLogLevel to match docs and error ([#1825](https://github.com/webpack/webpack-dev-server/issues/1825)) ([7f52bbf](https://github.com/webpack/webpack-dev-server/commit/7f52bbf))\n* add errors-warnings preset ([#1895](https://github.com/webpack/webpack-dev-server/issues/1895)) ([2a81ad2](https://github.com/webpack/webpack-dev-server/commit/2a81ad2))\n\n\n### Features\n\n* added injectClient option ([#1775](https://github.com/webpack/webpack-dev-server/issues/1775)) ([cf4d0d0](https://github.com/webpack/webpack-dev-server/commit/cf4d0d0))\n* added injectHot option ([#1775](https://github.com/webpack/webpack-dev-server/issues/1775)) ([cf4d0d0](https://github.com/webpack/webpack-dev-server/commit/cf4d0d0))\n* added sockPort option ([#1792](https://github.com/webpack/webpack-dev-server/issues/1792)) ([58d1682](https://github.com/webpack/webpack-dev-server/commit/58d1682))\n* added sockHost option ([#1858](https://github.com/webpack/webpack-dev-server/issues/1858)) ([f47dff2](https://github.com/webpack/webpack-dev-server/commit/f47dff2))\n* support HEAD method ([#1875](https://github.com/webpack/webpack-dev-server/issues/1875)) ([c2360e4](https://github.com/webpack/webpack-dev-server/commit/c2360e4))\n* added liveReload option ([#1889](https://github.com/webpack/webpack-dev-server/issues/1889)) ([fc4fe32](https://github.com/webpack/webpack-dev-server/commit/fc4fe32))\n* update express to 4.17 version\n\n\n## [3.3.1](https://github.com/webpack/webpack-dev-server/compare/v3.3.0...v3.3.1) (2019-04-09)\n\n\n### Bug Fixes\n\n* **regression:** always get necessary stats for hmr ([#1780](https://github.com/webpack/webpack-dev-server/issues/1780)) ([66b04a9](https://github.com/webpack/webpack-dev-server/commit/66b04a9))\n* **regression:** host and port can be undefined or null ([#1779](https://github.com/webpack/webpack-dev-server/issues/1779)) ([028ceee](https://github.com/webpack/webpack-dev-server/commit/028ceee))\n* only add entries after compilers have been created ([#1774](https://github.com/webpack/webpack-dev-server/issues/1774)) ([b31cbaa](https://github.com/webpack/webpack-dev-server/commit/b31cbaa))\n\n\n\n# [3.3.0](https://github.com/webpack/webpack-dev-server/compare/v3.2.1...v3.3.0) (2019-04-08)\n\n\n### Bug Fixes\n\n* compatibility with webpack-cli@3.3 ([#1754](https://github.com/webpack/webpack-dev-server/issues/1754)) ([fd7cb0d](https://github.com/webpack/webpack-dev-server/commit/fd7cb0d))\n* ignore proxy when bypass return false ([#1696](https://github.com/webpack/webpack-dev-server/issues/1696)) ([aa7de77](https://github.com/webpack/webpack-dev-server/commit/aa7de77))\n* respect stats option from webpack config ([#1665](https://github.com/webpack/webpack-dev-server/issues/1665)) ([efaa740](https://github.com/webpack/webpack-dev-server/commit/efaa740))\n* use location.port when location.hostname is used to infer HMR socket URL ([#1664](https://github.com/webpack/webpack-dev-server/issues/1664)) ([2f7f052](https://github.com/webpack/webpack-dev-server/commit/2f7f052))\n* don't crash with express.static.mime.types ([#1765](https://github.com/webpack/webpack-dev-server/issues/1765)) ([919ff77](https://github.com/webpack/webpack-dev-server/commit/919ff77))\n\n\n### Features\n\n* add option \"serveIndex\" to enable/disable serveIndex middleware ([#1752](https://github.com/webpack/webpack-dev-server/issues/1752)) ([d5d60cb](https://github.com/webpack/webpack-dev-server/commit/d5d60cb))\n* add webpack as argument to before and after options ([#1760](https://github.com/webpack/webpack-dev-server/issues/1760)) ([0984d4b](https://github.com/webpack/webpack-dev-server/commit/0984d4b))\n* http2 option to enable/disable HTTP/2 with HTTPS ([#1721](https://github.com/webpack/webpack-dev-server/issues/1721)) ([dcd2434](https://github.com/webpack/webpack-dev-server/commit/dcd2434))\n* random port retry logic ([#1692](https://github.com/webpack/webpack-dev-server/issues/1692)) ([419f02e](https://github.com/webpack/webpack-dev-server/commit/419f02e))\n* relax depth limit from chokidar for content base ([#1697](https://github.com/webpack/webpack-dev-server/issues/1697)) ([7ea9ab9](https://github.com/webpack/webpack-dev-server/commit/7ea9ab9))\n\n\n\n## [3.2.1](https://github.com/webpack/webpack-dev-server/compare/v3.2.0...v3.2.1) (2019-02-25)\n\n\n### Bug Fixes\n\n* deprecation message about `setup` now warning about `v4` ([#1684](https://github.com/webpack/webpack-dev-server/issues/1684)) ([523a6ec](https://github.com/webpack/webpack-dev-server/commit/523a6ec))\n* **regression:** allow `ca`, `key` and `cert` will be string ([#1676](https://github.com/webpack/webpack-dev-server/issues/1676)) ([b8d5c1e](https://github.com/webpack/webpack-dev-server/commit/b8d5c1e))\n* **regression:** handle `key`, `cert`, `cacert` and `pfx` in CLI ([#1688](https://github.com/webpack/webpack-dev-server/issues/1688)) ([4b2076c](https://github.com/webpack/webpack-dev-server/commit/4b2076c))\n* **regression:** problem with `idb-connector` after update `internal-ip` ([#1691](https://github.com/webpack/webpack-dev-server/issues/1691)) ([eb48691](https://github.com/webpack/webpack-dev-server/commit/eb48691))\n\n\n\n<a name=\"3.1.14\"></a>\n## [3.1.14](https://github.com/webpack/webpack-dev-server/compare/v3.1.13...v3.1.14) (2018-12-24)\n\n\n### Bug Fixes\n\n* add workaround for Origin header in sockjs ([#1608](https://github.com/webpack/webpack-dev-server/issues/1608)) ([1dfd4fb](https://github.com/webpack/webpack-dev-server/commit/1dfd4fb))\n\n\n\n<a name=\"3.1.13\"></a>\n## [3.1.13](https://github.com/webpack/webpack-dev-server/compare/v3.1.12...v3.1.13) (2018-12-22)\n\n\n### Bug Fixes\n\n* delete a comma for Node.js <= v7.x ([#1609](https://github.com/webpack/webpack-dev-server/issues/1609)) ([0bab1c0](https://github.com/webpack/webpack-dev-server/commit/0bab1c0))\n\n\n\n<a name=\"3.1.12\"></a>\n## [3.1.12](https://github.com/webpack/webpack-dev-server/compare/v3.1.11...v3.1.12) (2018-12-22)\n\n\n### Bug Fixes\n\n* regression in `checkHost` for checking Origin header ([#1606](https://github.com/webpack/webpack-dev-server/issues/1606)) ([8bb3ca8](https://github.com/webpack/webpack-dev-server/commit/8bb3ca8))\n\n\n\n<a name=\"3.1.11\"></a>\n## [3.1.11](https://github.com/webpack/webpack-dev-server/compare/v3.1.10...v3.1.11) (2018-12-21)\n\n\n### Bug Fixes\n\n* **bin/options:** correct check for color support (`options.color`) ([#1555](https://github.com/webpack/webpack-dev-server/issues/1555)) ([55398b5](https://github.com/webpack/webpack-dev-server/commit/55398b5))\n* **package:** update `spdy` v3.4.1...4.0.0 (assertion error) ([#1491](https://github.com/webpack/webpack-dev-server/issues/1491)) ([#1563](https://github.com/webpack/webpack-dev-server/issues/1563)) ([7a3a257](https://github.com/webpack/webpack-dev-server/commit/7a3a257))\n* **Server:** correct `node` version checks ([#1543](https://github.com/webpack/webpack-dev-server/issues/1543)) ([927a2b3](https://github.com/webpack/webpack-dev-server/commit/927a2b3))\n* **Server:** mime type for wasm in contentBase directory ([#1575](https://github.com/webpack/webpack-dev-server/issues/1575)) ([#1580](https://github.com/webpack/webpack-dev-server/issues/1580)) ([fadae5d](https://github.com/webpack/webpack-dev-server/commit/fadae5d))\n* add url for compatibility with webpack@5 ([#1598](https://github.com/webpack/webpack-dev-server/issues/1598)) ([#1599](https://github.com/webpack/webpack-dev-server/issues/1599)) ([68dd49a](https://github.com/webpack/webpack-dev-server/commit/68dd49a))\n* check origin header for websocket connection ([#1603](https://github.com/webpack/webpack-dev-server/issues/1603)) ([b3217ca](https://github.com/webpack/webpack-dev-server/commit/b3217ca))\n\n\n\n<a name=\"3.1.10\"></a>\n## [3.1.10](https://github.com/webpack/webpack-dev-server/compare/v3.1.9...v3.1.10) (2018-10-23)\n\n\n### Bug Fixes\n\n* **options:** add `writeToDisk` option to schema ([#1520](https://github.com/webpack/webpack-dev-server/issues/1520)) ([d2f4902](https://github.com/webpack/webpack-dev-server/commit/d2f4902))\n* **package:** update `sockjs-client` v1.1.5...1.3.0 (`url-parse` vulnerability) ([#1537](https://github.com/webpack/webpack-dev-server/issues/1537)) ([e719959](https://github.com/webpack/webpack-dev-server/commit/e719959))\n* **Server:** set `tls.DEFAULT_ECDH_CURVE` to `'auto'` ([#1531](https://github.com/webpack/webpack-dev-server/issues/1531)) ([c12def3](https://github.com/webpack/webpack-dev-server/commit/c12def3))\n\n\n\n<a name=\"3.1.9\"></a>\n## [3.1.9](https://github.com/webpack/webpack-dev-server/compare/v3.1.8...v3.1.9) (2018-09-24)\n\n\n\n<a name=\"3.1.8\"></a>\n## [3.1.8](https://github.com/webpack/webpack-dev-server/compare/v3.1.7...v3.1.8) (2018-09-06)\n\n\n### Bug Fixes\n\n* **package:** `yargs` security vulnerability (`dependencies`) ([#1492](https://github.com/webpack/webpack-dev-server/issues/1492)) ([8fb67c9](https://github.com/webpack/webpack-dev-server/commit/8fb67c9))\n* **utils/createLogger:** ensure `quiet` always takes precedence (`options.quiet`) ([#1486](https://github.com/webpack/webpack-dev-server/issues/1486)) ([7a6ca47](https://github.com/webpack/webpack-dev-server/commit/7a6ca47))\n\n\n\n<a name=\"3.1.7\"></a>\n## [3.1.7](https://github.com/webpack/webpack-dev-server/compare/v3.1.6...v3.1.7) (2018-08-29)\n\n\n### Bug Fixes\n\n* **Server:** don't use `spdy` on `node >= v10.0.0` ([#1451](https://github.com/webpack/webpack-dev-server/issues/1451)) ([8ab9eb6](https://github.com/webpack/webpack-dev-server/commit/8ab9eb6))\n\n\n\n<a name=\"3.1.6\"></a>\n## [3.1.6](https://github.com/webpack/webpack-dev-server/compare/v3.1.5...v3.1.6) (2018-08-26)\n\n\n### Bug Fixes\n\n* **bin:** handle `process` signals correctly when the server isn't ready yet ([#1432](https://github.com/webpack/webpack-dev-server/issues/1432)) ([334c3a5](https://github.com/webpack/webpack-dev-server/commit/334c3a5))\n* **examples/cli:** correct template path in `open-page` example ([#1401](https://github.com/webpack/webpack-dev-server/issues/1401)) ([df30727](https://github.com/webpack/webpack-dev-server/commit/df30727))\n* **schema:** allow the `output` filename to be a `{Function}` ([#1409](https://github.com/webpack/webpack-dev-server/issues/1409)) ([e2220c4](https://github.com/webpack/webpack-dev-server/commit/e2220c4))\n"
  },
  {
    "path": "CODE_OF_CONDUCT.md",
    "content": "## Code of Conduct\n\nAt webpack and webpack/webpack-dev-server repository we follow the [JSFoundation Code of Conduct][1].\nPlease adhere to the guidelines there and feel free to report any violation of them to the **@webpack/core-team**,\n**@webpack/dev-server-team**, or <conduct@js.foundation>.\n\n[1]: https://github.com/openjs-foundation/code-and-learn/blob/main/CODE_OF_CONDUCT.md\n"
  },
  {
    "path": "CONTRIBUTING.md",
    "content": "# Contributing to webpack-dev-server\n\nDo you use webpack-dev-server and want to help us out? Thanks!\n\nPlease review this document before contributing.\n\nFollowing these guidelines helps to communicate that you respect the time of the developers managing and developing this open source project. In return, they should show respect in addressing your issue or assessing patches and features.\n\n## Core Ideas\n\n- There are hooks to add your own features, so we should not add less-common features.\n- The workflow should be to start webpack-dev-server as a separate process, next to the \"normal\" server and to request the script from this server or to proxy from dev-server to \"normal\" server (because webpack blocks the event queue too much while compiling which can affect \"normal\" server).\n- A user should not try to implement stuff that accesses the webpack filesystem. This leads to bugs (the middleware does it while blocking requests until the compilation has finished, the blocking is important).\n- It should be a development only tool. Compiling in production is bad, one should precompile and deliver the compiled assets.\n- Processing options and stats display is delegated to webpack, so webpack-dev-server/middleware should not do much with it. This also helps us to keep up-to-date with webpack updates.\n- The communication library (`SockJS`) should not be exposed to the user.\n\n## Submitting a Pull Request\n\n- Good pull requests, such as patches, improvements, and new features, are a fantastic help. They should remain focused in scope and not contain unrelated commits.\n\n- It is advised to first create an issue (if there is not one already) before making a pull request. This way the maintainers can first discuss with you if they agree and it also helps with providing some context.\n\n- Run the relevant [examples](https://github.com/webpack/webpack-dev-server/tree/main/examples) to see if all functionality still works. When introducing new functionality, also add an example. This helps the maintainers to understand it and check if it still works.\n\n- Write tests.\n\n- Follow the existing coding style.\n\n- Make sure your PR's description contains GitHub's special keyword references that automatically close the related issue when the PR is merged. ([More info](https://github.com/blog/1506-closing-issues-via-pull-requests))\n\n## Setting Up a Local Copy\n\n1. Clone the repo with `git clone https://github.com/webpack/webpack-dev-server`.\n\n2. Run `npm install` in the root `webpack-dev-server` folder.\n\n3. Run `npm link && npm link webpack-dev-server` to link the current project to `node_modules`.\n\nOnce it is done, you can modify any file locally. In the `examples/` directory you'll find a lot of examples with instructions on how to run them. This can be very handy when testing if your code works.\n\nIf you are modifying a file in the `client/` directory, be sure to run `npm run build:client` after it. This will recompile the files.\n\n## Commit message\n\nOur commit messages format follows the [angular.js commits format](https://github.com/angular/angular.js/blob/master/DEVELOPERS.md#commits).\n\nWe don't use the scope. The template of a commit would look like this:\n\n### Commit Message Format\n\nEach commit message consists of a **header**, a **body** and a **footer**. The header has a special\nformat that includes a **type** and a **subject**:\n\n```\n<type>: <subject>\n<BLANK LINE>\n<body>\n<BLANK LINE>\n<footer>\n```\n\nThis is the list of _type_ of commits that we accept:\n\n- **build** : Changes that affect the build system or external dependencies (example scopes: typescript, webpack, npm).\n- **chore** : Updating deps, docs, linting, etc.\n- **ci** : Changes to our CI configuration files and scripts (example scopes: Travis, Circle, BrowserStack, SauceLabs)\n- **docs** : Documentation only changes.\n- **feat** : A new feature.\n- **fix** : A bug fix.\n- **perf** : A code change that improves performance.\n- **refactor** : A code change that neither fixes a bug nor adds a feature.\n- **revert** : Reverts the previous commit.\n- **style** : Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc).\n- **test** : Adding missing tests or correcting existing tests.\n\nThe **header** is mandatory.\n\nAny line of the commit message cannot be longer 100 characters. This allows the message to be easier\nto read on GitHub as well as in several git tools.\n\nFor more information about what each part of the template means, head up to the documentation in the\n[angular repo](https://github.com/angular/angular.js/blob/master/DEVELOPERS.md#commits).\n\n### Example commit message\n\n```\nfeat: improve output for IPv4 and IPv6\n```\n\nMention breaking changes explicitly:\n\n```\nrefactor: remove stdin option\n\nBREAKING CHANGE: stdin option was removed\n```\n\n## Testing a Pull Request\n\nPull requests often need some real-world testing.\n\n1. In your `package.json`, change the line with `webpack-dev-server` to:\n\n```json\n\"webpack-dev-server\": \"<PATH>\"\n```\n\n`<PATH>`:\n\n- `github:webpack/webpack-dev-server#pull/<ID>/head`\n  where `<ID>` is the ID of the pull request.\n\n- `file:../path/to/local/webpack-dev-server/fork` is the path to your local repo, just make sure you hit the correct path\n\n2. Run `npm install`.\n\n3. Go to the `webpack-dev-server` module (`cd node_modules/webpack-dev-server`), and run `npm run build`.\n\nThe pull request is now ready to be tested.\n\n## [Contributor License Agreement](https://openjsf.org/about/the-openjs-foundation-cla/)\n\nWhen submitting your contribution, a CLA (Contributor License Agreement) bot will come by to verify that you signed the [CLA](https://cla.openjsf.org/). If it is your first time, it will link you to the right place to sign it. However, if you have committed your contributions using an email that is not the same as your email used on GitHub, the CLA bot can't accept your contribution.\n\nRun `git config user.email` to see your Git email, and verify it with [your GitHub email](https://github.com/settings/emails).\n\n---\n\n_Many thanks to [create-react-app](https://github.com/facebook/create-react-app/blob/master/CONTRIBUTING.md) for the inspiration with this contributing guide_\n"
  },
  {
    "path": "DOCUMENTATION-v4.md",
    "content": "[webpack-dev-server](https://github.com/webpack/webpack-dev-server) can be used to quickly develop an application. See the [development guide](/guides/development/) to get started.\n\nThis page describes the options that affect the behavior of webpack-dev-server (short: dev-server) `v4.0.0+`. Migration guide from `v3` to `v4` can be found [here](https://github.com/webpack/webpack-dev-server/blob/main/migration-v4.md).\n\n> **Warning**\n>\n> `webpack-dev-server v4.0.0+` requires `node >= v12.13.0`, `webpack >= v4.37.0` (but we recommend using `webpack >= v5.0.0`), and `webpack-cli >= v4.7.0`.\n\n## devServer\n\n`object`\n\nThis set of options is picked up by [webpack-dev-server](https://github.com/webpack/webpack-dev-server) and can be used to change its behavior in various ways. Here's a rudimentary example that gzips and serves everything from our `public/` directory in the project root:\n\n**webpack.config.js**\n\n```javascript\nconst path = require(\"node:path\");\n\nmodule.exports = {\n  // ...\n  devServer: {\n    static: {\n      directory: path.join(__dirname, \"public\"),\n    },\n    compress: true,\n    port: 9000,\n  },\n};\n```\n\nWhen the server is started, there will be a message prior to the list of resolved modules:\n\n```bash\n<i> [webpack-dev-server] Project is running at:\n<i> [webpack-dev-server] Loopback: http://localhost:9000/\n<i> [webpack-dev-server] On Your Network (IPv4): http://197.158.164.104:9000/\n<i> [webpack-dev-server] On Your Network (IPv6): http://[fe80::1]:9000/\n<i> [webpack-dev-server] Content not from webpack is served from '/path/to/public' directory\n```\n\nthat will give some background on where the server is located and what it's serving.\n\nIf you're using dev-server through the Node.js API, the options in `devServer` will be ignored. Pass the options as the first parameter instead: `new WebpackDevServer({...}, compiler)`. [See here](https://github.com/webpack/webpack-dev-server/tree/main/examples/api/simple) for an example of how to use webpack-dev-server through the Node.js API.\n\n> **Warning**\n>\n> You cannot use the second `compiler` argument (a callback) when using `WebpackDevServer`.\n\n> **Warning**\n>\n> Be aware that when [exporting multiple configurations](/configuration/configuration-types/#exporting-multiple-configurations) only the `devServer` options for the first configuration will be taken into account and used for all the configurations in the array.\n\n> **Note**\n>\n> If you're having trouble, navigating to the `/webpack-dev-server` route will show where files are served. For example, `http://localhost:9000/webpack-dev-server`.\n\n> **Note**\n>\n> If you want to manually recompile the bundle, navigating to the `/webpack-dev-server/invalidate` route will [invalidate](/api/node/#invalidate-watching) the current compilation of the bundle and recompile it for you via [webpack-dev-middleware](https://github.com/webpack/webpack-dev-middleware#invalidate). Depending on your configuration, the URL may look like `http://localhost:9000/webpack-dev-server/invalidate`.\n\n> **Note**\n>\n> HTML template is required to serve the bundle, usually, it is an `index.html` file. Make sure that script references are added into HTML, webpack-dev-server doesn't inject them automatically.\n\n### Usage via CLI\n\nYou can invoke webpack-dev-server via CLI by:\n\n```bash\nnpx webpack serve\n```\n\nA list of CLI options for `serve` is available [here](https://github.com/webpack/webpack-cli/blob/main/SERVE-OPTIONS-v4.md)\n\n### Usage via API\n\nWhile it's recommended to run `webpack-dev-server` via the CLI, you may also choose to start a server via the API.\n\nSee the related [API documentation for `webpack-dev-server`](/api/webpack-dev-server/).\n\n## devServer.allowedHosts\n\n`'auto' | 'all'` `[string]`\n\nThis option allows you to allowlist services that are allowed to access the dev server.\n\n**webpack.config.js**\n\n```javascript\nmodule.exports = {\n  // ...\n  devServer: {\n    allowedHosts: [\n      \"host.com\",\n      \"subdomain.host.com\",\n      \"subdomain2.host.com\",\n      \"host2.com\",\n    ],\n  },\n};\n```\n\nMimicking Django's `ALLOWED_HOSTS`, a value beginning with `.` can be used as a subdomain wildcard. `.host.com` will match `host.com`, `www.host.com`, and any other subdomain of `host.com`.\n\n**webpack.config.js**\n\n```javascript\nmodule.exports = {\n  // ...\n  devServer: {\n    // this achieves the same effect as the first example\n    // with the bonus of not having to update your config\n    // if new subdomains need to access the dev server\n    allowedHosts: [\".host.com\", \"host2.com\"],\n  },\n};\n```\n\nUsage via the CLI:\n\n```bash\nnpx webpack serve --allowed-hosts .host.com --allowed-hosts host2.com\n```\n\nWhen set to `'all'` this option bypasses host checking. **THIS IS NOT RECOMMENDED** as apps that do not check the host are vulnerable to DNS rebinding attacks.\n\n**webpack.config.js**\n\n```javascript\nmodule.exports = {\n  // ...\n  devServer: {\n    allowedHosts: \"all\",\n  },\n};\n```\n\nUsage via the CLI:\n\n```bash\nnpx webpack serve --allowed-hosts all\n```\n\nWhen set to `'auto'` this option always allows `localhost`, [`host`](#devserverhost), and [`client.webSocketURL.hostname`](#websocketurl):\n\n**webpack.config.js**\n\n```javascript\nmodule.exports = {\n  // ...\n  devServer: {\n    allowedHosts: \"auto\",\n  },\n};\n```\n\nUsage via the CLI:\n\n```bash\nnpx webpack serve --allowed-hosts auto\n```\n\n## devServer.bonjour\n\n`boolean = false` `object`\n\nThis option broadcasts the server via [ZeroConf](http://www.zeroconf.org/) networking on start.\n\n**webpack.config.js**\n\n```javascript\nmodule.exports = {\n  // ...\n  devServer: {\n    bonjour: true,\n  },\n};\n```\n\nUsage via the CLI:\n\n```bash\nnpx webpack serve --bonjour\n```\n\nTo disable:\n\n```bash\nnpx webpack serve --no-bonjour\n```\n\nYou can also pass [custom options](https://github.com/watson/bonjour#initializing) to bonjour, for example:\n\n**webpack.config.js**\n\n```javascript\nmodule.exports = {\n  // ...\n  devServer: {\n    bonjour: {\n      type: \"http\",\n      protocol: \"udp\",\n    },\n  },\n};\n```\n\n## devServer.client\n\n### logging\n\n`'log' | 'info' | 'warn' | 'error' | 'none' | 'verbose'`\n\nAllows to set log level in the browser, e.g. before reloading, before an error or when [Hot Module Replacement](/concepts/hot-module-replacement/) is enabled.\n\n**webpack.config.js**\n\n```javascript\nmodule.exports = {\n  // ...\n  devServer: {\n    client: {\n      logging: \"info\",\n    },\n  },\n};\n```\n\nUsage via the CLI:\n\n```bash\nnpx webpack serve --client-logging info\n```\n\n### overlay\n\n`boolean = true` `object`\n\nShows a full-screen overlay in the browser when there are compiler errors or warnings.\n\n**webpack.config.js**\n\n```javascript\nmodule.exports = {\n  // ...\n  devServer: {\n    client: {\n      overlay: true,\n    },\n  },\n};\n```\n\nUsage via the CLI:\n\n```bash\nnpx webpack serve --client-overlay\n```\n\nTo disable:\n\n```bash\nnpx webpack serve --no-client-overlay\n```\n\nYou can provide an object with the following properties for more granular control:\n\n| Property        | Explanation              |\n| --------------- | ------------------------ |\n| `errors`        | compilation errors       |\n| `runtimeErrors` | unhandled runtime errors |\n| `warnings`      | compilation warnings     |\n\nAll properties are optional and default to `true` when not provided.\n\nFor example, to disable compilation warnings, you can provide the following configuration:\n\n**webpack.config.js**\n\n```javascript\nmodule.exports = {\n  // ...\n  devServer: {\n    client: {\n      overlay: {\n        errors: true,\n        warnings: false,\n        runtimeErrors: true,\n      },\n    },\n  },\n};\n```\n\nUsage via the CLI:\n\n```bash\nnpx webpack serve --client-overlay-errors --no-client-overlay-warnings --client-overlay-runtime-errors\n```\n\nTo filter based on the thrown error, you can pass a function that accepts an `error` parameter and returns a boolean.\n\nFor example, to ignore errors thrown by [`AbortController.abort()`](https://developer.mozilla.org/en-US/docs/Web/API/AbortController/abort):\n\n**webpack.config.js**\n\n```javascript\nmodule.exports = {\n  // ...\n  devServer: {\n    client: {\n      overlay: {\n        runtimeErrors: (error) => {\n          if (error instanceof DOMException && error.name === \"AbortError\") {\n            return false;\n          }\n          return true;\n        },\n      },\n    },\n  },\n};\n```\n\n> **Warning**\n>\n> The function will not have access to the variables declared in the outer scope within the configuration file.\n\n### progress\n\n`boolean`\n\nPrints compilation progress in percentage in the browser.\n\n**webpack.config.js**\n\n```javascript\nmodule.exports = {\n  // ...\n  devServer: {\n    client: {\n      progress: true,\n    },\n  },\n};\n```\n\nUsage via the CLI:\n\n```bash\nnpx webpack serve --client-progress\n```\n\nTo disable:\n\n```bash\nnpx webpack serve --no-client-progress\n```\n\n### reconnect\n\n`boolean = true` `number`\n\n<Badge text=\"v4.4.0+\" />\n\nTells dev-server the number of times it should try to reconnect the client. When `true` it will try to reconnect unlimited times.\n\n**webpack.config.js**\n\n```javascript\nmodule.exports = {\n  // ...\n  devServer: {\n    client: {\n      reconnect: true,\n    },\n  },\n};\n```\n\nUsage via the CLI:\n\n```bash\nnpx webpack serve --client-reconnect\n```\n\nWhen set to `false` it will not try to reconnect.\n\n```javascript\nmodule.exports = {\n  // ...\n  devServer: {\n    client: {\n      reconnect: false,\n    },\n  },\n};\n```\n\nUsage via the CLI:\n\n```bash\nnpx webpack serve --no-client-reconnect\n```\n\nYou can also specify the exact number of times the client should try to reconnect.\n\n```javascript\nmodule.exports = {\n  // ...\n  devServer: {\n    client: {\n      reconnect: 5,\n    },\n  },\n};\n```\n\nUsage via the CLI:\n\n```bash\nnpx webpack serve --client-reconnect 5\n```\n\n### webSocketTransport\n\n`'ws' | 'sockjs'` `string`\n\nThis option allows us either to choose the current `devServer` transport mode for clients individually or to provide custom client implementation. This allows specifying how the browser or other client communicates with the `devServer`.\n\n> **Note**\n>\n> Providing `'ws'` or `'sockjs'` to [`webSocketServer`](#devserverwebsocketserver) is a shortcut to setting both `devServer.client.webSocketTransport` and `devServer.webSocketServer` to the given value.\n\n**webpack.config.js**\n\n```javascript\nmodule.exports = {\n  // ...\n  devServer: {\n    client: {\n      webSocketTransport: \"ws\",\n    },\n    webSocketServer: \"ws\",\n  },\n};\n```\n\nUsage via the CLI:\n\n```bash\nnpx webpack serve --client-web-socket-transport ws --web-socket-server ws\n```\n\n> **Note**\n>\n> When providing a custom client and server implementation make sure that they are compatible with one another to communicate successfully.\n\nTo create a custom client implementation, create a class that extends [`BaseClient`](https://github.com/webpack/webpack-dev-server/blob/main/client-src/clients/BaseClient.js).\n\nUsing path to `CustomClient.js`, a custom WebSocket client implementation, along with the compatible `'ws'` server:\n\n**webpack.config.js**\n\n```javascript\nmodule.exports = {\n  // ...\n  devServer: {\n    client: {\n      webSocketTransport: require.resolve(\"./CustomClient\"),\n    },\n    webSocketServer: \"ws\",\n  },\n};\n```\n\nUsing custom, compatible WebSocket client and server implementations:\n\n**webpack.config.js**\n\n```javascript\nmodule.exports = {\n  // ...\n  devServer: {\n    client: {\n      webSocketTransport: require.resolve(\"./CustomClient\"),\n    },\n    webSocketServer: require.resolve(\"./CustomServer\"),\n  },\n};\n```\n\n### webSocketURL\n\n`string` `object`\n\nThis option allows specifying URL to web socket server (useful when you're proxying dev server and client script does not always know where to connect to).\n\n**webpack.config.js**\n\n```javascript\nmodule.exports = {\n  // ...\n  devServer: {\n    client: {\n      webSocketURL: \"ws://0.0.0.0:8080/ws\",\n    },\n  },\n};\n```\n\nUsage via the CLI:\n\n```bash\nnpx webpack serve --client-web-socket-url ws://0.0.0.0:8080/ws\n```\n\nYou can also specify an object with the following properties:\n\n- `hostname`: Tells clients connected to devServer to use the provided hostname.\n- `pathname`: Tells clients connected to devServer to use the provided path to connect.\n- `password`: Tells clients connected to devServer to use the provided password to authenticate.\n- `port`: Tells clients connected to devServer to use the provided port.\n- `protocol`: Tells clients connected to devServer to use the provided protocol.\n- `username`: Tells clients connected to devServer to use the provided username to authenticate.\n\n**webpack.config.js**\n\n```javascript\nmodule.exports = {\n  // ...\n  devServer: {\n    client: {\n      webSocketURL: {\n        hostname: \"0.0.0.0\",\n        pathname: \"/ws\",\n        password: \"dev-server\",\n        port: 8080,\n        protocol: \"ws\",\n        username: \"webpack\",\n      },\n    },\n  },\n};\n```\n\n> **Note**\n>\n> To get `protocol`/`hostname`/`port` from browser use `webSocketURL: 'auto://0.0.0.0:0/ws'`.\n\n## devServer.compress\n\n`boolean = true`\n\nEnable [gzip compression](https://betterexplained.com/articles/how-to-optimize-your-site-with-gzip-compression/) for everything served:\n\n**webpack.config.js**\n\n```javascript\nmodule.exports = {\n  // ...\n  devServer: {\n    compress: true,\n  },\n};\n```\n\nUsage via the CLI:\n\n```bash\nnpx webpack serve --compress\n```\n\nTo disable:\n\n```bash\nnpx webpack serve --no-compress\n```\n\n## devServer.devMiddleware\n\n`object`\n\nProvide options to [webpack-dev-middleware](https://github.com/webpack/webpack-dev-middleware) which handles webpack assets.\n\n**webpack.config.js**\n\n```javascript\nmodule.exports = {\n  devServer: {\n    devMiddleware: {\n      index: true,\n      mimeTypes: { phtml: \"text/html\" },\n      publicPath: \"/publicPathForDevServe\",\n      serverSideRender: true,\n      writeToDisk: true,\n    },\n  },\n};\n```\n\n## devServer.http2\n\n`boolean`\n\nServe over HTTP/2 using [spdy](https://www.npmjs.com/package/spdy). This option is ignored for Node 15.0.0 and above, as spdy is broken for those versions. The dev server will migrate over to Node's built-in HTTP/2 once [Express](https://expressjs.com/) supports it.\n\nHTTP/2 with a self-signed certificate:\n\n**webpack.config.js**\n\n```javascript\nmodule.exports = {\n  // ...\n  devServer: {\n    http2: true,\n  },\n};\n```\n\nUsage via CLI\n\n```bash\nnpx webpack serve --http2\n```\n\nTo disable:\n\n```bash\nnpx webpack serve --no-http2\n```\n\nProvide your own certificate using the [https](#devserverhttps) option:\n\n**webpack.config.js**\n\n```javascript\nconst fs = require(\"node:fs\");\n\nmodule.exports = {\n  // ...\n  devServer: {\n    http2: true,\n    https: {\n      key: fs.readFileSync(\"/path/to/server.key\"),\n      cert: fs.readFileSync(\"/path/to/server.crt\"),\n      ca: fs.readFileSync(\"/path/to/ca.pem\"),\n    },\n  },\n};\n```\n\nTo pass your certificate via CLI, use the following options:\n\n```bash\nnpx webpack serve --http2 --https-key ./path/to/server.key --https-cert ./path/to/server.crt --https-ca ./path/to/ca.pem\n```\n\n> **Warning**\n>\n> This option is deprecated in favor of the [devServer.server](#devserverserver) option.\n\n## devServer.https\n\n`boolean` `object`\n\nBy default, dev-server will be served over `HTTP`. It can optionally be served over `HTTPS`:\n\n**webpack.config.js**\n\n```javascript\nmodule.exports = {\n  // ...\n  devServer: {\n    https: true,\n  },\n};\n```\n\nUsage via the CLI:\n\n```bash\nnpx webpack serve --https\n```\n\nTo disable:\n\n```bash\nnpx webpack serve --no-https\n```\n\nWith the above setting, a self-signed certificate is used, but you can provide your own:\n\n**webpack.config.js**\n\n```javascript\nmodule.exports = {\n  devServer: {\n    https: {\n      ca: \"./path/to/server.pem\",\n      pfx: \"./path/to/server.pfx\",\n      key: \"./path/to/server.key\",\n      cert: \"./path/to/server.crt\",\n      passphrase: \"webpack-dev-server\",\n      requestCert: true,\n    },\n  },\n};\n```\n\nThis object is passed straight to the Node.js HTTPS module, so see the [HTTPS documentation](https://nodejs.org/api/https.html) for more information.\n\nTo pass your own certificate via the CLI use the following options:\n\n```bash\nnpx webpack serve --https-request-cert --https-key ./path/to/server.key --https-cert ./path/to/server.crt --https-ca ./path/to/ca.pem --https-pfx ./path/to/server.pfx --https-passphrase webpack-dev-server\n```\n\n`webpack-dev-server >= v4.2.0` allows you to set additional [TLS options](https://nodejs.org/api/tls.html#tls_tls_createsecurecontext_options) like `minVersion`. Also, you can directly pass the contents of respective files:\n\n**webpack.config.js**\n\n```javascript\nconst fs = require(\"node:fs\");\nconst path = require(\"node:path\");\n\nmodule.exports = {\n  devServer: {\n    https: {\n      minVersion: \"TLSv1.1\",\n      key: fs.readFileSync(path.join(__dirname, \"./server.key\")),\n      pfx: fs.readFileSync(path.join(__dirname, \"./server.pfx\")),\n      cert: fs.readFileSync(path.join(__dirname, \"./server.crt\")),\n      ca: fs.readFileSync(path.join(__dirname, \"./ca.pem\")),\n      passphrase: \"webpack-dev-server\",\n      requestCert: true,\n    },\n  },\n};\n```\n\n> **Warning**\n>\n> Don't specify `https.ca` and `https.cacert` options together, if specified `https.ca` will be used. `https.cacert` is deprecated and will be removed in the next major release.\n\n> **Warning**\n>\n> This option is deprecated in favor of the [devServer.server](#devserverserver) option.\n\n## devServer.headers\n\n`array` `function` `object`\n\nAdds headers to all responses:\n\n**webpack.config.js**\n\n```javascript\nmodule.exports = {\n  // ...\n  devServer: {\n    headers: {\n      \"X-Custom-Foo\": \"bar\",\n    },\n  },\n};\n```\n\nYou can also pass an array:\n\n**webpack.config.js**\n\n```javascript\nmodule.exports = {\n  // ...\n  devServer: {\n    headers: [\n      {\n        key: \"X-Custom\",\n        value: \"foo\",\n      },\n      {\n        key: \"Y-Custom\",\n        value: \"bar\",\n      },\n    ],\n  },\n};\n```\n\nYou can also pass a function:\n\n```javascript\nmodule.exports = {\n  // ...\n  devServer: {\n    headers: () => ({ \"X-Bar\": [\"key1=value1\", \"key2=value2\"] }),\n  },\n};\n```\n\n## devServer.historyApiFallback\n\n`boolean = false` `object`\n\nWhen using the [HTML5 History API](https://developer.mozilla.org/en-US/docs/Web/API/History), the `index.html` page will likely have to be served in place of any `404` responses. Enable `devServer.historyApiFallback` by setting it to `true`:\n\n**webpack.config.js**\n\n```javascript\nmodule.exports = {\n  // ...\n  devServer: {\n    historyApiFallback: true,\n  },\n};\n```\n\nUsage via the CLI:\n\n```bash\nnpx webpack serve --history-api-fallback\n```\n\nTo disable:\n\n```bash\nnpx webpack serve --no-history-api-fallback\n```\n\nBy providing an object this behavior can be controlled further using options like `rewrites`:\n\n**webpack.config.js**\n\n```javascript\nmodule.exports = {\n  // ...\n  devServer: {\n    historyApiFallback: {\n      rewrites: [\n        { from: /^\\/$/, to: \"/views/landing.html\" },\n        { from: /^\\/subpage/, to: \"/views/subpage.html\" },\n        { from: /./, to: \"/views/404.html\" },\n      ],\n    },\n  },\n};\n```\n\nWhen using dots in your path (common with Angular), you may need to use the `disableDotRule`:\n\n**webpack.config.js**\n\n```javascript\nmodule.exports = {\n  // ...\n  devServer: {\n    historyApiFallback: {\n      disableDotRule: true,\n    },\n  },\n};\n```\n\nFor more options and information, see the [connect-history-api-fallback](https://github.com/bripkens/connect-history-api-fallback) documentation.\n\n## devServer.host\n\n`'local-ip' | 'local-ipv4' | 'local-ipv6'` `string`\n\nSpecify a host to use. If you want your server to be accessible externally, specify it like this:\n\n**webpack.config.js**\n\n```javascript\nmodule.exports = {\n  // ...\n  devServer: {\n    host: \"0.0.0.0\",\n  },\n};\n```\n\nUsage via the CLI:\n\n```bash\nnpx webpack serve --host 0.0.0.0\n```\n\nThis also works with IPv6:\n\n```bash\nnpx webpack serve --host ::\n```\n\n### local-ip\n\nSpecifying `local-ip` as host will try to resolve the host option as your local `IPv4` address if available, if `IPv4` is not available it will try to resolve your local `IPv6` address.\n\n```bash\nnpx webpack serve --host local-ip\n```\n\n### local-ipv4\n\nSpecifying `local-ipv4` as host will try to resolve the host option as your local `IPv4` address.\n\n```bash\nnpx webpack serve --host local-ipv4\n```\n\n### local-ipv6\n\nSpecifying local-ipv6 as host will try to resolve the host option as your local IPv6 address.\n\n```bash\nnpx webpack serve --host local-ipv6\n```\n\n## devServer.hot\n\n`'only'` `boolean = true`\n\nEnable webpack's [Hot Module Replacement](/concepts/hot-module-replacement/) feature:\n\n**webpack.config.js**\n\n```javascript\nmodule.exports = {\n  // ...\n  devServer: {\n    hot: true,\n  },\n};\n```\n\nUsage via the CLI:\n\n```bash\nnpx webpack serve --hot\n```\n\nTo disable:\n\n```bash\nnpx webpack serve --no-hot\n```\n\nTo enable Hot Module Replacement without page refresh as a fallback in case of build failures, use `hot: 'only'`:\n\n**webpack.config.js**\n\n```javascript\nmodule.exports = {\n  // ...\n  devServer: {\n    hot: \"only\",\n  },\n};\n```\n\nUsage via the CLI:\n\n```bash\nnpx webpack serve --hot only\n```\n\n> **Note**\n>\n> Since webpack-dev-server v4, HMR is enabled by default. It automatically applies [`webpack.HotModuleReplacementPlugin`](/plugins/hot-module-replacement-plugin/) which is required to enable HMR. So you don't have to add this plugin to your `webpack.config.js` when `hot` is set to `true` in config or via the CLI option `--hot`. See the [HMR concepts page](/concepts/hot-module-replacement/) for more information.\n\n## devServer.ipc\n\n`true` `string`\n\nThe Unix socket to listen to (instead of a [`host`](#devserverhost)).\n\nSetting it to `true` will listen to a socket at `/your-os-temp-dir/webpack-dev-server.sock`:\n\n**webpack.config.js**\n\n```javascript\nmodule.exports = {\n  // ...\n  devServer: {\n    ipc: true,\n  },\n};\n```\n\nUsage via the CLI:\n\n```bash\nnpx webpack serve --ipc\n```\n\nYou can also listen to a different socket with:\n\n**webpack.config.js**\n\n```javascript\nconst path = require(\"node:path\");\n\nmodule.exports = {\n  // ...\n  devServer: {\n    ipc: path.join(__dirname, \"my-socket.sock\"),\n  },\n};\n```\n\n## devServer.liveReload\n\n`boolean = true`\n\nBy default, the dev-server will reload/refresh the page when file changes are detected. [`devServer.hot`](#devserverhot) option must be disabled or [`devServer.watchFiles`](#devserverwatchfiles) option must be enabled in order for `liveReload` to take effect. Disable `devServer.liveReload` by setting it to `false`:\n\n**webpack.config.js**\n\n```javascript\nmodule.exports = {\n  // ...\n  devServer: {\n    liveReload: false,\n  },\n};\n```\n\nUsage via the CLI:\n\n```bash\nnpx webpack serve --live-reload\n```\n\nTo disable:\n\n```bash\nnpx webpack serve --no-live-reload\n```\n\n> **Warning**\n>\n> Live reloading works only with web related [targets](/configuration/target/#string) like `web`, `webworker`, `electron-renderer` and `node-webkit`.\n\n## devServer.magicHtml\n\n`boolean = true`\n\n<Badge text=\"v4.1.0+\" />\n\nTell dev-server to enable/disable magic HTML routes (routes corresponding to your webpack output, for example `/main` for `main.js`).\n\n**webpack.config.js**\n\n```javascript\nmodule.exports = {\n  // ...\n  devServer: {\n    magicHtml: true,\n  },\n};\n```\n\nUsage via the CLI:\n\n```bash\nnpx webpack serve --magic-html\n```\n\nTo disable:\n\n```bash\nnpx webpack serve --no-magic-html\n```\n\n## devServer.onAfterSetupMiddleware\n\n`function (devServer)`\n\nProvides the ability to execute custom middleware after all other middleware\ninternally within the server.\n\n**webpack.config.js**\n\n```javascript\nmodule.exports = {\n  // ...\n  devServer: {\n    onAfterSetupMiddleware(devServer) {\n      if (!devServer) {\n        throw new Error(\"webpack-dev-server is not defined\");\n      }\n\n      devServer.app.get(\"/some/path\", (req, res) => {\n        res.json({ custom: \"response\" });\n      });\n    },\n  },\n};\n```\n\n> **Warning**\n>\n> This option is deprecated in favor of the [devServer.setupMiddlewares](#devserversetupmiddlewares) option.\n\n## devServer.onBeforeSetupMiddleware\n\n`function (devServer)`\n\nProvides the ability to execute custom middleware prior to all other middleware\ninternally within the server. This could be used to define custom handlers, for\nexample:\n\n**webpack.config.js**\n\n```javascript\nmodule.exports = {\n  // ...\n  devServer: {\n    onBeforeSetupMiddleware(devServer) {\n      if (!devServer) {\n        throw new Error(\"webpack-dev-server is not defined\");\n      }\n\n      devServer.app.get(\"/some/path\", (req, res) => {\n        res.json({ custom: \"response\" });\n      });\n    },\n  },\n};\n```\n\n> **Warning**\n>\n> This option is deprecated in favor of the [devServer.setupMiddlewares](#devserversetupmiddlewares) option.\n\n## devserver.onListening\n\n`function (devServer)`\n\nProvides the ability to execute a custom function when webpack-dev-server starts listening for connections on a port.\n\n**webpack.config.js**\n\n```javascript\nmodule.exports = {\n  // ...\n  devServer: {\n    onListening(devServer) {\n      if (!devServer) {\n        throw new Error(\"webpack-dev-server is not defined\");\n      }\n\n      const { port } = devServer.server.address();\n      console.log(\"Listening on port:\", port);\n    },\n  },\n};\n```\n\n## devServer.open\n\n`boolean` `string` `object` `[string, object]`\n\nTells dev-server to open the browser after server had been started. Set it to `true` to open your default browser.\n\n**webpack.config.js**\n\n```javascript\nmodule.exports = {\n  // ...\n  devServer: {\n    open: true,\n  },\n};\n```\n\nUsage via the CLI:\n\n```bash\nnpx webpack serve --open\n```\n\nTo disable:\n\n```bash\nnpx webpack serve --no-open\n```\n\nTo open a specified page in a browser:\n\n**webpack.config.js**\n\n```javascript\nmodule.exports = {\n  // ...\n  devServer: {\n    open: [\"/my-page\"],\n  },\n};\n```\n\nUsage via the CLI:\n\n```bash\nnpx webpack serve --open /my-page\n```\n\nTo open multiple specified pages in browser:\n\n**webpack.config.js**\n\n```javascript\nmodule.exports = {\n  // ...\n  devServer: {\n    open: [\"/my-page\", \"/another-page\"],\n  },\n};\n```\n\nUsage via the CLI:\n\n```bash\nnpx webpack serve --open /my-page --open /another-page\n```\n\nProvide browser name to use instead of the default one:\n\n**webpack.config.js**\n\n```javascript\nmodule.exports = {\n  // ...\n  devServer: {\n    open: {\n      app: {\n        name: \"google-chrome\",\n      },\n    },\n  },\n};\n```\n\nUsage via the CLI:\n\n```bash\nnpx webpack serve --open-app-name 'google-chrome'\n```\n\nThe object accepts all [open](https://www.npmjs.com/package/open) options:\n\n**webpack.config.js**\n\n```javascript\nmodule.exports = {\n  // ...\n  devServer: {\n    open: {\n      target: [\"first.html\", \"http://localhost:8080/second.html\"],\n      app: {\n        name: \"google-chrome\",\n        arguments: [\"--incognito\", \"--new-window\"],\n      },\n    },\n  },\n};\n```\n\n> **Note**\n>\n> The browser application name is platform-dependent. Don't hard code it in reusable modules. For example, `'Chrome'` is `'Google Chrome'` on macOS, `'google-chrome'` on Linux, and `'chrome'` on Windows.\n\n## devServer.port\n\n`'auto'` `string` `number`\n\nSpecify a port number to listen for requests on:\n\n**webpack.config.js**\n\n```javascript\nmodule.exports = {\n  // ...\n  devServer: {\n    port: 8080,\n  },\n};\n```\n\nUsage via the CLI:\n\n```bash\nnpx webpack serve --port 8080\n```\n\n`port` option can't be `null` or an empty string, to automatically use a free port please use `port: 'auto'`:\n\n**webpack.config.js**\n\n```javascript\nmodule.exports = {\n  // ...\n  devServer: {\n    port: \"auto\",\n  },\n};\n```\n\nUsage via the CLI:\n\n```bash\nnpx webpack serve --port auto\n```\n\n## devServer.proxy\n\n`object` `[object, function]`\n\nProxying some URLs can be useful when you have a separate API backend development server and you want to send API requests on the same domain.\n\nThe dev-server makes use of the powerful [http-proxy-middleware](https://github.com/chimurai/http-proxy-middleware) package. Check out its [documentation](https://github.com/chimurai/http-proxy-middleware#options) for more advanced usages. Note that some of `http-proxy-middleware`'s features do not require a `target` key, e.g. its `router` feature, but you will still need to include a `target` key in your configuration here, otherwise `webpack-dev-server` won't pass it along to `http-proxy-middleware`.\n\nWith a backend on `localhost:3000`, you can use this to enable proxying:\n\n**webpack.config.js**\n\n```javascript\nmodule.exports = {\n  // ...\n  devServer: {\n    proxy: {\n      \"/api\": \"http://localhost:3000\",\n    },\n  },\n};\n```\n\nA request to `/api/users` will now proxy the request to `http://localhost:3000/api/users`.\n\nIf you don't want `/api` to be passed along, we need to rewrite the path:\n\n**webpack.config.js**\n\n```javascript\nmodule.exports = {\n  // ...\n  devServer: {\n    proxy: {\n      \"/api\": {\n        target: \"http://localhost:3000\",\n        pathRewrite: { \"^/api\": \"\" },\n      },\n    },\n  },\n};\n```\n\nA backend server running on HTTPS with an invalid certificate will not be accepted by default. If you want to, modify your configuration like this:\n\n**webpack.config.js**\n\n```javascript\nmodule.exports = {\n  // ...\n  devServer: {\n    proxy: {\n      \"/api\": {\n        target: \"https://other-server.example.com\",\n        secure: false,\n      },\n    },\n  },\n};\n```\n\nSometimes you don't want to proxy everything. It is possible to bypass the proxy based on the return value of a function.\n\nIn the function, you get access to the request, response, and proxy options.\n\n- Return `null` or `undefined` to continue processing the request with proxy.\n- Return `false` to produce a 404 error for the request.\n- Return a path to serve from, instead of continuing to proxy the request.\n\nE.g. for a browser request, you want to serve an HTML page, but for an API request, you want to proxy it. You could do something like this:\n\n**webpack.config.js**\n\n```javascript\nmodule.exports = {\n  // ...\n  devServer: {\n    proxy: {\n      \"/api\": {\n        target: \"http://localhost:3000\",\n        bypass(req, res, proxyOptions) {\n          if (req.headers.accept.includes(\"html\")) {\n            console.log(\"Skipping proxy for browser request.\");\n            return \"/index.html\";\n          }\n        },\n      },\n    },\n  },\n};\n```\n\nIf you want to proxy multiple, specific paths to the same target, you can use an array of one or more objects with a `context` property:\n\n**webpack.config.js**\n\n```javascript\nmodule.exports = {\n  // ...\n  devServer: {\n    proxy: [\n      {\n        context: [\"/auth\", \"/api\"],\n        target: \"http://localhost:3000\",\n      },\n    ],\n  },\n};\n```\n\nNote that requests to root won't be proxied by default. To enable root proxying, the [`devMiddleware.index`](#devserverdevmiddleware) option should be specified as a falsy value:\n\n**webpack.config.js**\n\n```javascript\nmodule.exports = {\n  // ...\n  devServer: {\n    devMiddleware: {\n      index: false, // specify to enable root proxying\n    },\n    proxy: {\n      context: () => true,\n      target: \"http://localhost:1234\",\n    },\n  },\n};\n```\n\nThe origin of the host header is kept when proxying by default, you can set `changeOrigin` to `true` to override this behaviour. It is useful in some cases like using [name-based virtual hosted sites](https://en.wikipedia.org/wiki/Virtual_hosting#Name-based).\n\n**webpack.config.js**\n\n```javascript\nmodule.exports = {\n  // ...\n  devServer: {\n    proxy: {\n      \"/api\": {\n        target: \"http://localhost:3000\",\n        changeOrigin: true,\n      },\n    },\n  },\n};\n```\n\n## devServer.server\n\n`'http' | 'https' | 'spdy'` `string` `object`\n\n<Badge text=\"v4.4.0+\" />\n\nAllows to set server and options (by default 'http').\n\n**webpack.config.js**\n\n```javascript\nmodule.exports = {\n  // ...\n  devServer: {\n    server: \"http\",\n  },\n};\n```\n\nUsage via the CLI:\n\n```bash\nnpx webpack serve --server-type http\n```\n\nTo serve over `HTTPS` with a self-signed certificate:\n\n**webpack.config.js**\n\n```javascript\nmodule.exports = {\n  // ...\n  devServer: {\n    server: \"https\",\n  },\n};\n```\n\nUsage via the CLI:\n\n```bash\nnpx webpack serve --server-type https\n```\n\nTo serve over `HTTP/2` using [spdy](https://www.npmjs.com/package/spdy) with a self-signed certificate:\n\n**webpack.config.js**\n\n```javascript\nmodule.exports = {\n  // ...\n  devServer: {\n    server: \"spdy\",\n  },\n};\n```\n\nUsage via the CLI:\n\n```bash\nnpx webpack serve --server-type spdy\n```\n\n> **Warning**\n>\n> This option is ignored for Node 15.0.0 and above, as [spdy is broken for those versions](https://github.com/spdy-http2/node-spdy/issues/380). The dev server will migrate over to Node's built-in HTTP/2 once [Express](https://expressjs.com/) supports it.\n\nUse the object syntax to provide your own certificate:\n\n**webpack.config.js**\n\n```javascript\nmodule.exports = {\n  // ...\n  devServer: {\n    server: {\n      type: \"https\",\n      options: {\n        ca: \"./path/to/server.pem\",\n        pfx: \"./path/to/server.pfx\",\n        key: \"./path/to/server.key\",\n        cert: \"./path/to/server.crt\",\n        passphrase: \"webpack-dev-server\",\n        requestCert: true,\n      },\n    },\n  },\n};\n```\n\nUsage via the CLI:\n\n```bash\nnpx webpack serve --server-type https --server-options-key ./path/to/server.key --server-options-cert ./path/to/server.crt --server-options-ca ./path/to/ca.pem --server-options-passphrase webpack-dev-server\n```\n\nIt also allows you to set additional [TLS options](https://nodejs.org/api/tls.html#tls_tls_createsecurecontext_options) like `minVersion` and you can directly pass the contents of respective files:\n\n**webpack.config.js**\n\n```javascript\nconst fs = require(\"node:fs\");\nconst path = require(\"node:path\");\n\nmodule.exports = {\n  // ...\n  devServer: {\n    server: {\n      type: \"https\",\n      options: {\n        minVersion: \"TLSv1.1\",\n        key: fs.readFileSync(path.join(__dirname, \"./server.key\")),\n        pfx: fs.readFileSync(path.join(__dirname, \"./server.pfx\")),\n        cert: fs.readFileSync(path.join(__dirname, \"./server.crt\")),\n        ca: fs.readFileSync(path.join(__dirname, \"./ca.pem\")),\n        passphrase: \"webpack-dev-server\",\n        requestCert: true,\n      },\n    },\n  },\n};\n```\n\n> **Warning**\n>\n> Don't specify `server.options.ca` and `server.options.cacert` options together, if specified `server.options.ca` will be used. `server.options.cacert` is deprecated and will be removed in the next major release.\n\n## devServer.setupExitSignals\n\n`boolean = true`\n\nAllows to close dev server and exit the process on `SIGINT` and `SIGTERM` signals.\n\n**webpack.config.js**\n\n```javascript\nmodule.exports = {\n  // ...\n  devServer: {\n    setupExitSignals: true,\n  },\n};\n```\n\n## devServer.setupMiddlewares\n\n`function (middlewares, devServer)`\n\n<Badge text=\"v4.7.0+\" />\n\nProvides the ability to execute a custom function and apply custom middleware(s).\n\n**webpack.config.js**\n\n```javascript\nmodule.exports = {\n  // ...\n  devServer: {\n    setupMiddlewares: (middlewares, devServer) => {\n      if (!devServer) {\n        throw new Error(\"webpack-dev-server is not defined\");\n      }\n\n      devServer.app.get(\"/setup-middleware/some/path\", (_, response) => {\n        response.send(\"setup-middlewares option GET\");\n      });\n\n      // Use the `unshift` method if you want to run a middleware before all other middlewares\n      // or when you are migrating from the `onBeforeSetupMiddleware` option\n      middlewares.unshift({\n        name: \"first-in-array\",\n        // `path` is optional\n        path: \"/foo/path\",\n        middleware: (req, res) => {\n          res.send(\"Foo!\");\n        },\n      });\n\n      // Use the `push` method if you want to run a middleware after all other middlewares\n      // or when you are migrating from the `onAfterSetupMiddleware` option\n      middlewares.push({\n        name: \"hello-world-test-one\",\n        // `path` is optional\n        path: \"/foo/bar\",\n        middleware: (req, res) => {\n          res.send(\"Foo Bar!\");\n        },\n      });\n\n      middlewares.push((req, res) => {\n        res.send(\"Hello World!\");\n      });\n\n      return middlewares;\n    },\n  },\n};\n```\n\n## devServer.static\n\n`boolean` `string` `object` `[string, object]`\n\nThis option allows configuring options for serving static files from the directory (by default 'public' directory). To disable set it to `false`:\n\n**webpack.config.js**\n\n```javascript\nmodule.exports = {\n  // ...\n  devServer: {\n    static: false,\n  },\n};\n```\n\nUsage via CLI:\n\n```bash\nnpx webpack serve --static\n```\n\nTo disable:\n\n```bash\nnpx webpack serve --no-static\n```\n\nTo watch a single directory:\n\n**webpack.config.js**\n\n```js\nmodule.exports = {\n  // ...\n  devServer: {\n    static: [\"assets\"],\n  },\n};\n```\n\nUsage via CLI:\n\n```bash\nnpx webpack serve --static assets\n```\n\nTo watch multiple static directories:\n\n**webpack.config.js**\n\n```js\nmodule.exports = {\n  // ...\n  devServer: {\n    static: [\"assets\", \"css\"],\n  },\n};\n```\n\nUsage via CLI:\n\n```bash\nnpx webpack serve --static assets --static css\n```\n\n### directory\n\n`string = path.join(process.cwd(), 'public')`\n\nTell the server where to serve the content from. This is only necessary if you want to serve static files. [`static.publicPath`](#publicpath) will be used to determine where the bundles should be served from and takes precedence.\n\n**webpack.config.js**\n\n```javascript\nconst path = require(\"node:path\");\n\nmodule.exports = {\n  // ...\n  devServer: {\n    static: {\n      directory: path.join(__dirname, \"public\"),\n    },\n  },\n};\n```\n\nProvide an array of objects in case you have multiple static folders:\n\n**webpack.config.js**\n\n```javascript\nconst path = require(\"node:path\");\n\nmodule.exports = {\n  // ...\n  devServer: {\n    static: [\n      {\n        directory: path.join(__dirname, \"assets\"),\n      },\n      {\n        directory: path.join(__dirname, \"css\"),\n      },\n    ],\n  },\n};\n```\n\n> **Note**\n>\n> It is recommended to use an absolute path.\n\n### staticOptions\n\n`object`\n\nIt is possible to configure advanced options for serving static files from [`static.directory`](#directory). See the [Express documentation](http://expressjs.com/en/4x/api.html#express.static) for the possible options.\n\n**webpack.config.js**\n\n```javascript\nmodule.exports = {\n  // ...\n  devServer: {\n    static: {\n      staticOptions: {\n        redirect: true,\n      },\n    },\n  },\n};\n```\n\n### publicPath\n\n`string = '/'` `[string]`\n\nTell the server at which URL to serve [`static.directory`](#directory) content. For example to serve a file `assets/manifest.json` at `/serve-public-path-url/manifest.json`, your configurations should be as following:\n\n**webpack.config.js**\n\n```javascript\nconst path = require(\"node:path\");\n\nmodule.exports = {\n  // ...\n  devServer: {\n    static: {\n      directory: path.join(__dirname, \"assets\"),\n      publicPath: \"/serve-public-path-url\",\n    },\n  },\n};\n```\n\nProvide an array of objects in case you have multiple static folders:\n\n**webpack.config.js**\n\n```javascript\nconst path = require(\"node:path\");\n\nmodule.exports = {\n  // ...\n  devServer: {\n    static: [\n      {\n        directory: path.join(__dirname, \"assets\"),\n        publicPath: \"/serve-public-path-url\",\n      },\n      {\n        directory: path.join(__dirname, \"css\"),\n        publicPath: \"/other-serve-public-path-url\",\n      },\n    ],\n  },\n};\n```\n\n### serveIndex\n\n`boolean` `object = { icons: true }`\n\nTell dev-server to use [`serveIndex`](https://github.com/expressjs/serve-index) middleware when enabled.\n\n[`serveIndex`](https://github.com/expressjs/serve-index) middleware generates directory listings on viewing directories that don't have an `index.html` file.\n\n**webpack.config.js**\n\n```javascript\nconst path = require(\"node:path\");\n\nmodule.exports = {\n  // ...\n  devServer: {\n    static: {\n      directory: path.join(__dirname, \"public\"),\n      serveIndex: true,\n    },\n  },\n};\n```\n\nUsage via CLI:\n\n```bash\nnpx webpack serve --static-serve-index\n```\n\nTo disable:\n\n```bash\nnpx webpack serve --no-static-serve-index\n```\n\n### watch\n\n`boolean` `object`\n\nTell dev-server to watch the files served by the [`static.directory`](#directory) option. It is enabled by default, and file changes will trigger a full page reload. This can be disabled by setting the `watch` option to `false`.\n\n**webpack.config.js**\n\n```javascript\nconst path = require(\"node:path\");\n\nmodule.exports = {\n  // ...\n  devServer: {\n    static: {\n      directory: path.join(__dirname, \"public\"),\n      watch: false,\n    },\n  },\n};\n```\n\nUsage via CLI:\n\n```bash\nnpx webpack serve --static-watch\n```\n\nTo disable:\n\n```bash\nnpx webpack serve --no-static-watch\n```\n\nIt is possible to configure advanced options for watching static files from [`static.directory`](#directory). See the [`chokidar`](https://github.com/paulmillr/chokidar) documentation for the possible options.\n\n**webpack.config.js**\n\n```javascript\nconst path = require(\"node:path\");\n\nmodule.exports = {\n  // ...\n  devServer: {\n    static: {\n      directory: path.join(__dirname, \"public\"),\n      watch: {\n        ignored: \"*.txt\",\n        usePolling: false,\n      },\n    },\n  },\n};\n```\n\n## devServer.watchFiles\n\n`string` `object` `[string, object]`\n\nThis option allows you to configure a list of globs/directories/files to watch for file changes. For example:\n\n**webpack.config.js**\n\n```javascript\nmodule.exports = {\n  // ...\n  devServer: {\n    watchFiles: [\"src/**/*.php\", \"public/**/*\"],\n  },\n};\n```\n\nIt is possible to configure advanced options for watching files. See the [`chokidar`](https://github.com/paulmillr/chokidar) documentation for the possible options.\n\n**webpack.config.js**\n\n```javascript\nmodule.exports = {\n  // ...\n  devServer: {\n    watchFiles: {\n      paths: [\"src/**/*.php\", \"public/**/*\"],\n      options: {\n        usePolling: false,\n      },\n    },\n  },\n};\n```\n\n## devServer.webSocketServer\n\n`false | 'sockjs' | 'ws'` `string` `function` `object`\n\nThis option allows us either to choose the current web-socket server or to provide custom web-socket server implementation.\n\nThe current default mode is `'ws'`. This mode uses [`ws`](https://www.npmjs.com/package/ws) as a server, and native WebSockets on the client.\n\n**webpack.config.js**\n\n```javascript\nmodule.exports = {\n  // ...\n  devServer: {\n    webSocketServer: \"ws\",\n  },\n};\n```\n\nTo create a custom server implementation, create a class that extends [`BaseServer`](https://github.com/webpack/webpack-dev-server/blob/main/lib/servers/BaseServer.js).\n\nUsing path to `CustomServer.js`, a custom WebSocket server implementation, along with the compatible `'ws'` client:\n\n**webpack.config.js**\n\n```javascript\nmodule.exports = {\n  // ...\n  devServer: {\n    client: {\n      webSocketTransport: \"ws\",\n    },\n    webSocketServer: require.resolve(\"./CustomServer\"),\n  },\n};\n```\n\nUsing custom, compatible WebSocket client and server implementations:\n\n**webpack.config.js**\n\n```javascript\nmodule.exports = {\n  // ...\n  devServer: {\n    client: {\n      webSocketTransport: require.resolve(\"./CustomClient\"),\n    },\n    webSocketServer: require.resolve(\"./CustomServer\"),\n  },\n};\n```\n"
  },
  {
    "path": "LICENSE",
    "content": "Copyright JS Foundation and other contributors\n\nPermission is hereby granted, free of charge, to any person obtaining\na copy of this software and associated documentation files (the\n'Software'), to deal in the Software without restriction, including\nwithout limitation the rights to use, copy, modify, merge, publish,\ndistribute, sublicense, and/or sell copies of the Software, and to\npermit persons to whom the Software is furnished to do so, subject to\nthe following conditions:\n\nThe above copyright notice and this permission notice shall be\nincluded in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\nIN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY\nCLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,\nTORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\nSOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n"
  },
  {
    "path": "README.md",
    "content": "<div align=\"center\">\n  <a href=\"https://github.com/webpack/webpack\">\n    <img width=\"200\" height=\"200\" src=\"https://webpack.js.org/assets/icon-square-big.svg\">\n  </a>\n</div>\n\n[![npm][npm]][npm-url]\n[![node][node]][node-url]\n[![tests][tests]][tests-url]\n[![coverage][cover]][cover-url]\n[![discussion][discussion]][discussion-url]\n[![downloads][downloads]][npm-url]\n[![contributors][contributors]][contributors-url]\n\n# webpack-dev-server\n\nUse [webpack](https://webpack.js.org) with a development server that provides\nlive reloading. This should be used for **development only**.\n\nIt uses [webpack-dev-middleware][middleware-url] under the hood, which provides\nfast in-memory access to the webpack assets.\n\n## Table of Contents\n\n- [Getting Started](#getting-started)\n- [Usage](#usage)\n  - [With the CLI](#with-the-cli)\n  - [With NPM Scripts](#with-npm-scripts)\n  - [With the API](#with-the-api)\n  - [With TypeScript](#with-typescript)\n  - [The Result](#the-result)\n- [Browser Support](#browser-support)\n- [Support](#support)\n- [Contributing](#contributing)\n- [Attribution](#attribution)\n- [License](#license)\n\n## Getting Started\n\nFirst things first, install the module:\n\n```console\nnpm install webpack-dev-server --save-dev\n```\n\nor\n\n```console\nyarn add -D webpack-dev-server\n```\n\nor\n\n```console\npnpm add -D webpack-dev-server\n```\n\n_Note: While you can install and run webpack-dev-server globally, we recommend\ninstalling it locally. webpack-dev-server will always use a local installation\nover a global one._\n\n## Usage\n\nThere are two main, recommended methods of using the module:\n\n### With the CLI\n\nThe easiest way to use it is with the [webpack CLI](https://webpack.js.org/api/cli/). In the directory where your\n`webpack.config.js` is, run:\n\n```console\nnpx webpack serve\n```\n\nFollowing options are available with `webpack serve`:\n\n```\nUsage: webpack serve|server|s [entries...] [options]\n\nRun the webpack dev server.\n\nOptions:\n  -c, --config <value...>                             Provide path to a webpack configuration file e.g. ./webpack.config.js.\n  --config-name <value...>                            Name of the configuration to use.\n  -m, --merge                                         Merge two or more configurations using 'webpack-merge'.\n  --disable-interpret                                 Disable interpret for loading the config file.\n  --env <value...>                                    Environment passed to the configuration when it is a function.\n  --node-env <value>                                  Sets process.env.NODE_ENV to the specified value.\n  --define-process-env-node-env <value>               Sets process.env.NODE_ENV to the specified value. (Currently an alias for `--node-env`)\n  --analyze                                           It invokes webpack-bundle-analyzer plugin to get bundle information.\n  --progress [value]                                  Print compilation progress during build.\n  -j, --json [value]                                  Prints result as JSON or store it in a file.\n  --fail-on-warnings                                  Stop webpack-cli process with non-zero exit code on warnings from webpack\n  -d, --devtool <value>                               A developer tool to enhance debugging (false | eval | [inline-|hidden-|eval-][nosources-][cheap-[module-]]source-map).\n  --no-devtool                                        Negative 'devtool' option.\n  --entry <value...>                                  A module that is loaded upon startup. Only the last one is exported.\n  --mode <value>                                      Enable production optimizations or development hints.\n  --name <value>                                      Name of the configuration. Used when loading multiple configurations.\n  -o, --output-path <value>                           The output directory as **absolute path** (required).\n  --stats [value]                                     Stats options object or preset name.\n  --no-stats                                          Negative 'stats' option.\n  -t, --target <value...>                             Environment to build for. Environment to build for. An array of environments to build for all of them when possible.\n  --no-target                                         Negative 'target' option.\n  --watch-options-stdin                               Stop watching when stdin stream has ended.\n  --no-watch-options-stdin                            Negative 'watch-options-stdin' option.\n  --allowed-hosts <value...>                          Allows to enumerate the hosts from which access to the dev server are allowed (useful when you are proxying dev server, by default is 'auto').\n  --allowed-hosts-reset                               Clear all items provided in 'allowedHosts' configuration. Allows to enumerate the hosts from which access to the dev server are allowed (useful when you are proxying dev server, by default is 'auto').\n  --bonjour                                           Allows to broadcasts dev server via ZeroConf networking on start.\n  --no-bonjour                                        Disallows to broadcasts dev server via ZeroConf networking on start.\n  --no-client                                         Disables client script.\n  --client-logging <value>                            Allows to set log level in the browser.\n  --client-overlay                                    Enables a full-screen overlay in the browser when there are compiler errors or warnings.\n  --no-client-overlay                                 Disables the full-screen overlay in the browser when there are compiler errors or warnings.\n  --client-overlay-errors                             Enables a full-screen overlay in the browser when there are compiler errors.\n  --no-client-overlay-errors                          Disables the full-screen overlay in the browser when there are compiler errors.\n  --client-overlay-warnings                           Enables a full-screen overlay in the browser when there are compiler warnings.\n  --no-client-overlay-warnings                        Disables the full-screen overlay in the browser when there are compiler warnings.\n  --client-overlay-runtime-errors                     Enables a full-screen overlay in the browser when there are uncaught runtime errors.\n  --no-client-overlay-runtime-errors                  Disables the full-screen overlay in the browser when there are uncaught runtime errors.\n  --client-overlay-trusted-types-policy-name <value>  The name of a Trusted Types policy for the overlay. Defaults to 'webpack-dev-server#overlay'.\n  --client-progress                                   Prints compilation progress in percentage in the browser.\n  --no-client-progress                                Does not print compilation progress in percentage in the browser.\n  --client-reconnect [value]                          Tells dev-server the number of times it should try to reconnect the client.\n  --no-client-reconnect                               Tells dev-server to not to try to reconnect the client.\n  --client-web-socket-transport <value>               Allows to set custom web socket transport to communicate with dev server.\n  --client-web-socket-url <value>                     Allows to specify URL to web socket server (useful when you're proxying dev server and client script does not always know where to connect to).\n  --client-web-socket-url-hostname <value>            Tells clients connected to devServer to use the provided hostname.\n  --client-web-socket-url-pathname <value>            Tells clients connected to devServer to use the provided path to connect.\n  --client-web-socket-url-password <value>            Tells clients connected to devServer to use the provided password to authenticate.\n  --client-web-socket-url-port <value>                Tells clients connected to devServer to use the provided port.\n  --client-web-socket-url-protocol <value>            Tells clients connected to devServer to use the provided protocol.\n  --client-web-socket-url-username <value>            Tells clients connected to devServer to use the provided username to authenticate.\n  --compress                                          Enables gzip compression for everything served.\n  --no-compress                                       Disables gzip compression for everything served.\n  --history-api-fallback                              Allows to proxy requests through a specified index page (by default 'index.html'), useful for Single Page Applications that utilise the HTML5 History API.\n  --no-history-api-fallback                           Disallows to proxy requests through a specified index page.\n  --host <value>                                      Allows to specify a hostname to use.\n  --hot [value]                                       Enables Hot Module Replacement.\n  --no-hot                                            Disables Hot Module Replacement.\n  --ipc [value]                                       Listen to a unix socket.\n  --live-reload                                       Enables reload/refresh the page(s) when file changes are detected (enabled by default).\n  --no-live-reload                                    Disables reload/refresh the page(s) when file changes are detected (enabled by default).\n  --open [value...]                                   Allows to configure dev server to open the browser(s) and page(s) after server had been started (set it to true to open your default browser).\n  --no-open                                           Does not open the default browser.\n  --open-target <value...>                            Opens specified page in browser.\n  --open-app-name <value...>                          Open specified browser.\n  --open-reset                                        Clear all items provided in 'open' configuration. Allows to configure dev server to open the browser(s) and page(s) after server had been started (set it to true to open your default browser).\n  --open-target-reset                                 Clear all items provided in 'open.target' configuration. Opens specified page in browser.\n  --open-app-name-reset                               Clear all items provided in 'open.app.name' configuration. Open specified browser.\n  --port <value>                                      Allows to specify a port to use.\n  --server-type <value>                               Allows to set server and options (by default 'http').\n  --server-options-passphrase <value>                 Passphrase for a pfx file.\n  --server-options-request-cert                       Request for an SSL certificate.\n  --no-server-options-request-cert                    Does not request for an SSL certificate.\n  --server-options-ca <value...>                      Path to an SSL CA certificate or content of an SSL CA certificate.\n  --server-options-ca-reset                           Clear all items provided in 'server.options.ca' configuration. Path to an SSL CA certificate or content of an SSL CA certificate.\n  --server-options-cert <value...>                    Path to an SSL certificate or content of an SSL certificate.\n  --server-options-cert-reset                         Clear all items provided in 'server.options.cert' configuration. Path to an SSL certificate or content of an SSL certificate.\n  --server-options-crl <value...>                     Path to PEM formatted CRLs (Certificate Revocation Lists) or content of PEM formatted CRLs (Certificate Revocation Lists).\n  --server-options-crl-reset                          Clear all items provided in 'server.options.crl' configuration. Path to PEM formatted CRLs (Certificate Revocation Lists) or content of PEM formatted CRLs (Certificate Revocation Lists).\n  --server-options-key <value...>                     Path to an SSL key or content of an SSL key.\n  --server-options-key-reset                          Clear all items provided in 'server.options.key' configuration. Path to an SSL key or content of an SSL key.\n  --server-options-pfx <value...>                     Path to an SSL pfx file or content of an SSL pfx file.\n  --server-options-pfx-reset                          Clear all items provided in 'server.options.pfx' configuration. Path to an SSL pfx file or content of an SSL pfx file.\n  --static [value...]                                 Allows to configure options for serving static files from directory (by default 'public' directory).\n  --no-static                                         Disallows to configure options for serving static files from directory.\n  --static-directory <value...>                       Directory for static contents.\n  --static-public-path <value...>                     The static files will be available in the browser under this public path.\n  --static-serve-index                                Tells dev server to use serveIndex middleware when enabled.\n  --no-static-serve-index                             Does not tell dev server to use serveIndex middleware.\n  --static-watch                                      Watches for files in static content directory.\n  --no-static-watch                                   Does not watch for files in static content directory.\n  --static-reset                                      Clear all items provided in 'static' configuration. Allows to configure options for serving static files from directory (by default 'public' directory).\n  --static-public-path-reset                          Clear all items provided in 'static.publicPath' configuration. The static files will be available in the browser under this public path.\n  --watch-files <value...>                            Allows to configure list of globs/directories/files to watch for file changes.\n  --watch-files-reset                                 Clear all items provided in 'watchFiles' configuration. Allows to configure list of globs/directories/files to watch for file changes.\n  --no-web-socket-server                              Disallows to set web socket server and options.\n  --web-socket-server-type <value>                    Allows to set web socket server and options (by default 'ws').\n\nGlobal options:\n  --color                                             Enable colors on console.\n  --no-color                                          Disable colors on console.\n  -v, --version                                       Output the version number of 'webpack', 'webpack-cli' and 'webpack-dev-server' and commands.\n  -h, --help [verbose]                                Display help for commands and options.\n\nTo see list of all supported commands and options run 'webpack --help=verbose'.\n\nWebpack documentation: https://webpack.js.org/.\nCLI documentation: https://webpack.js.org/api/cli/.\nMade with ♥ by the webpack team.\n```\n\n> [!NOTE]\n>\n> _Detailed documentation for above options is available on this [link](https://webpack.js.org/configuration/dev-server/)._\n\n### With NPM Scripts\n\nNPM package.json scripts are a convenient and useful means to run locally installed\nbinaries without having to be concerned about their full paths. Simply define a\nscript as such:\n\n```json\n{\n  \"scripts\": {\n    \"serve\": \"webpack serve\"\n  }\n}\n```\n\nAnd run the following in your terminal/console:\n\n```console\nnpm run serve\n```\n\nNPM will automatically refer to the the binary in `node_modules` for you, and\nexecute the file or command.\n\n### With the API\n\nWhile it's recommended to run webpack-dev-server via the CLI, you may also choose to start a server via the API.\n\nSee the related [API documentation for `webpack-dev-server`](https://webpack.js.org/api/webpack-dev-server/).\n\n### With TypeScript\n\nIf you use TypeScript in the webpack config, you'll need to properly type `devServer` property in order to avoid TS errors (e.g. `'devServer' does not exist in type 'Configuration'`). For that use either:\n\n```ts\n/// <reference path=\"node_modules/webpack-dev-server/types/lib/Server.d.ts\"/>\nimport { type Configuration } from \"webpack\";\n\n// Your logic\n```\n\nOr you can import the type from `webpack-dev-server`, i.e.\n\n```ts\nimport { type Configuration } from \"webpack\";\nimport { type Configuration as DevServerConfiguration } from \"webpack-dev-server\";\n\nconst devServer: DevServerConfiguration = {};\nconst config: Configuration = { devServer };\n\n// module.exports\nexport default config;\n```\n\n### The Result\n\nEither method will start a server instance and begin listening for connections\nfrom `localhost` on port `8080`.\n\nwebpack-dev-server is configured by default to support live-reload of files as\nyou edit your assets while the server is running.\n\nSee [**the documentation**][docs-url] for more use cases and options.\n\n## Browser Support\n\nWhile `webpack-dev-server` transpiles the client (browser) scripts to an ES5\nstate, the project only officially supports the _last two versions of major\nbrowsers_. We simply don't have the resources to support every whacky\nbrowser out there.\n\nIf you find a bug with an obscure / old browser, we would actively welcome a\nPull Request to resolve the bug.\n\n## Support\n\nWe do our best to keep issues in the repository focused on bugs, features, and\nneeded modifications to the code for the module. Because of that, we ask users\nwith general support, \"how-to\", or \"why isn't this working\" questions to try one\nof the other support channels that are available.\n\nYour first-stop-shop for support for webpack-dev-server should be the excellent\n[documentation][docs-url] for the module. If you see an opportunity for improvement\nof those docs, please head over to the [webpack.js.org repo][wjo-url] and open a\npull request.\n\nFrom there, we encourage users to visit the [webpack discussions][discussion-url] and\ntalk to the fine folks there. If your quest for answers comes up dry in chat,\nhead over to [StackOverflow][stack-url] and do a quick search or open a new\nquestion. Remember; It's always much easier to answer questions that include your\n`webpack.config.js` and relevant files!\n\nIf you're twitter-savvy you can tweet [#webpack][hash-url] with your question\nand someone should be able to reach out and lend a hand.\n\nIf you have discovered a :bug:, have a feature suggestion, or would like to see\na modification, please feel free to create an issue on Github. _Note: The issue\ntemplate isn't optional, so please be sure not to remove it, and please fill it\nout completely._\n\n## Contributing\n\nWe welcome your contributions! Please have a read of [CONTRIBUTING.md](CONTRIBUTING.md) for more information on how to get involved.\n\n## Attribution\n\nThis project is heavily inspired by [peerigon/nof5](https://github.com/peerigon/nof5).\n\n## License\n\n#### [MIT](./LICENSE)\n\n[npm]: https://img.shields.io/npm/v/webpack-dev-server.svg\n[npm-url]: https://npmjs.com/package/webpack-dev-server\n[node]: https://img.shields.io/node/v/webpack-dev-server.svg\n[node-url]: https://nodejs.org\n[tests]: https://github.com/webpack/webpack-dev-server/workflows/webpack-dev-server/badge.svg\n[tests-url]: https://github.com/webpack/webpack-dev-server/actions?query=workflow%3Awebpack-dev-server\n[cover]: https://codecov.io/gh/webpack/webpack-dev-server/graph/badge.svg\n[cover-url]: https://codecov.io/gh/webpack/webpack-dev-server\n[discussion]: https://img.shields.io/github/discussions/webpack/webpack\n[discussion-url]: https://github.com/webpack/webpack/discussions\n[docs-url]: https://webpack.js.org/configuration/dev-server/#devserver\n[hash-url]: https://twitter.com/search?q=webpack\n[middleware-url]: https://github.com/webpack/webpack-dev-middleware\n[stack-url]: https://stackoverflow.com/questions/tagged/webpack-dev-server\n[uglify-url]: https://github.com/webpack-contrib/uglifyjs-webpack-plugin\n[wjo-url]: https://github.com/webpack/webpack.js.org\n[downloads]: https://img.shields.io/npm/dm/webpack-dev-server.svg\n[contributors-url]: https://github.com/webpack/webpack-dev-server/graphs/contributors\n[contributors]: https://img.shields.io/github/contributors/webpack/webpack-dev-server.svg\n"
  },
  {
    "path": "babel.config.js",
    "content": "\"use strict\";\n\nmodule.exports = (api) => {\n  api.cache(true);\n\n  return {\n    presets: [\n      [\n        \"@babel/preset-env\",\n        {\n          modules: false,\n          targets: {\n            esmodules: true,\n            node: \"0.12\",\n          },\n        },\n      ],\n    ],\n    plugins: [\"@babel/plugin-transform-object-assign\"],\n    env: {\n      test: {\n        presets: [\n          [\n            \"@babel/preset-env\",\n            {\n              targets: {\n                node: \"18.12.0\",\n              },\n            },\n          ],\n        ],\n        plugins: [\"@babel/plugin-transform-runtime\"],\n      },\n    },\n  };\n};\n"
  },
  {
    "path": "bin/cli-flags.js",
    "content": "\"use strict\";\n\nmodule.exports = {\n  \"allowed-hosts\": {\n    configs: [\n      {\n        type: \"string\",\n        multiple: true,\n        description:\n          \"Allows to enumerate the hosts from which access to the dev server are allowed (useful when you are proxying dev server, by default is 'auto').\",\n        path: \"allowedHosts[]\",\n      },\n      {\n        description:\n          \"Allows to enumerate the hosts from which access to the dev server are allowed (useful when you are proxying dev server, by default is 'auto').\",\n        multiple: false,\n        path: \"allowedHosts\",\n        type: \"enum\",\n        values: [\"auto\", \"all\"],\n      },\n    ],\n    description:\n      \"Allows to enumerate the hosts from which access to the dev server are allowed (useful when you are proxying dev server, by default is 'auto').\",\n    multiple: true,\n    simpleType: \"string\",\n  },\n  \"allowed-hosts-reset\": {\n    configs: [\n      {\n        type: \"reset\",\n        multiple: false,\n        description:\n          \"Clear all items provided in 'allowedHosts' configuration. Allows to enumerate the hosts from which access to the dev server are allowed (useful when you are proxying dev server, by default is 'auto').\",\n        path: \"allowedHosts\",\n      },\n    ],\n    description:\n      \"Clear all items provided in 'allowedHosts' configuration. Allows to enumerate the hosts from which access to the dev server are allowed (useful when you are proxying dev server, by default is 'auto').\",\n    simpleType: \"boolean\",\n    multiple: false,\n  },\n  bonjour: {\n    configs: [\n      {\n        type: \"boolean\",\n        multiple: false,\n        description:\n          \"Allows to broadcasts dev server via ZeroConf networking on start.\",\n        negatedDescription:\n          \"Disallows to broadcasts dev server via ZeroConf networking on start.\",\n        path: \"bonjour\",\n      },\n    ],\n    description:\n      \"Allows to broadcasts dev server via ZeroConf networking on start.\",\n    simpleType: \"boolean\",\n    multiple: false,\n  },\n  client: {\n    configs: [\n      {\n        description:\n          \"Allows to specify options for client script in the browser or disable client script.\",\n        negatedDescription: \"Disables client script.\",\n        multiple: false,\n        path: \"client\",\n        type: \"enum\",\n        values: [false],\n      },\n    ],\n    description:\n      \"Allows to specify options for client script in the browser or disable client script.\",\n    multiple: false,\n    simpleType: \"boolean\",\n  },\n  \"client-logging\": {\n    configs: [\n      {\n        type: \"enum\",\n        values: [\"none\", \"error\", \"warn\", \"info\", \"log\", \"verbose\"],\n        multiple: false,\n        description: \"Allows to set log level in the browser.\",\n        path: \"client.logging\",\n      },\n    ],\n    description: \"Allows to set log level in the browser.\",\n    simpleType: \"string\",\n    multiple: false,\n  },\n  \"client-overlay\": {\n    configs: [\n      {\n        type: \"boolean\",\n        multiple: false,\n        description:\n          \"Enables a full-screen overlay in the browser when there are compiler errors or warnings.\",\n        negatedDescription:\n          \"Disables the full-screen overlay in the browser when there are compiler errors or warnings.\",\n        path: \"client.overlay\",\n      },\n    ],\n    description:\n      \"Enables a full-screen overlay in the browser when there are compiler errors or warnings.\",\n    simpleType: \"boolean\",\n    multiple: false,\n  },\n  \"client-overlay-errors\": {\n    configs: [\n      {\n        type: \"boolean\",\n        multiple: false,\n        description:\n          \"Enables a full-screen overlay in the browser when there are compiler errors.\",\n        negatedDescription:\n          \"Disables the full-screen overlay in the browser when there are compiler errors.\",\n        path: \"client.overlay.errors\",\n      },\n    ],\n    description:\n      \"Enables a full-screen overlay in the browser when there are compiler errors.\",\n    simpleType: \"boolean\",\n    multiple: false,\n  },\n  \"client-overlay-trusted-types-policy-name\": {\n    configs: [\n      {\n        description:\n          \"The name of a Trusted Types policy for the overlay. Defaults to 'webpack-dev-server#overlay'.\",\n        multiple: false,\n        path: \"client.overlay.trustedTypesPolicyName\",\n        type: \"string\",\n      },\n    ],\n    description:\n      \"The name of a Trusted Types policy for the overlay. Defaults to 'webpack-dev-server#overlay'.\",\n    multiple: false,\n    simpleType: \"string\",\n  },\n  \"client-overlay-warnings\": {\n    configs: [\n      {\n        type: \"boolean\",\n        multiple: false,\n        description:\n          \"Enables a full-screen overlay in the browser when there are compiler warnings.\",\n        negatedDescription:\n          \"Disables the full-screen overlay in the browser when there are compiler warnings.\",\n        path: \"client.overlay.warnings\",\n      },\n    ],\n    description:\n      \"Enables a full-screen overlay in the browser when there are compiler warnings.\",\n    simpleType: \"boolean\",\n    multiple: false,\n  },\n  \"client-overlay-runtime-errors\": {\n    configs: [\n      {\n        type: \"boolean\",\n        multiple: false,\n        description:\n          \"Enables a full-screen overlay in the browser when there are uncaught runtime errors.\",\n        negatedDescription:\n          \"Disables the full-screen overlay in the browser when there are uncaught runtime errors.\",\n        path: \"client.overlay.runtimeErrors\",\n      },\n    ],\n    description:\n      \"Enables a full-screen overlay in the browser when there are uncaught runtime errors.\",\n    simpleType: \"boolean\",\n    multiple: false,\n  },\n  \"client-progress\": {\n    configs: [\n      {\n        type: \"boolean\",\n        multiple: false,\n        description:\n          \"Prints compilation progress in percentage in the browser.\",\n        negatedDescription:\n          \"Does not print compilation progress in percentage in the browser.\",\n        path: \"client.progress\",\n      },\n    ],\n    description: \"Prints compilation progress in percentage in the browser.\",\n    simpleType: \"boolean\",\n    multiple: false,\n  },\n  \"client-reconnect\": {\n    configs: [\n      {\n        type: \"boolean\",\n        multiple: false,\n        description:\n          \"Tells dev-server the number of times it should try to reconnect the client.\",\n        negatedDescription:\n          \"Tells dev-server to not to try to reconnect the client.\",\n        path: \"client.reconnect\",\n      },\n      {\n        type: \"number\",\n        multiple: false,\n        description:\n          \"Tells dev-server the number of times it should try to reconnect the client.\",\n        path: \"client.reconnect\",\n      },\n    ],\n    description:\n      \"Tells dev-server the number of times it should try to reconnect the client.\",\n    simpleType: \"string\",\n    multiple: false,\n  },\n  \"client-web-socket-transport\": {\n    configs: [\n      {\n        type: \"enum\",\n        values: [\"sockjs\", \"ws\"],\n        multiple: false,\n        description:\n          \"Allows to set custom web socket transport to communicate with dev server.\",\n        path: \"client.webSocketTransport\",\n      },\n      {\n        type: \"string\",\n        multiple: false,\n        description:\n          \"Allows to set custom web socket transport to communicate with dev server.\",\n        path: \"client.webSocketTransport\",\n      },\n    ],\n    description:\n      \"Allows to set custom web socket transport to communicate with dev server.\",\n    simpleType: \"string\",\n    multiple: false,\n  },\n  \"client-web-socket-url\": {\n    configs: [\n      {\n        type: \"string\",\n        multiple: false,\n        description:\n          \"Allows to specify URL to web socket server (useful when you're proxying dev server and client script does not always know where to connect to).\",\n        path: \"client.webSocketURL\",\n      },\n    ],\n    description:\n      \"Allows to specify URL to web socket server (useful when you're proxying dev server and client script does not always know where to connect to).\",\n    simpleType: \"string\",\n    multiple: false,\n  },\n  \"client-web-socket-url-hostname\": {\n    configs: [\n      {\n        type: \"string\",\n        multiple: false,\n        description:\n          \"Tells clients connected to devServer to use the provided hostname.\",\n        path: \"client.webSocketURL.hostname\",\n      },\n    ],\n    description:\n      \"Tells clients connected to devServer to use the provided hostname.\",\n    simpleType: \"string\",\n    multiple: false,\n  },\n  \"client-web-socket-url-password\": {\n    configs: [\n      {\n        type: \"string\",\n        multiple: false,\n        description:\n          \"Tells clients connected to devServer to use the provided password to authenticate.\",\n        path: \"client.webSocketURL.password\",\n      },\n    ],\n    description:\n      \"Tells clients connected to devServer to use the provided password to authenticate.\",\n    simpleType: \"string\",\n    multiple: false,\n  },\n  \"client-web-socket-url-pathname\": {\n    configs: [\n      {\n        type: \"string\",\n        multiple: false,\n        description:\n          \"Tells clients connected to devServer to use the provided path to connect.\",\n        path: \"client.webSocketURL.pathname\",\n      },\n    ],\n    description:\n      \"Tells clients connected to devServer to use the provided path to connect.\",\n    simpleType: \"string\",\n    multiple: false,\n  },\n  \"client-web-socket-url-port\": {\n    configs: [\n      {\n        type: \"number\",\n        multiple: false,\n        description:\n          \"Tells clients connected to devServer to use the provided port.\",\n        path: \"client.webSocketURL.port\",\n      },\n      {\n        description:\n          \"Tells clients connected to devServer to use the provided port.\",\n        multiple: false,\n        path: \"client.webSocketURL.port\",\n        type: \"string\",\n      },\n    ],\n    description:\n      \"Tells clients connected to devServer to use the provided port.\",\n    simpleType: \"string\",\n    multiple: false,\n  },\n  \"client-web-socket-url-protocol\": {\n    configs: [\n      {\n        description:\n          \"Tells clients connected to devServer to use the provided protocol.\",\n        multiple: false,\n        path: \"client.webSocketURL.protocol\",\n        type: \"enum\",\n        values: [\"auto\"],\n      },\n      {\n        description:\n          \"Tells clients connected to devServer to use the provided protocol.\",\n        multiple: false,\n        path: \"client.webSocketURL.protocol\",\n        type: \"string\",\n      },\n    ],\n    description:\n      \"Tells clients connected to devServer to use the provided protocol.\",\n    multiple: false,\n    simpleType: \"string\",\n  },\n  \"client-web-socket-url-username\": {\n    configs: [\n      {\n        type: \"string\",\n        multiple: false,\n        description:\n          \"Tells clients connected to devServer to use the provided username to authenticate.\",\n        path: \"client.webSocketURL.username\",\n      },\n    ],\n    description:\n      \"Tells clients connected to devServer to use the provided username to authenticate.\",\n    simpleType: \"string\",\n    multiple: false,\n  },\n  compress: {\n    configs: [\n      {\n        type: \"boolean\",\n        multiple: false,\n        description: \"Enables gzip compression for everything served.\",\n        negatedDescription: \"Disables gzip compression for everything served.\",\n        path: \"compress\",\n      },\n    ],\n    description: \"Enables gzip compression for everything served.\",\n    simpleType: \"boolean\",\n    multiple: false,\n  },\n  \"history-api-fallback\": {\n    configs: [\n      {\n        type: \"boolean\",\n        multiple: false,\n        description:\n          \"Allows to proxy requests through a specified index page (by default 'index.html'), useful for Single Page Applications that utilise the HTML5 History API.\",\n        negatedDescription:\n          \"Disallows to proxy requests through a specified index page.\",\n        path: \"historyApiFallback\",\n      },\n    ],\n    description:\n      \"Allows to proxy requests through a specified index page (by default 'index.html'), useful for Single Page Applications that utilise the HTML5 History API.\",\n    simpleType: \"boolean\",\n    multiple: false,\n  },\n  host: {\n    configs: [\n      {\n        description: \"Allows to specify a hostname to use.\",\n        multiple: false,\n        path: \"host\",\n        type: \"enum\",\n        values: [\"local-ip\", \"local-ipv4\", \"local-ipv6\"],\n      },\n      {\n        description: \"Allows to specify a hostname to use.\",\n        multiple: false,\n        path: \"host\",\n        type: \"string\",\n      },\n    ],\n    description: \"Allows to specify a hostname to use.\",\n    simpleType: \"string\",\n    multiple: false,\n  },\n  hot: {\n    configs: [\n      {\n        type: \"boolean\",\n        multiple: false,\n        description: \"Enables Hot Module Replacement.\",\n        negatedDescription: \"Disables Hot Module Replacement.\",\n        path: \"hot\",\n      },\n      {\n        type: \"enum\",\n        values: [\"only\"],\n        multiple: false,\n        description: \"Enables Hot Module Replacement.\",\n        path: \"hot\",\n      },\n    ],\n    description: \"Enables Hot Module Replacement.\",\n    simpleType: \"string\",\n    multiple: false,\n  },\n  http2: {\n    configs: [\n      {\n        type: \"boolean\",\n        multiple: false,\n        description:\n          \"Allows to serve over HTTP/2 using SPDY. Deprecated, use the `server` option.\",\n        negatedDescription: \"Does not serve over HTTP/2 using SPDY.\",\n        path: \"http2\",\n      },\n    ],\n    description:\n      \"Allows to serve over HTTP/2 using SPDY. Deprecated, use the `server` option.\",\n    simpleType: \"boolean\",\n    multiple: false,\n  },\n  https: {\n    configs: [\n      {\n        type: \"boolean\",\n        multiple: false,\n        description:\n          \"Allows to configure the server's listening socket for TLS (by default, dev server will be served over HTTP). Deprecated, use the `server` option.\",\n        negatedDescription:\n          \"Disallows to configure the server's listening socket for TLS (by default, dev server will be served over HTTP).\",\n        path: \"https\",\n      },\n    ],\n    description:\n      \"Allows to configure the server's listening socket for TLS (by default, dev server will be served over HTTP). Deprecated, use the `server` option.\",\n    simpleType: \"boolean\",\n    multiple: false,\n  },\n  \"https-ca\": {\n    configs: [\n      {\n        type: \"string\",\n        multiple: true,\n        description:\n          \"Path to an SSL CA certificate or content of an SSL CA certificate. Deprecated, use the `server.options.ca` option.\",\n        path: \"https.ca[]\",\n      },\n    ],\n    description:\n      \"Path to an SSL CA certificate or content of an SSL CA certificate. Deprecated, use the `server.options.ca` option.\",\n    simpleType: \"string\",\n    multiple: true,\n  },\n  \"https-ca-reset\": {\n    configs: [\n      {\n        description:\n          \"Clear all items provided in 'https.ca' configuration. Path to an SSL CA certificate or content of an SSL CA certificate. Deprecated, use the `server.options.ca` option.\",\n        multiple: false,\n        path: \"https.ca\",\n        type: \"reset\",\n      },\n    ],\n    description:\n      \"Clear all items provided in 'https.ca' configuration. Path to an SSL CA certificate or content of an SSL CA certificate. Deprecated, use the `server.options.ca` option.\",\n    multiple: false,\n    simpleType: \"boolean\",\n  },\n  \"https-cacert\": {\n    configs: [\n      {\n        type: \"string\",\n        multiple: true,\n        description:\n          \"Path to an SSL CA certificate or content of an SSL CA certificate. Deprecated, use the `server.options.ca` option.\",\n        path: \"https.cacert[]\",\n      },\n    ],\n    description:\n      \"Path to an SSL CA certificate or content of an SSL CA certificate. Deprecated, use the `server.options.ca` option.\",\n    simpleType: \"string\",\n    multiple: true,\n  },\n  \"https-cacert-reset\": {\n    configs: [\n      {\n        description:\n          \"Clear all items provided in 'https.cacert' configuration. Path to an SSL CA certificate or content of an SSL CA certificate. Deprecated, use the `server.options.ca` option.\",\n        multiple: false,\n        path: \"https.cacert\",\n        type: \"reset\",\n      },\n    ],\n    description:\n      \"Clear all items provided in 'https.cacert' configuration. Path to an SSL CA certificate or content of an SSL CA certificate. Deprecated, use the `server.options.ca` option.\",\n    multiple: false,\n    simpleType: \"boolean\",\n  },\n  \"https-cert\": {\n    configs: [\n      {\n        type: \"string\",\n        multiple: true,\n        description:\n          \"Path to an SSL certificate or content of an SSL certificate. Deprecated, use the `server.options.cert` option.\",\n        path: \"https.cert[]\",\n      },\n    ],\n    description:\n      \"Path to an SSL certificate or content of an SSL certificate. Deprecated, use the `server.options.cert` option.\",\n    simpleType: \"string\",\n    multiple: true,\n  },\n  \"https-cert-reset\": {\n    configs: [\n      {\n        description:\n          \"Clear all items provided in 'https.cert' configuration. Path to an SSL certificate or content of an SSL certificate. Deprecated, use the `server.options.cert` option.\",\n        multiple: false,\n        path: \"https.cert\",\n        type: \"reset\",\n      },\n    ],\n    description:\n      \"Clear all items provided in 'https.cert' configuration. Path to an SSL certificate or content of an SSL certificate. Deprecated, use the `server.options.cert` option.\",\n    multiple: false,\n    simpleType: \"boolean\",\n  },\n  \"https-crl\": {\n    configs: [\n      {\n        description:\n          \"Path to PEM formatted CRLs (Certificate Revocation Lists) or content of PEM formatted CRLs (Certificate Revocation Lists). Deprecated, use the `server.options.crl` option.\",\n        multiple: true,\n        path: \"https.crl[]\",\n        type: \"string\",\n      },\n    ],\n    description:\n      \"Path to PEM formatted CRLs (Certificate Revocation Lists) or content of PEM formatted CRLs (Certificate Revocation Lists). Deprecated, use the `server.options.crl` option.\",\n    multiple: true,\n    simpleType: \"string\",\n  },\n  \"https-crl-reset\": {\n    configs: [\n      {\n        description:\n          \"Clear all items provided in 'https.crl' configuration. Path to PEM formatted CRLs (Certificate Revocation Lists) or content of PEM formatted CRLs (Certificate Revocation Lists). Deprecated, use the `server.options.crl` option.\",\n        multiple: false,\n        path: \"https.crl\",\n        type: \"reset\",\n      },\n    ],\n    description:\n      \"Clear all items provided in 'https.crl' configuration. Path to PEM formatted CRLs (Certificate Revocation Lists) or content of PEM formatted CRLs (Certificate Revocation Lists). Deprecated, use the `server.options.crl` option.\",\n    multiple: false,\n    simpleType: \"boolean\",\n  },\n  \"https-key\": {\n    configs: [\n      {\n        type: \"string\",\n        multiple: true,\n        description:\n          \"Path to an SSL key or content of an SSL key. Deprecated, use the `server.options.key` option.\",\n        path: \"https.key[]\",\n      },\n    ],\n    description:\n      \"Path to an SSL key or content of an SSL key. Deprecated, use the `server.options.key` option.\",\n    simpleType: \"string\",\n    multiple: true,\n  },\n  \"https-key-reset\": {\n    configs: [\n      {\n        description:\n          \"Clear all items provided in 'https.key' configuration. Path to an SSL key or content of an SSL key. Deprecated, use the `server.options.key` option.\",\n        multiple: false,\n        path: \"https.key\",\n        type: \"reset\",\n      },\n    ],\n    description:\n      \"Clear all items provided in 'https.key' configuration. Path to an SSL key or content of an SSL key. Deprecated, use the `server.options.key` option.\",\n    multiple: false,\n    simpleType: \"boolean\",\n  },\n  \"https-passphrase\": {\n    configs: [\n      {\n        type: \"string\",\n        multiple: false,\n        description:\n          \"Passphrase for a pfx file. Deprecated, use the `server.options.passphrase` option.\",\n        path: \"https.passphrase\",\n      },\n    ],\n    description:\n      \"Passphrase for a pfx file. Deprecated, use the `server.options.passphrase` option.\",\n    simpleType: \"string\",\n    multiple: false,\n  },\n  \"https-pfx\": {\n    configs: [\n      {\n        type: \"string\",\n        multiple: true,\n        description:\n          \"Path to an SSL pfx file or content of an SSL pfx file. Deprecated, use the `server.options.pfx` option.\",\n        path: \"https.pfx[]\",\n      },\n    ],\n    description:\n      \"Path to an SSL pfx file or content of an SSL pfx file. Deprecated, use the `server.options.pfx` option.\",\n    simpleType: \"string\",\n    multiple: true,\n  },\n  \"https-pfx-reset\": {\n    configs: [\n      {\n        description:\n          \"Clear all items provided in 'https.pfx' configuration. Path to an SSL pfx file or content of an SSL pfx file. Deprecated, use the `server.options.pfx` option.\",\n        multiple: false,\n        path: \"https.pfx\",\n        type: \"reset\",\n      },\n    ],\n    description:\n      \"Clear all items provided in 'https.pfx' configuration. Path to an SSL pfx file or content of an SSL pfx file. Deprecated, use the `server.options.pfx` option.\",\n    multiple: false,\n    simpleType: \"boolean\",\n  },\n  \"https-request-cert\": {\n    configs: [\n      {\n        type: \"boolean\",\n        multiple: false,\n        description:\n          \"Request for an SSL certificate. Deprecated, use the `server.options.requestCert` option.\",\n        negatedDescription: \"Does not request for an SSL certificate.\",\n        path: \"https.requestCert\",\n      },\n    ],\n    description:\n      \"Request for an SSL certificate. Deprecated, use the `server.options.requestCert` option.\",\n    simpleType: \"boolean\",\n    multiple: false,\n  },\n  ipc: {\n    configs: [\n      {\n        type: \"string\",\n        multiple: false,\n        description: \"Listen to a unix socket.\",\n        path: \"ipc\",\n      },\n      {\n        type: \"enum\",\n        values: [true],\n        multiple: false,\n        description: \"Listen to a unix socket.\",\n        path: \"ipc\",\n      },\n    ],\n    description: \"Listen to a unix socket.\",\n    simpleType: \"string\",\n    multiple: false,\n  },\n  \"live-reload\": {\n    configs: [\n      {\n        type: \"boolean\",\n        multiple: false,\n        description:\n          \"Enables reload/refresh the page(s) when file changes are detected (enabled by default).\",\n        negatedDescription:\n          \"Disables reload/refresh the page(s) when file changes are detected (enabled by default).\",\n        path: \"liveReload\",\n      },\n    ],\n    description:\n      \"Enables reload/refresh the page(s) when file changes are detected (enabled by default).\",\n    simpleType: \"boolean\",\n    multiple: false,\n  },\n  \"magic-html\": {\n    configs: [\n      {\n        type: \"boolean\",\n        multiple: false,\n        description:\n          \"Tells dev-server whether to enable magic HTML routes (routes corresponding to your webpack output, for example '/main' for 'main.js').\",\n        negatedDescription:\n          \"Disables magic HTML routes (routes corresponding to your webpack output, for example '/main' for 'main.js').\",\n        path: \"magicHtml\",\n      },\n    ],\n    description:\n      \"Tells dev-server whether to enable magic HTML routes (routes corresponding to your webpack output, for example '/main' for 'main.js').\",\n    simpleType: \"boolean\",\n    multiple: false,\n  },\n  open: {\n    configs: [\n      {\n        type: \"string\",\n        multiple: true,\n        description:\n          \"Allows to configure dev server to open the browser(s) and page(s) after server had been started (set it to true to open your default browser).\",\n        path: \"open[]\",\n      },\n      {\n        type: \"boolean\",\n        multiple: false,\n        description:\n          \"Allows to configure dev server to open the browser(s) and page(s) after server had been started (set it to true to open your default browser).\",\n        negatedDescription: \"Does not open the default browser.\",\n        path: \"open\",\n      },\n    ],\n    description:\n      \"Allows to configure dev server to open the browser(s) and page(s) after server had been started (set it to true to open your default browser).\",\n    simpleType: \"string\",\n    multiple: true,\n  },\n  \"open-app\": {\n    configs: [\n      {\n        type: \"string\",\n        multiple: true,\n        description:\n          \"Open specified browser. Deprecated: please use '--open-app-name'.\",\n        path: \"open[].app\",\n      },\n    ],\n    description:\n      \"Open specified browser. Deprecated: please use '--open-app-name'.\",\n    simpleType: \"string\",\n    multiple: true,\n  },\n  \"open-app-name\": {\n    configs: [\n      {\n        type: \"string\",\n        multiple: true,\n        description: \"Open specified browser.\",\n        path: \"open[].app.name\",\n      },\n      {\n        type: \"string\",\n        multiple: true,\n        description: \"Open specified browser.\",\n        path: \"open.app.name[]\",\n      },\n    ],\n    description: \"Open specified browser.\",\n    simpleType: \"string\",\n    multiple: true,\n  },\n  \"open-app-name-reset\": {\n    configs: [\n      {\n        type: \"reset\",\n        multiple: false,\n        description:\n          \"Clear all items provided in 'open.app.name' configuration. Open specified browser.\",\n        path: \"open.app.name\",\n      },\n    ],\n    description:\n      \"Clear all items provided in 'open.app.name' configuration. Open specified browser.\",\n    simpleType: \"boolean\",\n    multiple: false,\n  },\n  \"open-reset\": {\n    configs: [\n      {\n        type: \"reset\",\n        multiple: false,\n        description:\n          \"Clear all items provided in 'open' configuration. Allows to configure dev server to open the browser(s) and page(s) after server had been started (set it to true to open your default browser).\",\n        path: \"open\",\n      },\n    ],\n    description:\n      \"Clear all items provided in 'open' configuration. Allows to configure dev server to open the browser(s) and page(s) after server had been started (set it to true to open your default browser).\",\n    simpleType: \"boolean\",\n    multiple: false,\n  },\n  \"open-target\": {\n    configs: [\n      {\n        type: \"string\",\n        multiple: true,\n        description: \"Opens specified page in browser.\",\n        path: \"open[].target\",\n      },\n      {\n        type: \"string\",\n        multiple: true,\n        description: \"Opens specified page in browser.\",\n        path: \"open.target[]\",\n      },\n    ],\n    description: \"Opens specified page in browser.\",\n    simpleType: \"string\",\n    multiple: true,\n  },\n  \"open-target-reset\": {\n    configs: [\n      {\n        type: \"reset\",\n        multiple: false,\n        description:\n          \"Clear all items provided in 'open.target' configuration. Opens specified page in browser.\",\n        path: \"open.target\",\n      },\n    ],\n    description:\n      \"Clear all items provided in 'open.target' configuration. Opens specified page in browser.\",\n    simpleType: \"boolean\",\n    multiple: false,\n  },\n  port: {\n    configs: [\n      {\n        type: \"number\",\n        multiple: false,\n        description: \"Allows to specify a port to use.\",\n        path: \"port\",\n      },\n      {\n        type: \"string\",\n        multiple: false,\n        description: \"Allows to specify a port to use.\",\n        path: \"port\",\n      },\n      {\n        type: \"enum\",\n        values: [\"auto\"],\n        multiple: false,\n        description: \"Allows to specify a port to use.\",\n        path: \"port\",\n      },\n    ],\n    description: \"Allows to specify a port to use.\",\n    simpleType: \"string\",\n    multiple: false,\n  },\n  \"server-options-ca\": {\n    configs: [\n      {\n        description:\n          \"Path to an SSL CA certificate or content of an SSL CA certificate.\",\n        multiple: true,\n        path: \"server.options.ca[]\",\n        type: \"string\",\n      },\n    ],\n    description:\n      \"Path to an SSL CA certificate or content of an SSL CA certificate.\",\n    multiple: true,\n    simpleType: \"string\",\n  },\n  \"server-options-ca-reset\": {\n    configs: [\n      {\n        description:\n          \"Clear all items provided in 'server.options.ca' configuration. Path to an SSL CA certificate or content of an SSL CA certificate.\",\n        multiple: false,\n        path: \"server.options.ca\",\n        type: \"reset\",\n      },\n    ],\n    description:\n      \"Clear all items provided in 'server.options.ca' configuration. Path to an SSL CA certificate or content of an SSL CA certificate.\",\n    multiple: false,\n    simpleType: \"boolean\",\n  },\n  \"server-options-cacert\": {\n    configs: [\n      {\n        description:\n          \"Path to an SSL CA certificate or content of an SSL CA certificate. Deprecated, use the `server.options.ca` option.\",\n        multiple: true,\n        path: \"server.options.cacert[]\",\n        type: \"string\",\n      },\n    ],\n    description:\n      \"Path to an SSL CA certificate or content of an SSL CA certificate. Deprecated, use the `server.options.ca` option.\",\n    multiple: true,\n    simpleType: \"string\",\n  },\n  \"server-options-cacert-reset\": {\n    configs: [\n      {\n        description:\n          \"Clear all items provided in 'server.options.cacert' configuration. Path to an SSL CA certificate or content of an SSL CA certificate. Deprecated, use the `server.options.ca` option.\",\n        multiple: false,\n        path: \"server.options.cacert\",\n        type: \"reset\",\n      },\n    ],\n    description:\n      \"Clear all items provided in 'server.options.cacert' configuration. Path to an SSL CA certificate or content of an SSL CA certificate. Deprecated, use the `server.options.ca` option.\",\n    multiple: false,\n    simpleType: \"boolean\",\n  },\n  \"server-options-cert\": {\n    configs: [\n      {\n        description:\n          \"Path to an SSL certificate or content of an SSL certificate.\",\n        multiple: true,\n        path: \"server.options.cert[]\",\n        type: \"string\",\n      },\n    ],\n    description: \"Path to an SSL certificate or content of an SSL certificate.\",\n    multiple: true,\n    simpleType: \"string\",\n  },\n  \"server-options-cert-reset\": {\n    configs: [\n      {\n        description:\n          \"Clear all items provided in 'server.options.cert' configuration. Path to an SSL certificate or content of an SSL certificate.\",\n        multiple: false,\n        path: \"server.options.cert\",\n        type: \"reset\",\n      },\n    ],\n    description:\n      \"Clear all items provided in 'server.options.cert' configuration. Path to an SSL certificate or content of an SSL certificate.\",\n    multiple: false,\n    simpleType: \"boolean\",\n  },\n  \"server-options-crl\": {\n    configs: [\n      {\n        description:\n          \"Path to PEM formatted CRLs (Certificate Revocation Lists) or content of PEM formatted CRLs (Certificate Revocation Lists).\",\n        multiple: true,\n        path: \"server.options.crl[]\",\n        type: \"string\",\n      },\n    ],\n    description:\n      \"Path to PEM formatted CRLs (Certificate Revocation Lists) or content of PEM formatted CRLs (Certificate Revocation Lists).\",\n    multiple: true,\n    simpleType: \"string\",\n  },\n  \"server-options-crl-reset\": {\n    configs: [\n      {\n        description:\n          \"Clear all items provided in 'server.options.crl' configuration. Path to PEM formatted CRLs (Certificate Revocation Lists) or content of PEM formatted CRLs (Certificate Revocation Lists).\",\n        multiple: false,\n        path: \"server.options.crl\",\n        type: \"reset\",\n      },\n    ],\n    description:\n      \"Clear all items provided in 'server.options.crl' configuration. Path to PEM formatted CRLs (Certificate Revocation Lists) or content of PEM formatted CRLs (Certificate Revocation Lists).\",\n    multiple: false,\n    simpleType: \"boolean\",\n  },\n  \"server-options-key\": {\n    configs: [\n      {\n        description: \"Path to an SSL key or content of an SSL key.\",\n        multiple: true,\n        path: \"server.options.key[]\",\n        type: \"string\",\n      },\n    ],\n    description: \"Path to an SSL key or content of an SSL key.\",\n    multiple: true,\n    simpleType: \"string\",\n  },\n  \"server-options-key-reset\": {\n    configs: [\n      {\n        description:\n          \"Clear all items provided in 'server.options.key' configuration. Path to an SSL key or content of an SSL key.\",\n        multiple: false,\n        path: \"server.options.key\",\n        type: \"reset\",\n      },\n    ],\n    description:\n      \"Clear all items provided in 'server.options.key' configuration. Path to an SSL key or content of an SSL key.\",\n    multiple: false,\n    simpleType: \"boolean\",\n  },\n  \"server-options-passphrase\": {\n    configs: [\n      {\n        description: \"Passphrase for a pfx file.\",\n        multiple: false,\n        path: \"server.options.passphrase\",\n        type: \"string\",\n      },\n    ],\n    description: \"Passphrase for a pfx file.\",\n    multiple: false,\n    simpleType: \"string\",\n  },\n  \"server-options-pfx\": {\n    configs: [\n      {\n        description: \"Path to an SSL pfx file or content of an SSL pfx file.\",\n        multiple: true,\n        path: \"server.options.pfx[]\",\n        type: \"string\",\n      },\n    ],\n    description: \"Path to an SSL pfx file or content of an SSL pfx file.\",\n    multiple: true,\n    simpleType: \"string\",\n  },\n  \"server-options-pfx-reset\": {\n    configs: [\n      {\n        description:\n          \"Clear all items provided in 'server.options.pfx' configuration. Path to an SSL pfx file or content of an SSL pfx file.\",\n        multiple: false,\n        path: \"server.options.pfx\",\n        type: \"reset\",\n      },\n    ],\n    description:\n      \"Clear all items provided in 'server.options.pfx' configuration. Path to an SSL pfx file or content of an SSL pfx file.\",\n    multiple: false,\n    simpleType: \"boolean\",\n  },\n  \"server-options-request-cert\": {\n    configs: [\n      {\n        description: \"Request for an SSL certificate.\",\n        negatedDescription: \"Does not request for an SSL certificate.\",\n        multiple: false,\n        path: \"server.options.requestCert\",\n        type: \"boolean\",\n      },\n    ],\n    description: \"Request for an SSL certificate.\",\n    multiple: false,\n    simpleType: \"boolean\",\n  },\n  \"server-type\": {\n    configs: [\n      {\n        description: \"Allows to set server and options (by default 'http').\",\n        multiple: false,\n        path: \"server.type\",\n        type: \"enum\",\n        values: [\"http\", \"https\", \"spdy\"],\n      },\n    ],\n    description: \"Allows to set server and options (by default 'http').\",\n    multiple: false,\n    simpleType: \"string\",\n  },\n  static: {\n    configs: [\n      {\n        type: \"string\",\n        multiple: true,\n        description:\n          \"Allows to configure options for serving static files from directory (by default 'public' directory).\",\n        path: \"static[]\",\n      },\n      {\n        type: \"boolean\",\n        multiple: false,\n        description:\n          \"Allows to configure options for serving static files from directory (by default 'public' directory).\",\n        negatedDescription:\n          \"Disallows to configure options for serving static files from directory.\",\n        path: \"static\",\n      },\n    ],\n    description:\n      \"Allows to configure options for serving static files from directory (by default 'public' directory).\",\n    simpleType: \"string\",\n    multiple: true,\n  },\n  \"static-directory\": {\n    configs: [\n      {\n        type: \"string\",\n        multiple: true,\n        description: \"Directory for static contents.\",\n        path: \"static[].directory\",\n      },\n    ],\n    description: \"Directory for static contents.\",\n    simpleType: \"string\",\n    multiple: true,\n  },\n  \"static-public-path\": {\n    configs: [\n      {\n        type: \"string\",\n        multiple: true,\n        description:\n          \"The static files will be available in the browser under this public path.\",\n        path: \"static[].publicPath\",\n      },\n      {\n        type: \"string\",\n        multiple: true,\n        description:\n          \"The static files will be available in the browser under this public path.\",\n        path: \"static.publicPath[]\",\n      },\n    ],\n    description:\n      \"The static files will be available in the browser under this public path.\",\n    simpleType: \"string\",\n    multiple: true,\n  },\n  \"static-public-path-reset\": {\n    configs: [\n      {\n        type: \"reset\",\n        multiple: false,\n        description:\n          \"Clear all items provided in 'static.publicPath' configuration. The static files will be available in the browser under this public path.\",\n        path: \"static.publicPath\",\n      },\n    ],\n    description:\n      \"Clear all items provided in 'static.publicPath' configuration. The static files will be available in the browser under this public path.\",\n    simpleType: \"boolean\",\n    multiple: false,\n  },\n  \"static-reset\": {\n    configs: [\n      {\n        type: \"reset\",\n        multiple: false,\n        description:\n          \"Clear all items provided in 'static' configuration. Allows to configure options for serving static files from directory (by default 'public' directory).\",\n        path: \"static\",\n      },\n    ],\n    description:\n      \"Clear all items provided in 'static' configuration. Allows to configure options for serving static files from directory (by default 'public' directory).\",\n    simpleType: \"boolean\",\n    multiple: false,\n  },\n  \"static-serve-index\": {\n    configs: [\n      {\n        type: \"boolean\",\n        multiple: true,\n        description:\n          \"Tells dev server to use serveIndex middleware when enabled.\",\n        negatedDescription:\n          \"Does not tell dev server to use serveIndex middleware.\",\n        path: \"static[].serveIndex\",\n      },\n    ],\n    description: \"Tells dev server to use serveIndex middleware when enabled.\",\n    simpleType: \"boolean\",\n    multiple: true,\n  },\n  \"static-watch\": {\n    configs: [\n      {\n        type: \"boolean\",\n        multiple: true,\n        description: \"Watches for files in static content directory.\",\n        negatedDescription:\n          \"Does not watch for files in static content directory.\",\n        path: \"static[].watch\",\n      },\n    ],\n    description: \"Watches for files in static content directory.\",\n    simpleType: \"boolean\",\n    multiple: true,\n  },\n  \"watch-files\": {\n    configs: [\n      {\n        type: \"string\",\n        multiple: true,\n        description:\n          \"Allows to configure list of globs/directories/files to watch for file changes.\",\n        path: \"watchFiles[]\",\n      },\n    ],\n    description:\n      \"Allows to configure list of globs/directories/files to watch for file changes.\",\n    simpleType: \"string\",\n    multiple: true,\n  },\n  \"watch-files-reset\": {\n    configs: [\n      {\n        type: \"reset\",\n        multiple: false,\n        description:\n          \"Clear all items provided in 'watchFiles' configuration. Allows to configure list of globs/directories/files to watch for file changes.\",\n        path: \"watchFiles\",\n      },\n    ],\n    description:\n      \"Clear all items provided in 'watchFiles' configuration. Allows to configure list of globs/directories/files to watch for file changes.\",\n    simpleType: \"boolean\",\n    multiple: false,\n  },\n  \"web-socket-server\": {\n    configs: [\n      {\n        description:\n          \"Deprecated: please use '--web-socket-server-type' option.\",\n        negatedDescription: \"Disallows to set web socket server and options.\",\n        multiple: false,\n        path: \"webSocketServer\",\n        type: \"enum\",\n        values: [false],\n      },\n      {\n        description:\n          \"Deprecated: please use '--web-socket-server-type' option.\",\n        multiple: false,\n        path: \"webSocketServer\",\n        type: \"enum\",\n        values: [\"sockjs\", \"ws\"],\n      },\n      {\n        description:\n          \"Allows to set web socket server and options (by default 'ws').\",\n        multiple: false,\n        path: \"webSocketServer\",\n        type: \"string\",\n      },\n    ],\n    description:\n      \"Deprecated: please use '--web-socket-server-type' option. Allows to set web socket server and options (by default 'ws').\",\n    simpleType: \"string\",\n    multiple: false,\n  },\n  \"web-socket-server-type\": {\n    configs: [\n      {\n        description:\n          \"Allows to set web socket server and options (by default 'ws').\",\n        multiple: false,\n        path: \"webSocketServer.type\",\n        type: \"enum\",\n        values: [\"sockjs\", \"ws\"],\n      },\n      {\n        description:\n          \"Allows to set web socket server and options (by default 'ws').\",\n        multiple: false,\n        path: \"webSocketServer.type\",\n        type: \"string\",\n      },\n    ],\n    description:\n      \"Allows to set web socket server and options (by default 'ws').\",\n    simpleType: \"string\",\n    multiple: false,\n  },\n};\n"
  },
  {
    "path": "bin/webpack-dev-server.js",
    "content": "#!/usr/bin/env node\n/* Based on webpack/bin/webpack.js */\n/* eslint-disable no-console */\n\n\"use strict\";\n\n/**\n * @param {string} command process to run\n * @param {string[]} args command line arguments\n * @returns {Promise<void>} promise\n */\nconst runCommand = (command, args) => {\n  const cp = require(\"node:child_process\");\n\n  return new Promise((resolve, reject) => {\n    const executedCommand = cp.spawn(command, args, {\n      stdio: \"inherit\",\n      shell: true,\n    });\n\n    executedCommand.on(\"error\", (error) => {\n      reject(error);\n    });\n\n    executedCommand.on(\"exit\", (code) => {\n      if (code === 0) {\n        resolve();\n      } else {\n        reject();\n      }\n    });\n  });\n};\n\n/**\n * @param {string} packageName name of the package\n * @returns {boolean} is the package installed?\n */\nconst isInstalled = (packageName) => {\n  if (process.versions.pnp) {\n    return true;\n  }\n\n  const path = require(\"node:path\");\n  const fs = require(\"graceful-fs\");\n\n  let dir = __dirname;\n\n  do {\n    try {\n      if (\n        fs.statSync(path.join(dir, \"node_modules\", packageName)).isDirectory()\n      ) {\n        return true;\n      }\n    } catch {\n      // Nothing\n    }\n  } while (dir !== (dir = path.dirname(dir)));\n\n  // https://github.com/nodejs/node/blob/v18.9.1/lib/internal/modules/cjs/loader.js#L1274\n  // @ts-expect-error\n  for (const internalPath of require(\"node:module\").globalPaths) {\n    try {\n      if (fs.statSync(path.join(internalPath, packageName)).isDirectory()) {\n        return true;\n      }\n    } catch {\n      // Nothing\n    }\n  }\n\n  return false;\n};\n\n/**\n * @param {CliOption} cli options\n * @returns {void}\n */\nconst runCli = (cli) => {\n  if (cli.preprocess) {\n    cli.preprocess();\n  }\n\n  const path = require(\"node:path\");\n\n  const pkgPath = require.resolve(`${cli.package}/package.json`);\n\n  const pkg = require(pkgPath);\n\n  if (pkg.type === \"module\" || /\\.mjs/i.test(pkg.bin[cli.binName])) {\n    import(path.resolve(path.dirname(pkgPath), pkg.bin[cli.binName])).catch(\n      (error) => {\n        console.error(error);\n        process.exitCode = 1;\n      },\n    );\n  } else {\n    require(path.resolve(path.dirname(pkgPath), pkg.bin[cli.binName]));\n  }\n};\n\n/**\n * @typedef {object} CliOption\n * @property {string} name display name\n * @property {string} package npm package name\n * @property {string} binName name of the executable file\n * @property {boolean} installed currently installed?\n * @property {string} url homepage\n * @property {() => void} preprocess preprocessor\n */\n\n/** @type {CliOption} */\nconst cli = {\n  name: \"webpack-cli\",\n  package: \"webpack-cli\",\n  binName: \"webpack-cli\",\n  installed: isInstalled(\"webpack-cli\"),\n  url: \"https://github.com/webpack/webpack-cli\",\n  preprocess() {\n    process.argv.splice(2, 0, \"serve\");\n  },\n};\n\nif (!cli.installed) {\n  const path = require(\"node:path\");\n  const fs = require(\"graceful-fs\");\n  const readLine = require(\"node:readline\");\n\n  const notify = `CLI for webpack must be installed.\\n  ${cli.name} (${cli.url})\\n`;\n\n  console.error(notify);\n\n  /**\n   * @type {string}\n   */\n  let packageManager;\n\n  if (fs.existsSync(path.resolve(process.cwd(), \"yarn.lock\"))) {\n    packageManager = \"yarn\";\n  } else if (fs.existsSync(path.resolve(process.cwd(), \"pnpm-lock.yaml\"))) {\n    packageManager = \"pnpm\";\n  } else {\n    packageManager = \"npm\";\n  }\n\n  const installOptions = [packageManager === \"yarn\" ? \"add\" : \"install\", \"-D\"];\n\n  console.error(\n    `We will use \"${packageManager}\" to install the CLI via \"${packageManager} ${installOptions.join(\n      \" \",\n    )} ${cli.package}\".`,\n  );\n\n  const question = \"Do you want to install 'webpack-cli' (yes/no): \";\n\n  const questionInterface = readLine.createInterface({\n    input: process.stdin,\n    output: process.stderr,\n  });\n\n  // In certain scenarios (e.g. when STDIN is not in terminal mode), the callback function will not be\n  // executed. Setting the exit code here to ensure the script exits correctly in those cases. The callback\n  // function is responsible for clearing the exit code if the user wishes to install webpack-cli.\n  process.exitCode = 1;\n  questionInterface.question(question, (answer) => {\n    questionInterface.close();\n\n    const normalizedAnswer = answer.toLowerCase().startsWith(\"y\");\n\n    if (!normalizedAnswer) {\n      console.error(\n        \"You need to install 'webpack-cli' to use webpack via CLI.\\n\" +\n          \"You can also install the CLI manually.\",\n      );\n\n      return;\n    }\n    process.exitCode = 0;\n\n    console.log(\n      `Installing '${\n        cli.package\n      }' (running '${packageManager} ${installOptions.join(\" \")} ${\n        cli.package\n      }')...`,\n    );\n\n    runCommand(packageManager, [...installOptions, cli.package])\n      .then(() => {\n        runCli(cli);\n      })\n      .catch((error) => {\n        console.error(error);\n        process.exitCode = 1;\n      });\n  });\n} else {\n  runCli(cli);\n}\n"
  },
  {
    "path": "client-src/clients/SockJSClient.js",
    "content": "import SockJS from \"../modules/sockjs-client/index.js\";\nimport { log } from \"../utils/log.js\";\n\n/** @typedef {import(\"../index\").EXPECTED_ANY} EXPECTED_ANY */\n\n/**\n * @implements {CommunicationClient}\n */\nexport default class SockJSClient {\n  /**\n   * @param {string} url url\n   */\n  constructor(url) {\n    // SockJS requires `http` and `https` protocols\n    this.sock = new SockJS(\n      url.replace(/^ws:/i, \"http:\").replace(/^wss:/i, \"https:\"),\n    );\n    this.sock.onerror = (error) => {\n      log.error(error);\n    };\n  }\n\n  /**\n   * @param {(...args: EXPECTED_ANY[]) => void} fn function\n   */\n  onOpen(fn) {\n    this.sock.onopen = fn;\n  }\n\n  /**\n   * @param {(...args: EXPECTED_ANY[]) => void} fn function\n   */\n  onClose(fn) {\n    this.sock.onclose = fn;\n  }\n\n  // call f with the message string as the first argument\n  /**\n   * @param {(...args: EXPECTED_ANY[]) => void} fn function\n   */\n  onMessage(fn) {\n    this.sock.onmessage = (err) => {\n      fn(err.data);\n    };\n  }\n}\n"
  },
  {
    "path": "client-src/clients/WebSocketClient.js",
    "content": "import { log } from \"../utils/log.js\";\n\n/** @typedef {import(\"../index\").EXPECTED_ANY} EXPECTED_ANY */\n\n/**\n * @implements {CommunicationClient}\n */\nexport default class WebSocketClient {\n  /**\n   * @param {string} url url to connect\n   */\n  constructor(url) {\n    this.client = new WebSocket(url);\n    this.client.onerror = (error) => {\n      log.error(error);\n    };\n  }\n\n  /**\n   * @param {(...args: EXPECTED_ANY[]) => void} fn function\n   */\n  onOpen(fn) {\n    this.client.onopen = fn;\n  }\n\n  /**\n   * @param {(...args: EXPECTED_ANY[]) => void} fn function\n   */\n  onClose(fn) {\n    this.client.onclose = fn;\n  }\n\n  // call f with the message string as the first argument\n  /**\n   * @param {(...args: EXPECTED_ANY[]) => void} fn function\n   */\n  onMessage(fn) {\n    this.client.onmessage = (err) => {\n      fn(err.data);\n    };\n  }\n}\n"
  },
  {
    "path": "client-src/globals.d.ts",
    "content": "declare interface CommunicationClient {\n  onOpen(fn: (...args: any[]) => void): void;\n  onClose(fn: (...args: any[]) => void): void;\n  onMessage(fn: (...args: any[]) => void): void;\n}\n\ndeclare interface CommunicationClientConstructor {\n  new (url: string): CommunicationClient; // Defines a constructor that takes a string and returns a GreeterInstance\n}\n\ndeclare const __webpack_dev_server_client__:\n  | CommunicationClientConstructor\n  | { default: CommunicationClientConstructor }\n  | undefined;\n\ndeclare module \"ansi-html-community\" {\n  function ansiHtmlCommunity(str: string): string;\n\n  namespace ansiHtmlCommunity {\n    function setColors(colors: Record<string, string | string[]>): void;\n  }\n\n  export = ansiHtmlCommunity;\n}\n"
  },
  {
    "path": "client-src/index.js",
    "content": "/* global __resourceQuery, __webpack_hash__ */\n// @ts-expect-error\nimport hotEmitter from \"webpack/hot/emitter.js\";\n// @ts-expect-error\nimport webpackHotLog from \"webpack/hot/log.js\";\nimport { createOverlay, formatProblem } from \"./overlay.js\";\nimport { defineProgressElement, isProgressSupported } from \"./progress.js\";\nimport socket from \"./socket.js\";\nimport { log, setLogLevel } from \"./utils/log.js\";\nimport sendMessage from \"./utils/sendMessage.js\";\n\n// eslint-disable-next-line jsdoc/no-restricted-syntax\n/** @typedef {any} EXPECTED_ANY */\n\n/**\n * @typedef {object} RawOverlayOptions\n * @property {string=} warnings warnings\n * @property {string=} errors errors\n * @property {string=} runtimeErrors runtime errors\n * @property {string=} trustedTypesPolicyName trusted types policy name\n */\n\n/**\n * @typedef {object} OverlayOptions\n * @property {(boolean | ((error: Error) => boolean))=} warnings warnings\n * @property {(boolean | ((error: Error) => boolean))=} errors errors\n * @property {(boolean | ((error: Error) => boolean))=} runtimeErrors runtime errors\n * @property {string=} trustedTypesPolicyName trusted types policy name\n */\n\n/** @typedef {false | true | \"none\" | \"error\" | \"warn\" | \"info\" | \"log\" | \"verbose\"} LogLevel */\n\n/**\n * @typedef {object} Options\n * @property {boolean} hot true when hot enabled, otherwise false\n * @property {boolean} liveReload true when live reload enabled, otherwise false\n * @property {boolean} progress true when need to show progress, otherwise false\n * @property {boolean | OverlayOptions} overlay overlay options\n * @property {LogLevel=} logging logging level\n * @property {number=} reconnect count of allowed reconnection\n */\n\n/**\n * @typedef {object} Status\n * @property {boolean} isUnloading true when unloaded, otherwise false\n * @property {string} currentHash current hash\n * @property {string=} previousHash previous hash\n */\n\n/**\n * @param {boolean | RawOverlayOptions | OverlayOptions} overlayOptions overlay options\n */\nconst decodeOverlayOptions = (overlayOptions) => {\n  if (typeof overlayOptions === \"object\") {\n    const requiredOptions = [\"warnings\", \"errors\", \"runtimeErrors\"];\n\n    for (let i = 0; i < requiredOptions.length; i++) {\n      const property =\n        /** @type {keyof Omit<RawOverlayOptions, \"trustedTypesPolicyName\">} */\n        (requiredOptions[i]);\n\n      if (typeof overlayOptions[property] === \"string\") {\n        const overlayFilterFunctionString = decodeURIComponent(\n          overlayOptions[property],\n        );\n\n        /** @type {OverlayOptions} */\n        (overlayOptions)[property] = /** @type {(error: Error) => boolean} */ (\n          // eslint-disable-next-line no-new-func\n          new Function(\n            \"message\",\n            `var callback = ${overlayFilterFunctionString}\n        return callback(message)`,\n          )\n        );\n      }\n    }\n  }\n};\n\n/**\n * @type {Status}\n */\nconst status = {\n  isUnloading: false,\n  currentHash: __webpack_hash__,\n};\n\n/**\n * @returns {string} current script source\n */\nconst getCurrentScriptSource = () => {\n  // `document.currentScript` is the most accurate way to find the current script,\n  // but is not supported in all browsers.\n  if (document.currentScript) {\n    return /** @type {string} */ (document.currentScript.getAttribute(\"src\"));\n  }\n\n  // Fallback to getting all scripts running in the document.\n  const scriptElements = document.scripts || [];\n  const scriptElementsWithSrc = Array.prototype.filter.call(\n    scriptElements,\n    (element) => element.getAttribute(\"src\"),\n  );\n\n  if (scriptElementsWithSrc.length > 0) {\n    const currentScript =\n      scriptElementsWithSrc[scriptElementsWithSrc.length - 1];\n\n    return currentScript.getAttribute(\"src\");\n  }\n\n  // Fail as there was no script to use.\n  throw new Error(\"[webpack-dev-server] Failed to get current script source.\");\n};\n\n/** @typedef {{ hot?: string, [\"live-reload\"]?: string, progress?: string, reconnect?: string, logging?: LogLevel, overlay?: string, fromCurrentScript?: boolean }} AdditionalParsedURL */\n/** @typedef {Partial<URL> & AdditionalParsedURL} ParsedURL */\n\n/**\n * @param {string} resourceQuery resource query\n * @returns {ParsedURL} parsed URL\n */\nconst parseURL = (resourceQuery) => {\n  /** @type {ParsedURL} */\n  let result = {};\n\n  if (typeof resourceQuery === \"string\" && resourceQuery !== \"\") {\n    const searchParams = resourceQuery.slice(1).split(\"&\");\n\n    for (let i = 0; i < searchParams.length; i++) {\n      const pair = searchParams[i].split(\"=\");\n\n      /** @type {EXPECTED_ANY} */\n      (result)[pair[0]] = decodeURIComponent(pair[1]);\n    }\n  } else {\n    // Else, get the url from the <script> this file was called with.\n    const scriptSource = getCurrentScriptSource();\n\n    let scriptSourceURL;\n\n    try {\n      // The placeholder `baseURL` with `window.location.href`,\n      // is to allow parsing of path-relative or protocol-relative URLs,\n      // and will have no effect if `scriptSource` is a fully valid URL.\n      scriptSourceURL = new URL(scriptSource, self.location.href);\n    } catch (_err) {\n      // URL parsing failed, do nothing.\n      // We will still proceed to see if we can recover using `resourceQuery`\n    }\n\n    if (scriptSourceURL) {\n      result = scriptSourceURL;\n      result.fromCurrentScript = true;\n    }\n  }\n\n  return result;\n};\n\nconst parsedResourceQuery = parseURL(__resourceQuery);\n\n/** @typedef {{ [\"Hot Module Replacement\"]: boolean, [\"Live Reloading\"]: boolean, Progress: boolean, Overlay: boolean }} Features */\n\n/** @type {Features} */\nconst enabledFeatures = {\n  \"Hot Module Replacement\": false,\n  \"Live Reloading\": false,\n  Progress: false,\n  Overlay: false,\n};\n\n/** @type {Options} */\nconst options = {\n  hot: false,\n  liveReload: false,\n  progress: false,\n  overlay: false,\n};\n\nif (parsedResourceQuery.hot === \"true\") {\n  options.hot = true;\n  enabledFeatures[\"Hot Module Replacement\"] = true;\n}\n\nif (parsedResourceQuery[\"live-reload\"] === \"true\") {\n  options.liveReload = true;\n  enabledFeatures[\"Live Reloading\"] = true;\n}\n\nif (parsedResourceQuery.progress === \"true\") {\n  options.progress = true;\n  enabledFeatures.Progress = true;\n}\n\nif (parsedResourceQuery.overlay) {\n  try {\n    options.overlay = JSON.parse(parsedResourceQuery.overlay);\n  } catch (err) {\n    log.error(\"Error parsing overlay options from resource query:\", err);\n  }\n\n  // Fill in default \"true\" params for partially-specified objects.\n  if (typeof options.overlay === \"object\") {\n    options.overlay = {\n      errors: true,\n      warnings: true,\n      runtimeErrors: true,\n      ...options.overlay,\n    };\n\n    decodeOverlayOptions(options.overlay);\n  }\n  enabledFeatures.Overlay = options.overlay !== false;\n}\n\nif (parsedResourceQuery.logging) {\n  options.logging = parsedResourceQuery.logging;\n}\n\nif (typeof parsedResourceQuery.reconnect !== \"undefined\") {\n  options.reconnect = Number(parsedResourceQuery.reconnect);\n}\n\n/**\n * @param {false | true | \"none\" | \"error\" | \"warn\" | \"info\" | \"log\" | \"verbose\"} level level\n */\nconst setAllLogLevel = (level) => {\n  // This is needed because the HMR logger operate separately from dev server logger\n  webpackHotLog.setLogLevel(\n    level === \"verbose\" || level === \"log\" ? \"info\" : level,\n  );\n  setLogLevel(level);\n};\n\nif (options.logging) {\n  setAllLogLevel(options.logging);\n}\n\n/**\n * @param {Features} features features\n */\nconst logEnabledFeatures = (features) => {\n  const listEnabledFeatures = Object.keys(features);\n  if (!features || listEnabledFeatures.length === 0) {\n    return;\n  }\n\n  let logString = \"Server started:\";\n\n  // Server started: Hot Module Replacement enabled, Live Reloading enabled, Overlay disabled.\n  for (let i = 0; i < listEnabledFeatures.length; i++) {\n    const key = /** @type {keyof Features} */ (listEnabledFeatures[i]);\n    logString += ` ${key} ${features[key] ? \"enabled\" : \"disabled\"},`;\n  }\n  // replace last comma with a period\n  logString = logString.slice(0, -1).concat(\".\");\n\n  log.info(logString);\n};\n\nlogEnabledFeatures(enabledFeatures);\n\nself.addEventListener(\"beforeunload\", () => {\n  status.isUnloading = true;\n});\n\nconst overlay =\n  typeof window !== \"undefined\"\n    ? createOverlay(\n        typeof options.overlay === \"object\"\n          ? {\n              trustedTypesPolicyName: options.overlay.trustedTypesPolicyName,\n              catchRuntimeError: options.overlay.runtimeErrors,\n            }\n          : {\n              trustedTypesPolicyName: false,\n              catchRuntimeError: options.overlay,\n            },\n      )\n    : { send: () => {} };\n\n/**\n * @param {Options} options options\n * @param {Status} currentStatus current status\n */\nconst reloadApp = ({ hot, liveReload }, currentStatus) => {\n  if (currentStatus.isUnloading) {\n    return;\n  }\n\n  const { currentHash, previousHash } = currentStatus;\n  const isInitial =\n    currentHash.indexOf(/** @type {string} */ (previousHash)) >= 0;\n\n  if (isInitial) {\n    return;\n  }\n\n  /**\n   * @param {Window} rootWindow root window\n   * @param {number} intervalId interval id\n   */\n  function applyReload(rootWindow, intervalId) {\n    clearInterval(intervalId);\n\n    log.info(\"App updated. Reloading...\");\n\n    rootWindow.location.reload();\n  }\n\n  const search = self.location.search.toLowerCase();\n  const allowToHot = search.indexOf(\"webpack-dev-server-hot=false\") === -1;\n  const allowToLiveReload =\n    search.indexOf(\"webpack-dev-server-live-reload=false\") === -1;\n\n  if (hot && allowToHot) {\n    log.info(\"App hot update...\");\n\n    if (\n      typeof EventTarget !== \"undefined\" &&\n      hotEmitter instanceof EventTarget\n    ) {\n      const event = new CustomEvent(\"webpackHotUpdate\", {\n        detail: {\n          currentHash: currentStatus.currentHash,\n        },\n        bubbles: true,\n        cancelable: false,\n      });\n\n      hotEmitter.dispatchEvent(event);\n    } else {\n      hotEmitter.emit(\"webpackHotUpdate\", currentStatus.currentHash);\n    }\n\n    if (typeof self !== \"undefined\" && self.window) {\n      // broadcast update to window\n      self.postMessage(`webpackHotUpdate${currentStatus.currentHash}`, \"*\");\n    }\n  }\n  // allow refreshing the page only if liveReload isn't disabled\n  else if (liveReload && allowToLiveReload) {\n    /** @type {Window} */\n    let rootWindow = self;\n\n    // use parent window for reload (in case we're in an iframe with no valid src)\n    const intervalId = self.setInterval(() => {\n      if (rootWindow.location.protocol !== \"about:\") {\n        // reload immediately if protocol is valid\n        applyReload(rootWindow, intervalId);\n      } else {\n        rootWindow = rootWindow.parent;\n\n        if (rootWindow.parent === rootWindow) {\n          // if parent equals current window we've reached the root which would continue forever, so trigger a reload anyways\n          applyReload(rootWindow, intervalId);\n        }\n      }\n    });\n  }\n};\n\nconst ansiRegex = new RegExp(\n  [\n    \"[\\\\u001B\\\\u009B][[\\\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\\\d\\\\/#&.:=?%@~_]+)*|[a-zA-Z\\\\d]+(?:;[-a-zA-Z\\\\d\\\\/#&.:=?%@~_]*)*)?\\\\u0007)\",\n    \"(?:(?:\\\\d{1,4}(?:;\\\\d{0,4})*)?[\\\\dA-PR-TZcf-nq-uy=><~]))\",\n  ].join(\"|\"),\n  \"g\",\n);\n\n/**\n * Strip [ANSI escape codes](https://en.wikipedia.org/wiki/ANSI_escape_code) from a string.\n * Adapted from code originally released by Sindre Sorhus\n * Licensed the MIT License\n * @param {string} string string\n * @returns {string} string without ansi\n */\nconst stripAnsi = (string) => {\n  if (typeof string !== \"string\") {\n    throw new TypeError(`Expected a \\`string\\`, got \\`${typeof string}\\``);\n  }\n\n  return string.replace(ansiRegex, \"\");\n};\n\nconst onSocketMessage = {\n  hot() {\n    if (parsedResourceQuery.hot === \"false\") {\n      return;\n    }\n\n    options.hot = true;\n  },\n  liveReload() {\n    if (parsedResourceQuery[\"live-reload\"] === \"false\") {\n      return;\n    }\n\n    options.liveReload = true;\n  },\n  invalid() {\n    log.info(\"App updated. Recompiling...\");\n\n    // Fixes #1042. overlay doesn't clear if errors are fixed but warnings remain.\n    if (options.overlay) {\n      overlay.send({ type: \"DISMISS\" });\n    }\n\n    sendMessage(\"Invalid\");\n  },\n  /**\n   * @param {string} hash hash\n   */\n  hash(hash) {\n    status.previousHash = status.currentHash;\n    status.currentHash = hash;\n  },\n  logging: setAllLogLevel,\n  /**\n   * @param {boolean} value overlay value\n   */\n  overlay(value) {\n    if (typeof document === \"undefined\") {\n      return;\n    }\n\n    options.overlay = value;\n    decodeOverlayOptions(options.overlay);\n  },\n  /**\n   * @param {number} value reconnect value\n   */\n  reconnect(value) {\n    if (parsedResourceQuery.reconnect === \"false\") {\n      return;\n    }\n\n    options.reconnect = value;\n  },\n  /**\n   * @param {boolean} value progress value\n   */\n  progress(value) {\n    options.progress = value;\n  },\n  /**\n   * @param {{ pluginName?: string, percent: string, msg: string }} data date with progress\n   */\n  \"progress-update\": function progressUpdate(data) {\n    if (options.progress) {\n      log.info(\n        `${data.pluginName ? `[${data.pluginName}] ` : \"\"}${data.percent}% - ${\n          data.msg\n        }.`,\n      );\n    }\n\n    if (isProgressSupported() && typeof options.progress === \"string\") {\n      let progress = document.querySelector(\"wds-progress\");\n      if (!progress) {\n        defineProgressElement();\n        progress = document.createElement(\"wds-progress\");\n        document.body.appendChild(progress);\n      }\n      progress.setAttribute(\"progress\", data.percent);\n      progress.setAttribute(\"type\", options.progress);\n    }\n\n    sendMessage(\"Progress\", data);\n  },\n  \"still-ok\": function stillOk() {\n    log.info(\"Nothing changed.\");\n\n    if (options.overlay) {\n      overlay.send({ type: \"DISMISS\" });\n    }\n\n    sendMessage(\"StillOk\");\n  },\n  ok() {\n    sendMessage(\"Ok\");\n\n    if (options.overlay) {\n      overlay.send({ type: \"DISMISS\" });\n    }\n\n    reloadApp(options, status);\n  },\n  /**\n   * @param {string} file changed file\n   */\n  \"static-changed\": function staticChanged(file) {\n    log.info(\n      `${\n        file ? `\"${file}\"` : \"Content\"\n      } from static directory was changed. Reloading...`,\n    );\n\n    self.location.reload();\n  },\n  /**\n   * @param {Error[]} warnings warnings\n   * @param {{ preventReloading: boolean }=} params extra params\n   */\n  warnings(warnings, params) {\n    log.warn(\"Warnings while compiling.\");\n\n    const printableWarnings = warnings.map((error) => {\n      const { header, body } = formatProblem(\"warning\", error);\n\n      return `${header}\\n${stripAnsi(body)}`;\n    });\n\n    sendMessage(\"Warnings\", printableWarnings);\n\n    for (let i = 0; i < printableWarnings.length; i++) {\n      log.warn(printableWarnings[i]);\n    }\n\n    const overlayWarningsSetting =\n      typeof options.overlay === \"boolean\"\n        ? options.overlay\n        : options.overlay && options.overlay.warnings;\n\n    if (overlayWarningsSetting) {\n      const warningsToDisplay =\n        typeof overlayWarningsSetting === \"function\"\n          ? warnings.filter(overlayWarningsSetting)\n          : warnings;\n\n      if (warningsToDisplay.length) {\n        overlay.send({\n          type: \"BUILD_ERROR\",\n          level: \"warning\",\n          messages: warnings,\n        });\n      }\n    }\n\n    if (params && params.preventReloading) {\n      return;\n    }\n\n    reloadApp(options, status);\n  },\n  /**\n   * @param {Error[]} errors errors\n   */\n  errors(errors) {\n    log.error(\"Errors while compiling. Reload prevented.\");\n\n    const printableErrors = errors.map((error) => {\n      const { header, body } = formatProblem(\"error\", error);\n\n      return `${header}\\n${stripAnsi(body)}`;\n    });\n\n    sendMessage(\"Errors\", printableErrors);\n\n    for (let i = 0; i < printableErrors.length; i++) {\n      log.error(printableErrors[i]);\n    }\n\n    const overlayErrorsSettings =\n      typeof options.overlay === \"boolean\"\n        ? options.overlay\n        : options.overlay && options.overlay.errors;\n\n    if (overlayErrorsSettings) {\n      const errorsToDisplay =\n        typeof overlayErrorsSettings === \"function\"\n          ? errors.filter(overlayErrorsSettings)\n          : errors;\n\n      if (errorsToDisplay.length) {\n        overlay.send({\n          type: \"BUILD_ERROR\",\n          level: \"error\",\n          messages: errors,\n        });\n      }\n    }\n  },\n  /**\n   * @param {Error} error error\n   */\n  error(error) {\n    log.error(error);\n  },\n  close() {\n    log.info(\"Disconnected!\");\n\n    if (options.overlay) {\n      overlay.send({ type: \"DISMISS\" });\n    }\n\n    sendMessage(\"Close\");\n  },\n};\n\n/**\n * @param {{ protocol?: string, auth?: string, hostname?: string, port?: string, pathname?: string, search?: string, hash?: string, slashes?: boolean }} objURL object URL\n * @returns {string} formatted url\n */\nconst formatURL = (objURL) => {\n  let protocol = objURL.protocol || \"\";\n\n  if (protocol && protocol.slice(-1) !== \":\") {\n    protocol += \":\";\n  }\n\n  let auth = objURL.auth || \"\";\n\n  if (auth) {\n    auth = encodeURIComponent(auth);\n    auth = auth.replace(/%3A/i, \":\");\n    auth += \"@\";\n  }\n\n  let host = \"\";\n\n  if (objURL.hostname) {\n    host =\n      auth +\n      (objURL.hostname.indexOf(\":\") === -1\n        ? objURL.hostname\n        : `[${objURL.hostname}]`);\n\n    if (objURL.port) {\n      host += `:${objURL.port}`;\n    }\n  }\n\n  let pathname = objURL.pathname || \"\";\n\n  if (objURL.slashes) {\n    host = `//${host || \"\"}`;\n\n    if (pathname && pathname.charAt(0) !== \"/\") {\n      pathname = `/${pathname}`;\n    }\n  } else if (!host) {\n    host = \"\";\n  }\n\n  let search = objURL.search || \"\";\n\n  if (search && search.charAt(0) !== \"?\") {\n    search = `?${search}`;\n  }\n\n  let hash = objURL.hash || \"\";\n\n  if (hash && hash.charAt(0) !== \"#\") {\n    hash = `#${hash}`;\n  }\n\n  pathname = pathname.replace(\n    /[?#]/g,\n    /**\n     * @param {string} match matched string\n     * @returns {string} encoded URI component\n     */\n    (match) => encodeURIComponent(match),\n  );\n  search = search.replace(\"#\", \"%23\");\n\n  return `${protocol}${host}${pathname}${search}${hash}`;\n};\n\n/**\n * @param {ParsedURL} parsedURL parsed URL\n * @returns {string} socket URL\n */\nconst createSocketURL = (parsedURL) => {\n  let { hostname } = parsedURL;\n\n  // Node.js module parses it as `::`\n  // `new URL(urlString, [baseURLString])` parses it as '[::]'\n  const isInAddrAny =\n    hostname === \"0.0.0.0\" || hostname === \"::\" || hostname === \"[::]\";\n\n  // why do we need this check?\n  // hostname n/a for file protocol (example, when using electron, ionic)\n  // see: https://github.com/webpack/webpack-dev-server/pull/384\n  if (\n    isInAddrAny &&\n    self.location.hostname &&\n    self.location.protocol.indexOf(\"http\") === 0\n  ) {\n    hostname = self.location.hostname;\n  }\n\n  let socketURLProtocol = parsedURL.protocol || self.location.protocol;\n\n  // When https is used in the app, secure web sockets are always necessary because the browser doesn't accept non-secure web sockets.\n  if (\n    socketURLProtocol === \"auto:\" ||\n    (hostname && isInAddrAny && self.location.protocol === \"https:\")\n  ) {\n    socketURLProtocol = self.location.protocol;\n  }\n\n  socketURLProtocol = socketURLProtocol.replace(\n    /^(?:http|.+-extension|file)/i,\n    \"ws\",\n  );\n\n  let socketURLAuth = \"\";\n\n  // `new URL(urlString, [baseURLstring])` doesn't have `auth` property\n  // Parse authentication credentials in case we need them\n  if (parsedURL.username) {\n    socketURLAuth = parsedURL.username;\n\n    // Since HTTP basic authentication does not allow empty username,\n    // we only include password if the username is not empty.\n    if (parsedURL.password) {\n      // Result: <username>:<password>\n      socketURLAuth = socketURLAuth.concat(\":\", parsedURL.password);\n    }\n  }\n\n  // In case the host is a raw IPv6 address, it can be enclosed in\n  // the brackets as the brackets are needed in the final URL string.\n  // Need to remove those as url.format blindly adds its own set of brackets\n  // if the host string contains colons. That would lead to non-working\n  // double brackets (e.g. [[::]]) host\n  //\n  // All of these web socket url params are optionally passed in through resourceQuery,\n  // so we need to fall back to the default if they are not provided\n  const socketURLHostname = (\n    hostname ||\n    self.location.hostname ||\n    \"localhost\"\n  ).replace(/^\\[(.*)\\]$/, \"$1\");\n\n  let socketURLPort = parsedURL.port;\n\n  if (!socketURLPort || socketURLPort === \"0\") {\n    socketURLPort = self.location.port;\n  }\n\n  // If path is provided it'll be passed in via the resourceQuery as a\n  // query param so it has to be parsed out of the querystring in order for the\n  // client to open the socket to the correct location.\n  let socketURLPathname = \"/ws\";\n\n  if (parsedURL.pathname && !parsedURL.fromCurrentScript) {\n    socketURLPathname = parsedURL.pathname;\n  }\n\n  return formatURL({\n    protocol: socketURLProtocol,\n    auth: socketURLAuth,\n    hostname: socketURLHostname,\n    port: socketURLPort,\n    pathname: socketURLPathname,\n    slashes: true,\n  });\n};\n\nconst socketURL = createSocketURL(parsedResourceQuery);\n\nsocket(socketURL, onSocketMessage, options.reconnect);\n\nexport { createSocketURL, getCurrentScriptSource, parseURL };\n"
  },
  {
    "path": "client-src/modules/logger/index.js",
    "content": "// @ts-expect-error\nexport { default } from \"webpack/lib/logging/runtime.js\";\n"
  },
  {
    "path": "client-src/modules/logger/tapable.js",
    "content": "/**\n * @returns {SyncBailHook} mocked sync bail hook\n * @constructor\n */\nfunction SyncBailHook() {\n  return {\n    call() {},\n  };\n}\n\n/**\n * Client stub for tapable SyncBailHook\n */\nexport { SyncBailHook };\n"
  },
  {
    "path": "client-src/modules/sockjs-client/index.js",
    "content": "export { default } from \"sockjs-client\";\n"
  },
  {
    "path": "client-src/overlay.js",
    "content": "// The error overlay is inspired (and mostly copied) from Create React App (https://github.com/facebookincubator/create-react-app)\n// They, in turn, got inspired by webpack-hot-middleware (https://github.com/glenjamin/webpack-hot-middleware).\n\nimport ansiHTML from \"ansi-html-community\";\n\n/** @typedef {import(\"./index\").EXPECTED_ANY} EXPECTED_ANY */\n\n/**\n * @type {(input: string, position: number) => number | undefined}\n */\n// @ts-expect-error\nconst getCodePoint = String.prototype.codePointAt\n  ? // @ts-expect-error\n    (input, position) => input.codePointAt(position)\n  : (input, position) =>\n      (input.charCodeAt(position) - 0xd800) * 0x400 +\n      input.charCodeAt(position + 1) -\n      0xdc00 +\n      0x10000;\n\n/**\n * @param {string} macroText macro text\n * @param {RegExp} macroRegExp macro reg exp\n * @param {(input: string) => string} macroReplacer macro replacer\n * @returns {string} result\n */\nconst replaceUsingRegExp = (macroText, macroRegExp, macroReplacer) => {\n  macroRegExp.lastIndex = 0;\n  let replaceMatch = macroRegExp.exec(macroText);\n  let replaceResult;\n  if (replaceMatch) {\n    replaceResult = \"\";\n    let replaceLastIndex = 0;\n    do {\n      if (replaceLastIndex !== replaceMatch.index) {\n        replaceResult += macroText.slice(replaceLastIndex, replaceMatch.index);\n      }\n      const replaceInput = replaceMatch[0];\n      replaceResult += macroReplacer(replaceInput);\n      replaceLastIndex = replaceMatch.index + replaceInput.length;\n    } while ((replaceMatch = macroRegExp.exec(macroText)));\n\n    if (replaceLastIndex !== macroText.length) {\n      replaceResult += macroText.slice(replaceLastIndex);\n    }\n  } else {\n    replaceResult = macroText;\n  }\n  return replaceResult;\n};\n\nconst references = {\n  \"<\": \"&lt;\",\n  \">\": \"&gt;\",\n  '\"': \"&quot;\",\n  \"'\": \"&apos;\",\n  \"&\": \"&amp;\",\n};\n\n/**\n * @param {string} text text\n * @returns {string} encoded text\n */\nfunction encode(text) {\n  if (!text) {\n    return \"\";\n  }\n\n  return replaceUsingRegExp(text, /[<>'\"&]/g, (input) => {\n    let result = references[/** @type {keyof typeof references} */ (input)];\n    if (!result) {\n      const code =\n        input.length > 1 ? getCodePoint(input, 0) : input.charCodeAt(0);\n      result = `&#${code};`;\n    }\n    return result;\n  });\n}\n\n/**\n * @typedef {object} Context\n * @property {'warning' | 'error'} level level\n * @property {(string  | Message)[]} messages messages\n * @property {'build' | 'runtime'} messageSource message source\n */\n\n/** @typedef {{ type: string } & Record<string, EXPECTED_ANY>} Event */\n\n/**\n * @typedef {object} Options\n * @property {{ [state: string]: { on: Record<string, { target: string; actions?: Array<string> }> } }} states states\n * @property {Context} context context\n * @property {string} initial initial\n */\n\n/**\n * @typedef {object} Implementation\n * @property {{ [actionName: string]: (ctx: Context, event: Event) => Context | void }} actions actions\n */\n\n/**\n * @typedef {{ send: (event: Event) => void }} StateMachine\n */\n\n/**\n * A simplified `createMachine` from `@xstate/fsm` with the following differences:\n * - the returned machine is technically a \"service\". No `interpret(machine).start()` is needed.\n * - the state definition only support `on` and target must be declared with { target: 'nextState', actions: [] } explicitly.\n * - event passed to `send` must be an object with `type` property.\n * - actions implementation will be [assign action](https://xstate.js.org/docs/guides/context.html#assign-action) if you return any value.\n * Do not return anything if you just want to invoke side effect.\n *\n * The goal of this custom function is to avoid installing the entire `'xstate/fsm'` package, while enabling modeling using\n * state machine. You can copy the first parameter into the editor at https://stately.ai/viz to visualize the state machine.\n * @param {Options} options options\n * @param {Implementation} implementation implementation\n * @returns {StateMachine} state machine\n */\nfunction createMachine({ states, context, initial }, { actions }) {\n  let currentState = initial;\n  let currentContext = context;\n\n  return {\n    send: (event) => {\n      const currentStateOn = states[currentState].on;\n      const transitionConfig = currentStateOn && currentStateOn[event.type];\n\n      if (transitionConfig) {\n        currentState = transitionConfig.target;\n        if (transitionConfig.actions) {\n          transitionConfig.actions.forEach((actName) => {\n            const actionImpl = actions[actName];\n\n            const nextContextValue =\n              actionImpl && actionImpl(currentContext, event);\n\n            if (nextContextValue) {\n              currentContext = {\n                ...currentContext,\n                ...nextContextValue,\n              };\n            }\n          });\n        }\n      }\n    },\n  };\n}\n\n/**\n * @typedef {object} ShowOverlayData\n * @property {'warning' | 'error'} level level\n * @property {(string  | Message)[]} messages messages\n * @property {'build' | 'runtime'} messageSource message source\n */\n\n/**\n * @typedef {object} CreateOverlayMachineOptions\n * @property {(data: ShowOverlayData) => void} showOverlay show overlay\n * @property {() => void} hideOverlay hide overlay\n */\n\n/**\n * @param {CreateOverlayMachineOptions} options options\n * @returns {StateMachine} state machine\n */\nconst createOverlayMachine = (options) => {\n  const { hideOverlay, showOverlay } = options;\n\n  return createMachine(\n    {\n      initial: \"hidden\",\n      context: {\n        level: \"error\",\n        messages: [],\n        messageSource: \"build\",\n      },\n      states: {\n        hidden: {\n          on: {\n            BUILD_ERROR: {\n              target: \"displayBuildError\",\n              actions: [\"setMessages\", \"showOverlay\"],\n            },\n            RUNTIME_ERROR: {\n              target: \"displayRuntimeError\",\n              actions: [\"setMessages\", \"showOverlay\"],\n            },\n          },\n        },\n        displayBuildError: {\n          on: {\n            DISMISS: {\n              target: \"hidden\",\n              actions: [\"dismissMessages\", \"hideOverlay\"],\n            },\n            BUILD_ERROR: {\n              target: \"displayBuildError\",\n              actions: [\"appendMessages\", \"showOverlay\"],\n            },\n          },\n        },\n        displayRuntimeError: {\n          on: {\n            DISMISS: {\n              target: \"hidden\",\n              actions: [\"dismissMessages\", \"hideOverlay\"],\n            },\n            RUNTIME_ERROR: {\n              target: \"displayRuntimeError\",\n              actions: [\"appendMessages\", \"showOverlay\"],\n            },\n            BUILD_ERROR: {\n              target: \"displayBuildError\",\n              actions: [\"setMessages\", \"showOverlay\"],\n            },\n          },\n        },\n      },\n    },\n    {\n      actions: {\n        dismissMessages: () => {\n          return {\n            messages: [],\n            level: \"error\",\n            messageSource: \"build\",\n          };\n        },\n        appendMessages: (context, event) => {\n          return {\n            messages: context.messages.concat(event.messages),\n            level: event.level || context.level,\n            messageSource: event.type === \"RUNTIME_ERROR\" ? \"runtime\" : \"build\",\n          };\n        },\n        setMessages: (context, event) => {\n          return {\n            messages: event.messages,\n            level: event.level || context.level,\n            messageSource: event.type === \"RUNTIME_ERROR\" ? \"runtime\" : \"build\",\n          };\n        },\n        hideOverlay,\n        showOverlay,\n      },\n    },\n  );\n};\n\n/**\n * @param {Error} error error\n * @returns {undefined | string[]} stack\n */\nconst parseErrorToStacks = (error) => {\n  if (!error || !(error instanceof Error)) {\n    throw new Error(\"parseErrorToStacks expects Error object\");\n  }\n  if (typeof error.stack === \"string\") {\n    return error.stack\n      .split(\"\\n\")\n      .filter((stack) => stack !== `Error: ${error.message}`);\n  }\n};\n\n/**\n * @callback ErrorCallback\n * @param {ErrorEvent} error\n * @returns {void}\n */\n\n/**\n * @param {ErrorCallback} callback callback\n * @returns {() => void} cleanup\n */\nconst listenToRuntimeError = (callback) => {\n  window.addEventListener(\"error\", callback);\n\n  return function cleanup() {\n    window.removeEventListener(\"error\", callback);\n  };\n};\n\n/**\n * @callback UnhandledRejectionCallback\n * @param {PromiseRejectionEvent} rejectionEvent\n * @returns {void}\n */\n\n/**\n * @param {UnhandledRejectionCallback} callback callback\n * @returns {() => void} cleanup\n */\nconst listenToUnhandledRejection = (callback) => {\n  window.addEventListener(\"unhandledrejection\", callback);\n\n  return function cleanup() {\n    window.removeEventListener(\"unhandledrejection\", callback);\n  };\n};\n\n// Styles are inspired by `react-error-overlay`\n\nconst msgStyles = {\n  error: {\n    backgroundColor: \"rgba(206, 17, 38, 0.1)\",\n    color: \"#fccfcf\",\n  },\n  warning: {\n    backgroundColor: \"rgba(251, 245, 180, 0.1)\",\n    color: \"#fbf5b4\",\n  },\n};\nconst iframeStyle = {\n  position: \"fixed\",\n  top: \"0px\",\n  left: \"0px\",\n  right: \"0px\",\n  bottom: \"0px\",\n  width: \"100vw\",\n  height: \"100vh\",\n  border: \"none\",\n  \"z-index\": 9999999999,\n};\nconst containerStyle = {\n  position: \"fixed\",\n  boxSizing: \"border-box\",\n  left: \"0px\",\n  top: \"0px\",\n  right: \"0px\",\n  bottom: \"0px\",\n  width: \"100vw\",\n  height: \"100vh\",\n  fontSize: \"large\",\n  padding: \"2rem 2rem 4rem 2rem\",\n  lineHeight: \"1.2\",\n  whiteSpace: \"pre-wrap\",\n  overflow: \"auto\",\n  backgroundColor: \"rgba(0, 0, 0, 0.9)\",\n  color: \"white\",\n};\nconst headerStyle = {\n  color: \"#e83b46\",\n  fontSize: \"2em\",\n  whiteSpace: \"pre-wrap\",\n  fontFamily: \"sans-serif\",\n  margin: \"0 2rem 2rem 0\",\n  flex: \"0 0 auto\",\n  maxHeight: \"50%\",\n  overflow: \"auto\",\n};\nconst dismissButtonStyle = {\n  color: \"#ffffff\",\n  lineHeight: \"1rem\",\n  fontSize: \"1.5rem\",\n  padding: \"1rem\",\n  cursor: \"pointer\",\n  position: \"absolute\",\n  right: \"0px\",\n  top: \"0px\",\n  backgroundColor: \"transparent\",\n  border: \"none\",\n};\nconst msgTypeStyle = {\n  color: \"#e83b46\",\n  fontSize: \"1.2em\",\n  marginBottom: \"1rem\",\n  fontFamily: \"sans-serif\",\n};\nconst msgTextStyle = {\n  lineHeight: \"1.5\",\n  fontSize: \"1rem\",\n  fontFamily: \"Menlo, Consolas, monospace\",\n};\n\n// ANSI HTML\n\nconst colors = {\n  reset: [\"transparent\", \"transparent\"],\n  black: \"181818\",\n  red: \"E36049\",\n  green: \"B3CB74\",\n  yellow: \"FFD080\",\n  blue: \"7CAFC2\",\n  magenta: \"7FACCA\",\n  cyan: \"C3C2EF\",\n  lightgrey: \"EBE7E3\",\n  darkgrey: \"6D7891\",\n};\n\nansiHTML.setColors(colors);\n\n/** @typedef {Error & { file?: string, moduleName?: string, moduleIdentifier?: string, loc?: string, message?: string; stack?: string | string[] }} Message */\n\n/**\n * @param {string} type type\n * @param {string | Message} item item\n * @returns {{ header: string, body: string }} formatted problem\n */\nconst formatProblem = (type, item) => {\n  let header = type === \"warning\" ? \"WARNING\" : \"ERROR\";\n  let body = \"\";\n\n  if (typeof item === \"string\") {\n    body += item;\n  } else {\n    const file = item.file || \"\";\n    const moduleName = item.moduleName\n      ? item.moduleName.indexOf(\"!\") !== -1\n        ? `${item.moduleName.replace(/^(\\s|\\S)*!/, \"\")} (${item.moduleName})`\n        : `${item.moduleName}`\n      : \"\";\n    const loc = item.loc;\n\n    header += `${\n      moduleName || file\n        ? ` in ${\n            moduleName ? `${moduleName}${file ? ` (${file})` : \"\"}` : file\n          }${loc ? ` ${loc}` : \"\"}`\n        : \"\"\n    }`;\n    body += item.message || \"\";\n  }\n\n  if (typeof item !== \"string\" && Array.isArray(item.stack)) {\n    item.stack.forEach((stack) => {\n      if (typeof stack === \"string\") {\n        body += `\\r\\n${stack}`;\n      }\n    });\n  }\n\n  return { header, body };\n};\n\n/**\n * @typedef {object} CreateOverlayOptions\n * @property {(false | string)=} trustedTypesPolicyName trusted types policy name\n * @property {(boolean | ((error: Error) => void))=} catchRuntimeError runtime error catcher\n */\n\n/**\n * @param {CreateOverlayOptions} options options\n * @returns {StateMachine} overlay\n */\nconst createOverlay = (options) => {\n  /** @type {HTMLIFrameElement | null | undefined} */\n  let iframeContainerElement;\n  /** @type {HTMLDivElement | null | undefined} */\n  let containerElement;\n  /** @type {HTMLDivElement | null | undefined} */\n  let headerElement;\n  /** @type {Array<(element: HTMLDivElement) => void>} */\n  let onLoadQueue = [];\n  /** @type {Omit<TrustedTypePolicy, \"createScript\" | \"createScriptURL\"> | undefined} */\n  let overlayTrustedTypesPolicy;\n\n  /** @typedef {Extract<keyof CSSStyleDeclaration, \"string\">} CSSStyleDeclarationKeys */\n\n  /**\n   * @param {HTMLElement} element element\n   * @param {Partial<CSSStyleDeclaration>} style style\n   */\n  function applyStyle(element, style) {\n    Object.keys(style).forEach((prop) => {\n      element.style[/** @type {CSSStyleDeclarationKeys} */ (prop)] =\n        /** @type {string} */\n        (style[/** @type {CSSStyleDeclarationKeys} */ (prop)]);\n    });\n  }\n\n  /**\n   * @param {string | false | undefined} trustedTypesPolicyName trusted types police name\n   */\n  function createContainer(trustedTypesPolicyName) {\n    // Enable Trusted Types if they are available in the current browser.\n    if (window.trustedTypes) {\n      overlayTrustedTypesPolicy = window.trustedTypes.createPolicy(\n        trustedTypesPolicyName || \"webpack-dev-server#overlay\",\n        {\n          createHTML: (value) => value,\n        },\n      );\n    }\n\n    iframeContainerElement = document.createElement(\"iframe\");\n    iframeContainerElement.id = \"webpack-dev-server-client-overlay\";\n    iframeContainerElement.src = \"about:blank\";\n    applyStyle(iframeContainerElement, iframeStyle);\n\n    iframeContainerElement.onload = () => {\n      const contentElement =\n        /** @type {Document} */\n        (\n          /** @type {HTMLIFrameElement} */\n          (iframeContainerElement).contentDocument\n        ).createElement(\"div\");\n      containerElement =\n        /** @type {Document} */\n        (\n          /** @type {HTMLIFrameElement} */\n          (iframeContainerElement).contentDocument\n        ).createElement(\"div\");\n\n      contentElement.id = \"webpack-dev-server-client-overlay-div\";\n      applyStyle(contentElement, containerStyle);\n\n      headerElement = document.createElement(\"div\");\n\n      headerElement.innerText = \"Compiled with problems:\";\n      applyStyle(headerElement, headerStyle);\n\n      const closeButtonElement = document.createElement(\"button\");\n\n      applyStyle(closeButtonElement, dismissButtonStyle);\n\n      closeButtonElement.innerText = \"×\";\n      closeButtonElement.ariaLabel = \"Dismiss\";\n      closeButtonElement.addEventListener(\"click\", () => {\n        // eslint-disable-next-line no-use-before-define\n        overlayService.send({ type: \"DISMISS\" });\n      });\n\n      contentElement.appendChild(headerElement);\n      contentElement.appendChild(closeButtonElement);\n      contentElement.appendChild(containerElement);\n\n      /** @type {Document} */\n      (\n        /** @type {HTMLIFrameElement} */\n        (iframeContainerElement).contentDocument\n      ).body.appendChild(contentElement);\n\n      onLoadQueue.forEach((onLoad) => {\n        onLoad(/** @type {HTMLDivElement} */ (contentElement));\n      });\n      onLoadQueue = [];\n\n      /** @type {HTMLIFrameElement} */\n      (iframeContainerElement).onload = null;\n    };\n\n    document.body.appendChild(iframeContainerElement);\n  }\n\n  /**\n   * @param {(element: HTMLDivElement) => void} callback callback\n   * @param {string | false | undefined} trustedTypesPolicyName trusted types policy name\n   */\n  function ensureOverlayExists(callback, trustedTypesPolicyName) {\n    if (containerElement) {\n      // @ts-expect-error https://github.com/microsoft/TypeScript/issues/30024\n      containerElement.innerHTML = overlayTrustedTypesPolicy\n        ? overlayTrustedTypesPolicy.createHTML(\"\")\n        : \"\";\n      // Everything is ready, call the callback right away.\n      callback(containerElement);\n\n      return;\n    }\n\n    onLoadQueue.push(callback);\n\n    if (iframeContainerElement) {\n      return;\n    }\n\n    createContainer(trustedTypesPolicyName);\n  }\n\n  // Successful compilation.\n  /**\n   * @returns {void}\n   */\n  function hide() {\n    if (!iframeContainerElement) {\n      return;\n    }\n\n    // Clean up and reset internal state.\n    document.body.removeChild(iframeContainerElement);\n\n    iframeContainerElement = null;\n    containerElement = null;\n  }\n\n  // Compilation with errors (e.g. syntax error or missing modules).\n  /**\n   * @param {string} type type\n   * @param {(string | Message)[]} messages messages\n   * @param {undefined | false | string} trustedTypesPolicyName trusted types policy name\n   * @param {'build' | 'runtime'} messageSource message source\n   */\n  function show(type, messages, trustedTypesPolicyName, messageSource) {\n    ensureOverlayExists(() => {\n      /** @type {HTMLDivElement} */\n      (headerElement).innerText =\n        messageSource === \"runtime\"\n          ? \"Uncaught runtime errors:\"\n          : \"Compiled with problems:\";\n\n      messages.forEach((message) => {\n        const entryElement = document.createElement(\"div\");\n        const msgStyle =\n          type === \"warning\" ? msgStyles.warning : msgStyles.error;\n        applyStyle(entryElement, {\n          ...msgStyle,\n          padding: \"1rem 1rem 1.5rem 1rem\",\n        });\n\n        const typeElement = document.createElement(\"div\");\n        const { header, body } = formatProblem(type, message);\n\n        typeElement.innerText = header;\n        applyStyle(typeElement, msgTypeStyle);\n\n        if (typeof message !== \"string\" && message.moduleIdentifier) {\n          applyStyle(typeElement, { cursor: \"pointer\" });\n          // element.dataset not supported in IE\n          typeElement.setAttribute(\"data-can-open\", \"true\");\n          typeElement.addEventListener(\"click\", () => {\n            fetch(\n              `/webpack-dev-server/open-editor?fileName=${message.moduleIdentifier}`,\n            );\n          });\n        }\n\n        // Make it look similar to our terminal.\n        const text = ansiHTML(encode(body));\n        const messageTextNode = document.createElement(\"div\");\n        applyStyle(messageTextNode, msgTextStyle);\n\n        // @ts-expect-error https://github.com/microsoft/TypeScript/issues/30024\n        messageTextNode.innerHTML = overlayTrustedTypesPolicy\n          ? overlayTrustedTypesPolicy.createHTML(text)\n          : text;\n\n        entryElement.appendChild(typeElement);\n        entryElement.appendChild(messageTextNode);\n\n        /** @type {HTMLDivElement} */\n        (containerElement).appendChild(entryElement);\n      });\n    }, trustedTypesPolicyName);\n  }\n\n  /** @type {(event: KeyboardEvent) => void} */\n  let handleEscapeKey;\n\n  /**\n   * @returns {void}\n   */\n\n  const hideOverlayWithEscCleanup = () => {\n    window.removeEventListener(\"keydown\", handleEscapeKey);\n    hide();\n  };\n\n  const overlayService = createOverlayMachine({\n    showOverlay: ({ level = \"error\", messages, messageSource }) =>\n      show(level, messages, options.trustedTypesPolicyName, messageSource),\n    hideOverlay: hideOverlayWithEscCleanup,\n  });\n  /**\n   * ESC key press to dismiss the overlay.\n   * @param {KeyboardEvent} event Keydown event\n   */\n  handleEscapeKey = (event) => {\n    if (event.key === \"Escape\" || event.key === \"Esc\" || event.keyCode === 27) {\n      overlayService.send({ type: \"DISMISS\" });\n    }\n  };\n\n  window.addEventListener(\"keydown\", handleEscapeKey);\n\n  if (options.catchRuntimeError) {\n    /**\n     * @param {Error | undefined} error error\n     * @param {string} fallbackMessage fallback message\n     */\n    const handleError = (error, fallbackMessage) => {\n      const errorObject =\n        error instanceof Error\n          ? error\n          : new Error(error || fallbackMessage, { cause: error });\n\n      const shouldDisplay =\n        typeof options.catchRuntimeError === \"function\"\n          ? options.catchRuntimeError(errorObject)\n          : true;\n\n      if (shouldDisplay) {\n        overlayService.send({\n          type: \"RUNTIME_ERROR\",\n          messages: [\n            {\n              message: errorObject.message,\n              stack: parseErrorToStacks(errorObject),\n            },\n          ],\n        });\n      }\n    };\n\n    listenToRuntimeError((errorEvent) => {\n      // error property may be empty in older browser like IE\n      const { error, message } = errorEvent;\n\n      if (!error && !message) {\n        return;\n      }\n\n      // if error stack indicates a React error boundary caught the error, do not show overlay.\n      if (\n        error &&\n        error.stack &&\n        error.stack.includes(\"invokeGuardedCallbackDev\")\n      ) {\n        return;\n      }\n\n      handleError(error, message);\n    });\n\n    listenToUnhandledRejection((promiseRejectionEvent) => {\n      const { reason } = promiseRejectionEvent;\n\n      handleError(reason, \"Unknown promise rejection reason\");\n    });\n  }\n\n  return overlayService;\n};\n\nexport { createOverlay, formatProblem };\n"
  },
  {
    "path": "client-src/progress.js",
    "content": "/**\n * @returns {boolean} true when custom elements supported, otherwise false\n */\nexport function isProgressSupported() {\n  return (\n    \"customElements\" in self && Boolean(HTMLElement.prototype.attachShadow)\n  );\n}\n\n/**\n * @returns {void}\n */\nexport function defineProgressElement() {\n  if (customElements.get(\"wds-progress\")) {\n    return;\n  }\n\n  class WebpackDevServerProgress extends HTMLElement {\n    constructor() {\n      super();\n      this.attachShadow({ mode: \"open\" });\n      this.maxDashOffset = -219.99078369140625;\n      this.animationTimer = null;\n    }\n\n    #reset() {\n      clearTimeout(this.animationTimer);\n      this.animationTimer = null;\n\n      const typeAttr = this.getAttribute(\"type\")?.toLowerCase();\n      this.type = typeAttr === \"circular\" ? \"circular\" : \"linear\";\n\n      const innerHTML =\n        this.type === \"circular\"\n          ? WebpackDevServerProgress.#circularTemplate()\n          : WebpackDevServerProgress.#linearTemplate();\n      /** @type {ShadowRoot} */\n      (this.shadowRoot).innerHTML = innerHTML;\n\n      const progressValue = this.getAttribute(\"progress\");\n      this.initialProgress = progressValue ? Number(progressValue) : 0;\n\n      this.#update(this.initialProgress);\n    }\n\n    static #circularTemplate() {\n      return `\n        <style>\n        :host {\n            width: 200px;\n            height: 200px;\n            position: fixed;\n            right: 5%;\n            top: 5%;\n            pointer-events: none;\n            transition: opacity .25s ease-in-out;\n            z-index: 2147483645;\n        }\n\n        circle {\n            fill: #282d35;\n        }\n\n        path {\n            fill: rgba(0, 0, 0, 0);\n            stroke: rgb(186, 223, 172);\n            stroke-dasharray: 219.99078369140625;\n            stroke-dashoffset: -219.99078369140625;\n            stroke-width: 10;\n            transform: rotate(90deg) translate(0px, -80px);\n        }\n\n        text {\n            font-family: 'Open Sans', sans-serif;\n            font-size: 18px;\n            fill: #ffffff;\n            dominant-baseline: middle;\n            text-anchor: middle;\n        }\n\n        tspan#percent-super {\n            fill: #bdc3c7;\n            font-size: 0.45em;\n            baseline-shift: 10%;\n        }\n\n        @keyframes fade {\n            0% { opacity: 1; transform: scale(1); }\n            100% { opacity: 0; transform: scale(0); }\n        }\n\n        .disappear {\n            animation: fade 0.3s;\n            animation-fill-mode: forwards;\n            animation-delay: 0.5s;\n        }\n\n        .hidden {\n            display: none;\n        }\n        </style>\n        <svg id=\"progress\" class=\"hidden noselect\" viewBox=\"0 0 80 80\">\n        <circle cx=\"50%\" cy=\"50%\" r=\"35\"></circle>\n        <path d=\"M5,40a35,35 0 1,0 70,0a35,35 0 1,0 -70,0\"></path>\n        <text x=\"50%\" y=\"51%\">\n            <tspan id=\"percent-value\">0</tspan>\n            <tspan id=\"percent-super\">%</tspan>\n        </text>\n        </svg>\n      `;\n    }\n\n    static #linearTemplate() {\n      return `\n        <style>\n        :host {\n            position: fixed;\n            top: 0;\n            left: 0;\n            pointer-events: none;\n            height: 4px;\n            width: 100vw;\n            z-index: 2147483645;\n        }\n\n        #bar {\n            width: 0%;\n            height: 4px;\n            background-color: rgb(186, 223, 172);\n        }\n\n        @keyframes fade {\n            0% { opacity: 1; }\n            100% { opacity: 0; }\n        }\n\n        .disappear {\n            animation: fade 0.3s;\n            animation-fill-mode: forwards;\n            animation-delay: 0.5s;\n        }\n\n        .hidden {\n            display: none;\n        }\n        </style>\n        <div id=\"progress\"></div>\n        `;\n    }\n\n    connectedCallback() {\n      this.#reset();\n    }\n\n    static get observedAttributes() {\n      return [\"progress\", \"type\"];\n    }\n\n    /**\n     * @param {string} name name\n     * @param {string} oldValue old value\n     * @param {string} newValue new value\n     */\n    attributeChangedCallback(name, oldValue, newValue) {\n      if (name === \"progress\") {\n        this.#update(Number(newValue));\n      } else if (name === \"type\") {\n        this.#reset();\n      }\n    }\n\n    /**\n     * @param {number} percent percent\n     */\n    #update(percent) {\n      const shadowRoot = /** @type {ShadowRoot} */ (this.shadowRoot);\n      const element =\n        /** @type {HTMLElement} */\n        (shadowRoot.querySelector(\"#progress\"));\n      if (this.type === \"circular\") {\n        const path =\n          /** @type {SVGPathElement} */\n          (shadowRoot.querySelector(\"path\"));\n        const value =\n          /** @type {HTMLElement} */\n          (shadowRoot.querySelector(\"#percent-value\"));\n        const offset = ((100 - percent) / 100) * this.maxDashOffset;\n\n        path.style.strokeDashoffset = String(offset);\n        value.textContent = String(percent);\n      } else {\n        element.style.width = `${percent}%`;\n      }\n\n      if (percent >= 100) {\n        this.#hide();\n      } else if (percent > 0) {\n        this.#show();\n      }\n    }\n\n    #show() {\n      const shadowRoot = /** @type {ShadowRoot} */ (this.shadowRoot);\n      const element =\n        /** @type {HTMLElement} */\n        (shadowRoot.querySelector(\"#progress\"));\n      element.classList.remove(\"hidden\");\n    }\n\n    #hide() {\n      const shadowRoot = /** @type {ShadowRoot} */ (this.shadowRoot);\n      const element =\n        /** @type {HTMLElement} */\n        (shadowRoot.querySelector(\"#progress\"));\n      if (this.type === \"circular\") {\n        element.classList.add(\"disappear\");\n        element.addEventListener(\n          \"animationend\",\n          () => {\n            element.classList.add(\"hidden\");\n            this.#update(0);\n          },\n          { once: true },\n        );\n      } else if (this.type === \"linear\") {\n        element.classList.add(\"disappear\");\n        this.animationTimer = setTimeout(() => {\n          element.classList.remove(\"disappear\");\n          element.classList.add(\"hidden\");\n          element.style.width = \"0%\";\n          this.animationTimer = null;\n        }, 800);\n      }\n    }\n  }\n\n  customElements.define(\"wds-progress\", WebpackDevServerProgress);\n}\n"
  },
  {
    "path": "client-src/socket.js",
    "content": "/* global __webpack_dev_server_client__ */\n\nimport WebSocketClient from \"./clients/WebSocketClient.js\";\nimport { log } from \"./utils/log.js\";\n\n/** @typedef {import(\"./index.js\").EXPECTED_ANY} EXPECTED_ANY */\n/** @typedef {import(\"./clients/SockJSClient\")} SockJSClient */\n\n// this WebsocketClient is here as a default fallback, in case the client is not injected\n/** @type {CommunicationClientConstructor} */\nconst Client =\n  typeof __webpack_dev_server_client__ !== \"undefined\"\n    ? typeof (\n        /** @type {{ default: CommunicationClientConstructor }} */\n        (__webpack_dev_server_client__).default\n      ) !== \"undefined\"\n      ? /** @type {{ default: CommunicationClientConstructor }} */\n        (__webpack_dev_server_client__).default\n      : /** @type {CommunicationClientConstructor} */ (\n          __webpack_dev_server_client__\n        )\n    : WebSocketClient;\n\nlet retries = 0;\nlet maxRetries = 10;\n\n// Initialized client is exported so external consumers can utilize the same instance\n// It is mutable to enforce singleton\n/** @type {CommunicationClient | null} */\n// eslint-disable-next-line import/no-mutable-exports\nexport let client = null;\n\n/** @type {ReturnType<typeof setTimeout> | undefined} */\nlet timeout;\n\n/**\n * @param {string} url url\n * @param {{ [handler: string]: (data?: EXPECTED_ANY, params?: EXPECTED_ANY) => EXPECTED_ANY }} handlers handlers\n * @param {number=} reconnect count of reconnections\n */\nfunction socket(url, handlers, reconnect) {\n  client = new Client(url);\n\n  client.onOpen(() => {\n    retries = 0;\n\n    if (timeout) {\n      clearTimeout(timeout);\n    }\n\n    if (typeof reconnect !== \"undefined\") {\n      maxRetries = reconnect;\n    }\n  });\n\n  client.onClose(() => {\n    if (retries === 0) {\n      handlers.close();\n    }\n\n    // Try to reconnect.\n    client = null;\n\n    // After 10 retries stop trying, to prevent logspam.\n    if (retries < maxRetries) {\n      // Exponentially increase timeout to reconnect.\n      // Respectfully copied from the package `got`.\n      const retryInMs = 1000 * Math.pow(2, retries) + Math.random() * 100;\n\n      retries += 1;\n\n      log.info(\"Trying to reconnect...\");\n\n      timeout = setTimeout(() => {\n        socket(url, handlers, reconnect);\n      }, retryInMs);\n    }\n  });\n\n  client.onMessage(\n    /**\n     * @param {EXPECTED_ANY} data data\n     */\n    (data) => {\n      const message = JSON.parse(data);\n\n      if (handlers[message.type]) {\n        handlers[message.type](message.data, message.params);\n      }\n    },\n  );\n}\n\nexport default socket;\n"
  },
  {
    "path": "client-src/utils/log.js",
    "content": "import logger from \"../modules/logger/index.js\";\n\nconst name = \"webpack-dev-server\";\n// default level is set on the client side, so it does not need\n// to be set by the CLI or API\nconst defaultLevel = \"info\";\n\n// options new options, merge with old options\n/**\n * @param {false | true | \"none\" | \"error\" | \"warn\" | \"info\" | \"log\" | \"verbose\"} level level\n * @returns {void}\n */\nfunction setLogLevel(level) {\n  logger.configureDefaultLogger({ level });\n}\n\nsetLogLevel(defaultLevel);\n\nconst log = logger.getLogger(name);\n\nexport { log, setLogLevel };\n"
  },
  {
    "path": "client-src/utils/sendMessage.js",
    "content": "/* global WorkerGlobalScope */\n\n/** @typedef {import(\"../index\").EXPECTED_ANY} EXPECTED_ANY */\n\n// Send messages to the outside, so plugins can consume it.\n/**\n * @param {string} type type\n * @param {EXPECTED_ANY=} data data\n */\nfunction sendMsg(type, data) {\n  if (\n    typeof self !== \"undefined\" &&\n    (typeof WorkerGlobalScope === \"undefined\" ||\n      !(self instanceof WorkerGlobalScope))\n  ) {\n    self.postMessage({ type: `webpack${type}`, data }, \"*\");\n  }\n}\n\nexport default sendMsg;\n"
  },
  {
    "path": "client-src/webpack.config.js",
    "content": "\"use strict\";\n\nconst path = require(\"node:path\");\nconst webpack = require(\"webpack\");\nconst { merge } = require(\"webpack-merge\");\n\nconst library = {\n  library: {\n    // type: \"module\",\n    type: \"commonjs\",\n  },\n};\n\nconst baseForModules = {\n  devtool: false,\n  mode: \"development\",\n  // TODO enable this in future after fix bug with `eval` in webpack\n  // experiments: {\n  //   outputModule: true,\n  // },\n  output: {\n    path: path.resolve(__dirname, \"../client/modules\"),\n    ...library,\n  },\n  target: [\"web\", \"es5\"],\n  module: {\n    rules: [\n      {\n        test: /\\.js$/,\n        use: [\n          {\n            loader: \"babel-loader\",\n          },\n        ],\n      },\n    ],\n  },\n};\n\nmodule.exports = [\n  merge(baseForModules, {\n    entry: path.join(__dirname, \"modules/logger/index.js\"),\n    output: {\n      filename: \"logger/index.js\",\n    },\n    module: {\n      rules: [\n        {\n          test: /\\.js$/,\n          use: [\n            {\n              loader: \"babel-loader\",\n              options: {\n                plugins: [\"@babel/plugin-transform-object-assign\"],\n              },\n            },\n          ],\n        },\n      ],\n    },\n    plugins: [\n      new webpack.DefinePlugin({\n        Symbol:\n          '(typeof Symbol !== \"undefined\" ? Symbol : function (i) { return i; })',\n      }),\n      new webpack.NormalModuleReplacementPlugin(\n        /^tapable$/,\n        path.join(__dirname, \"modules/logger/tapable.js\"),\n      ),\n    ],\n  }),\n  merge(baseForModules, {\n    entry: path.join(__dirname, \"modules/sockjs-client/index.js\"),\n    output: {\n      filename: \"sockjs-client/index.js\",\n      library: \"SockJS\",\n      libraryTarget: \"umd\",\n      globalObject: \"(typeof self !== 'undefined' ? self : this)\",\n    },\n  }),\n];\n"
  },
  {
    "path": "commitlint.config.js",
    "content": "\"use strict\";\n\nmodule.exports = {\n  extends: [\"@commitlint/config-conventional\"],\n  rules: {\n    \"header-max-length\": [0],\n    \"body-max-line-length\": [0],\n    \"footer-max-line-length\": [0],\n  },\n};\n"
  },
  {
    "path": "eslint.config.mjs",
    "content": "import { defineConfig, globalIgnores } from \"eslint/config\";\nimport config from \"eslint-config-webpack\";\nimport configs from \"eslint-config-webpack/configs.js\";\n\nexport default defineConfig([\n  globalIgnores([\"client/**/*\", \"examples/**/*\"]),\n  {\n    extends: [config],\n    ignores: [\"client-src/**/*\", \"!client-src/webpack.config.js\"],\n    rules: {\n      // TODO fix me\n      \"prefer-destructuring\": \"off\",\n      \"jsdoc/require-property-description\": \"off\",\n    },\n  },\n  {\n    files: [\"client-src/**/*\"],\n    ignores: [\"client-src/webpack.config.js\"],\n    extends: [configs[\"browser-outdated-recommended\"]],\n  },\n  {\n    files: [\"test/**/*\"],\n    extends: [configs[\"universal-recommended\"]],\n  },\n]);\n"
  },
  {
    "path": "examples/.assets/layout.html",
    "content": "<!doctype html>\n<html>\n  <head>\n    <title>WDS ▻ <%= htmlWebpackPlugin.options.title %></title>\n    <meta charset=\"utf-8\" />\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\" />\n    <link rel=\"shortcut icon\" href=\".assets/favicon.ico\" />\n    <link\n      rel=\"stylesheet\"\n      href=\"https://fonts.googleapis.com/css?family=Source+Code+Pro:400,600|Source+Sans+Pro:400,400i,500,600\"\n    />\n    <link rel=\"stylesheet\" href=\".assets/style.css\" />\n  </head>\n  <body>\n    <main>\n      <header>\n        <h1>\n          <img\n            src=\".assets/icon-square.svg\"\n            style=\"width: 35px; height: 35px\"\n          />\n          webpack-dev-server\n        </h1>\n      </header>\n      <section>\n        <h2><%= htmlWebpackPlugin.options.title %></h2>\n        <div id=\"target\"></div>\n      </section>\n    </main>\n  </body>\n</html>\n"
  },
  {
    "path": "examples/.assets/style.css",
    "content": "@font-face {\n  font-family: \"Geomanist\";\n  font-style: normal;\n  font-weight: 600;\n  src:\n    url(\"assets/geomanist-medium.woff2\") format(\"woff2\"),\n    url(\"assets/geomanist-medium.woff\") format(\"woff\");\n}\n\nhtml,\nbody {\n  background-color: #f3f3f3;\n  color: #2b3a42;\n  font:\n    400 10px \"Source Sans Pro\",\n    -apple-system,\n    BlinkMacSystemFont,\n    \"Segoe UI\",\n    Helvetica,\n    Arial,\n    sans-serif;\n  height: 100%;\n  margin: 0;\n  padding: 0;\n  -webkit-font-smoothing: antialiased;\n  -moz-osx-font-smoothing: grayscale;\n}\n\na {\n  color: #2086d7;\n  text-decoration: none;\n  transition: color 250ms;\n}\n\na:hover {\n  color: #1a6aab;\n}\n\nmain {\n  width: 100%;\n  max-width: 94.2rem;\n  margin: 0px auto;\n  padding: 8rem 2.4rem;\n}\n\nh1 {\n  font-size: 3.4rem;\n  font-weight: 600;\n  line-height: 3.4rem;\n  margin-top: 0;\n  padding-top: 0;\n}\n\nh1 img {\n  height: 3.4rem;\n  width: 3.4rem;\n  vertical-align: middle;\n}\n\nh2 {\n  font-size: 2.8rem;\n}\n\nsection {\n  padding: 0 0 0 4.2rem;\n}\n\ndiv,\np,\ntable {\n  font-size: 1.6rem;\n}\n\ncode {\n  background-color: rgba(70, 94, 105, 0.06);\n  border-radius: 3px;\n  font-family:\n    \"Source Code Pro\", Consolas, \"Liberation Mono\", Menlo, Courier, monospace;\n  font-size: 1.44rem;\n  margin: 0;\n  max-width: 100%;\n  line-height: initial;\n  overflow: auto;\n  padding: 2px 6px;\n  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.6);\n  vertical-align: middle;\n  white-space: normal;\n}\n\n#target {\n  background: #dcf2fd;\n  border: 0.1rem solid #618ca0;\n  border-radius: 0.3rem;\n  color: #618ca0;\n  margin: 2rem 0;\n  padding: 2rem;\n}\n\n#target.warn {\n  background: #fcf8e3;\n  border: 0.1rem solid #8a6d3b;\n  color: #8a6d3b;\n}\n\n#target.pass {\n  background: #f2f9f4;\n  border: 0.1rem solid #4db277;\n  color: #4db277;\n}\n\n#target.fail {\n  background: #f2dede;\n  border: 0.1rem solid #a94442;\n  color: #a94442;\n}\n"
  },
  {
    "path": "examples/README.md",
    "content": "# Examples\n\nEach example showcases a particular feature of `webpack-dev-server`. You can use\nthese examples to learn how to use certain features, or as a means to test features\nwhen working on a Pull Request.\n\nAn example should be as minimal as possible and consists of at least:\n\n- An `app.js` file - the entry point for an example app.\n- A `README.md` file containing information about, and how to run the example app.\n- A description of what should happen when running the example.\n- A `webpack.config.js` file containing the `webpack` configuration for the example app.\n\n## API\n\nAPI examples can be found in the `api` directory. These examples demonstrate how\nto access and run `webpack-dev-server` directly in your application / script.\n\n## Notes\n\n- Each example's `webpack` config is wrapped with `util.setup`; a helper function\n  that adds plugins and configuration needed by each example to render in a consistent\n  and visually pleasing way.\n- Examples' `bundle.js` and `index.html` files are compiled and served from memory.\n  You won't actually see these files written to disk, but if you examine the `webpack`\n  output, you should see their file indicators.\n"
  },
  {
    "path": "examples/api/internal-ip/README.md",
    "content": "# internalIP(family: \"v4\" | \"v6\")\n\nReturns the internal IP address asynchronously.\n\n```js\nconst WebpackDevServer = require(\"webpack-dev-server\");\n\nconst logInternalIPs = async () => {\n  const localIPv4 = await WebpackDevServer.internalIP(\"v4\");\n  const localIPv6 = await WebpackDevServer.internalIP(\"v6\");\n\n  console.log(\"Local IPv4 address:\", localIPv4);\n  console.log(\"Local IPv6 address:\", localIPv6);\n};\n\nlogInternalIPs();\n```\n\nUse the following command to run this example:\n\n```console\nnode app.js\n```\n\n## What Should Happen\n\n- The script should log your local IPv4 and IPv6 address.\n"
  },
  {
    "path": "examples/api/internal-ip/app.js",
    "content": "\"use strict\";\n\nconst WebpackDevServer = require(\"../../../lib/Server\");\n\nconst logInternalIPs = async () => {\n  const localIPv4 = await WebpackDevServer.internalIP(\"v4\");\n  const localIPv6 = await WebpackDevServer.internalIP(\"v6\");\n\n  console.log(\"Local IPv4 address:\", localIPv4);\n  console.log(\"Local IPv6 address:\", localIPv6);\n};\n\nlogInternalIPs();\n"
  },
  {
    "path": "examples/api/internal-ip-sync/README.md",
    "content": "# internalIPSync(family: \"v4\" | \"v6\")\n\nReturns the internal IP address synchronously.\n\n```js\nconst WebpackDevServer = require(\"webpack-dev-server\");\n\nconst localIPv4 = WebpackDevServer.internalIPSync(\"v4\");\nconst localIPv6 = WebpackDevServer.internalIPSync(\"v6\");\n\nconsole.log(\"Local IPv4 address:\", localIPv4);\nconsole.log(\"Local IPv6 address:\", localIPv6);\n```\n\nUse the following command to run this example:\n\n```console\nnode app.js\n```\n\n## What Should Happen\n\n- The script should log your local IPv4 and IPv6 address.\n"
  },
  {
    "path": "examples/api/internal-ip-sync/app.js",
    "content": "\"use strict\";\n\nconst WebpackDevServer = require(\"../../../lib/Server\");\n\nconst localIPv4 = WebpackDevServer.internalIPSync(\"v4\");\nconst localIPv6 = WebpackDevServer.internalIPSync(\"v6\");\n\nconsole.log(\"Local IPv4 address:\", localIPv4);\nconsole.log(\"Local IPv6 address:\", localIPv6);\n"
  },
  {
    "path": "examples/api/middleware/README.md",
    "content": "# API: Custom Middleware\n\nWhile it's recommended to run `webpack-dev-server` via the CLI, you may also\nchoose to start a server via the API. This example demonstrates using one of the\nfew custom middleware options; `before`.\n\n```console\nnode server.js\n```\n\n## What Should Happen\n\n1. Open `http://localhost:8080/` in your preferred browser.\n2. You should see the text on the page itself change to read `Success!`.\n3. In the console/terminal, you should see the following for each refresh in\n   the browser:\n\n```\nUsing middleware for /\nUsing middleware for /bundle.js\n```\n"
  },
  {
    "path": "examples/api/middleware/app.js",
    "content": "\"use strict\";\n\nconst target = document.querySelector(\"#target\");\n\ntarget.classList.add(\"pass\");\ntarget.innerHTML = \"Success!\";\n"
  },
  {
    "path": "examples/api/middleware/server.js",
    "content": "\"use strict\";\n\nconst Webpack = require(\"webpack\");\nconst WebpackDevServer = require(\"../../../lib/Server\");\nconst webpackConfig = require(\"./webpack.config\");\n\nconst compiler = Webpack(webpackConfig);\nconst devServerOptions = webpackConfig.devServer;\nconst server = new WebpackDevServer(devServerOptions, compiler);\n\nserver.startCallback(() => {\n  console.log(\"Starting server on http://localhost:8080\");\n});\n"
  },
  {
    "path": "examples/api/middleware/webpack.config.js",
    "content": "\"use strict\";\n\n// our setup function adds behind-the-scenes bits to the config that all of our\n// examples need\nconst { setup } = require(\"../../util\");\n\nmodule.exports = setup({\n  context: __dirname,\n  entry: \"./app.js\",\n  output: {\n    filename: \"bundle.js\",\n  },\n  stats: {\n    colors: true,\n  },\n});\n"
  },
  {
    "path": "examples/api/simple/README.md",
    "content": "# API: Simple Server\n\nWhile it's recommended to run `webpack-dev-server` via the CLI, you may also\nchoose to start a server via the API. This example starts a simple server setup.\n\n```console\nnode server.js\n```\n\n## What should happen\n\n1. Open `http://localhost:8080/` in your preferred browser.\n2. You should see the text on the page itself change to read `Success!`.\n3. In `app.js`, uncomment the code that results in an error and save. This error\n   should be visible in the console/terminal and in browser devtools.\n4. In `app.js`, uncomment the code that results in a warning. This warning should\n   be visible in the console/terminal and in browser devtools.\n"
  },
  {
    "path": "examples/api/simple/app.js",
    "content": "\"use strict\";\n\nconst target = document.querySelector(\"#target\");\n\ntarget.classList.add(\"pass\");\ntarget.innerHTML = \"Success!\";\n\n// This results in a warning:\nif (!globalThis) {\n  // eslint-disable-next-line\n  require(`./${window}parseable.js`);\n}\n\n// This results in an error:\n// if(!window) {\n//   require(\"test\");\n// }\n"
  },
  {
    "path": "examples/api/simple/server.js",
    "content": "\"use strict\";\n\nconst Webpack = require(\"webpack\");\nconst WebpackDevServer = require(\"../../../lib/Server\");\nconst webpackConfig = require(\"./webpack.config\");\n\nconst compiler = Webpack(webpackConfig);\nconst devServerOptions = { ...webpackConfig.devServer, open: true };\nconst server = new WebpackDevServer(devServerOptions, compiler);\n\nserver.startCallback(() => {\n  console.log(\"Starting server on http://localhost:8080\");\n});\n"
  },
  {
    "path": "examples/api/simple/webpack.config.js",
    "content": "\"use strict\";\n\n// our setup function adds behind-the-scenes bits to the config that all of our\n// examples need\nconst { setup } = require(\"../../util\");\n\nmodule.exports = setup({\n  context: __dirname,\n  entry: \"./app.js\",\n  output: {\n    filename: \"bundle.js\",\n  },\n  stats: {\n    colors: true,\n  },\n});\n"
  },
  {
    "path": "examples/api/start/README.md",
    "content": "# API: start\n\nWhile it's recommended to run `webpack-dev-server` via the CLI, you may also\nchoose to start a server via the API.\n\nThis example demonstrates using `start` method. It instructs `webpack-dev-server` instance to start the server.\n\n```js\nconst Webpack = require(\"webpack\");\nconst WebpackDevServer = require(\"webpack-dev-server\");\nconst webpackConfig = require(\"./webpack.config\");\n\nconst compiler = Webpack(webpackConfig);\nconst devServerOptions = { ...webpackConfig.devServer };\nconst server = new WebpackDevServer(devServerOptions, compiler);\n\nconst runServer = async () => {\n  console.log(\"Starting server...\");\n  await server.start();\n};\n\nrunServer();\n```\n\nUse the following command to run this example:\n\n```console\nnode server.js\n```\n\n## What Should Happen\n\n1. Open `http://localhost:8080/` in your preferred browser.\n2. You should see the text on the page itself change to read `Success!`.\n"
  },
  {
    "path": "examples/api/start/app.js",
    "content": "\"use strict\";\n\nconst target = document.querySelector(\"#target\");\n\ntarget.classList.add(\"pass\");\ntarget.innerHTML = \"Success!\";\n"
  },
  {
    "path": "examples/api/start/server.js",
    "content": "\"use strict\";\n\nconst Webpack = require(\"webpack\");\nconst WebpackDevServer = require(\"../../../lib/Server\");\nconst webpackConfig = require(\"./webpack.config\");\n\nconst compiler = Webpack(webpackConfig);\nconst devServerOptions = { ...webpackConfig.devServer, open: true };\nconst server = new WebpackDevServer(devServerOptions, compiler);\n\nconst runServer = async () => {\n  console.log(\"Starting server...\");\n  await server.start();\n};\n\nrunServer();\n"
  },
  {
    "path": "examples/api/start/webpack.config.js",
    "content": "\"use strict\";\n\n// our setup function adds behind-the-scenes bits to the config that all of our\n// examples need\nconst { setup } = require(\"../../util\");\n\nmodule.exports = setup({\n  context: __dirname,\n  entry: \"./app.js\",\n  output: {\n    filename: \"bundle.js\",\n  },\n  stats: {\n    colors: true,\n  },\n});\n"
  },
  {
    "path": "examples/api/start-callback/README.md",
    "content": "# API: startCallback(callback)\n\nWhile it's recommended to run `webpack-dev-server` via the CLI, you may also choose to start a server via the API.\n\nThis example demonstrates using `startCallback(callback)` method. It instructs `webpack-dev-server` instance to start the server and then run the callback function.\n\n```js\nconst Webpack = require(\"webpack\");\nconst WebpackDevServer = require(\"webpack-dev-server\");\nconst webpackConfig = require(\"./webpack.config\");\n\nconst compiler = Webpack(webpackConfig);\nconst devServerOptions = { ...webpackConfig.devServer };\nconst server = new WebpackDevServer(devServerOptions, compiler);\n\nserver.startCallback(() => {\n  console.log(\"Successfully started server on http://localhost:8080\");\n});\n```\n\nUse the following command to run this example:\n\n```console\nnode server.js\n```\n\n## What Should Happen\n\n1. Open `http://localhost:8080/` in your preferred browser.\n2. You should see the text on the page itself change to read `Success!`.\n3. You should see `Successfully started server on http://localhost:8080` in the terminal output.\n"
  },
  {
    "path": "examples/api/start-callback/app.js",
    "content": "\"use strict\";\n\nconst target = document.querySelector(\"#target\");\n\ntarget.classList.add(\"pass\");\ntarget.innerHTML = \"Success!\";\n"
  },
  {
    "path": "examples/api/start-callback/server.js",
    "content": "\"use strict\";\n\nconst Webpack = require(\"webpack\");\nconst WebpackDevServer = require(\"../../../lib/Server\");\nconst webpackConfig = require(\"./webpack.config\");\n\nconst compiler = Webpack(webpackConfig);\nconst devServerOptions = { ...webpackConfig.devServer, open: true };\nconst server = new WebpackDevServer(devServerOptions, compiler);\n\nserver.startCallback(() => {\n  console.log(\"Successfully started server on http://localhost:8080\");\n});\n"
  },
  {
    "path": "examples/api/start-callback/webpack.config.js",
    "content": "\"use strict\";\n\n// our setup function adds behind-the-scenes bits to the config that all of our\n// examples need\nconst { setup } = require(\"../../util\");\n\nmodule.exports = setup({\n  context: __dirname,\n  entry: \"./app.js\",\n  output: {\n    filename: \"bundle.js\",\n  },\n  stats: {\n    colors: true,\n  },\n});\n"
  },
  {
    "path": "examples/api/stop/README.md",
    "content": "# API: stop\n\nWhile it's recommended to run `webpack-dev-server` via the CLI, you may also\nchoose to stop a server via the API.\n\nThis example demonstrates using `stop` method. It instructs `webpack-dev-server` instance to stop the server.\n\n```js\nconst Webpack = require(\"webpack\");\nconst WebpackDevServer = require(\"webpack-dev-server\");\nconst webpackConfig = require(\"./webpack.config\");\n\nconst compiler = Webpack(webpackConfig);\nconst devServerOptions = { ...webpackConfig.devServer };\nconst server = new WebpackDevServer(devServerOptions, compiler);\n\nconst runServer = async () => {\n  console.log(\"Starting server...\");\n  await server.start();\n};\n\nconst stopServer = async () => {\n  console.log(\"Stopping server...\");\n  await server.stop();\n};\n\nrunServer();\n\nsetTimeout(stopServer, 5000);\n```\n\nUse the following command to run this example:\n\n```console\nnode server.js\n```\n\n## What Should Happen\n\n1. The script should start the server and open `http://localhost:8080/` in your default browser.\n2. You should see the text on the page itself change to read `Success! Reload the page after 5 seconds.`.\n3. After 5 seconds, the script will stop the server. Confirm by reloading the browser page after 5 seconds.\n4. You should see `Stopping server...` in your terminal output.\n"
  },
  {
    "path": "examples/api/stop/app.js",
    "content": "\"use strict\";\n\nconst target = document.querySelector(\"#target\");\n\ntarget.classList.add(\"pass\");\ntarget.innerHTML = \"Success! Reload the page after 5 seconds.\";\n"
  },
  {
    "path": "examples/api/stop/server.js",
    "content": "\"use strict\";\n\nconst Webpack = require(\"webpack\");\nconst WebpackDevServer = require(\"../../../lib/Server\");\nconst webpackConfig = require(\"./webpack.config\");\n\nconst compiler = Webpack(webpackConfig);\nconst devServerOptions = { ...webpackConfig.devServer, open: true };\nconst server = new WebpackDevServer(devServerOptions, compiler);\n\nconst runServer = async () => {\n  console.log(\"Starting server...\");\n  await server.start();\n};\n\nconst stopServer = async () => {\n  console.log(\"Stopping server...\");\n  await server.stop();\n};\n\nrunServer();\n\nsetTimeout(stopServer, 5000);\n"
  },
  {
    "path": "examples/api/stop/webpack.config.js",
    "content": "\"use strict\";\n\n// our setup function adds behind-the-scenes bits to the config that all of our\n// examples need\nconst { setup } = require(\"../../util\");\n\nmodule.exports = setup({\n  context: __dirname,\n  entry: \"./app.js\",\n  output: {\n    filename: \"bundle.js\",\n  },\n  stats: {\n    colors: true,\n  },\n});\n"
  },
  {
    "path": "examples/api/stop-callback/README.md",
    "content": "# API: stopCallback(callback)\n\nWhile it's recommended to run `webpack-dev-server` via the CLI, you may also choose to start a server via the API.\n\nThis example demonstrates using `stopCallback(callback)` method. It instructs `webpack-dev-server` instance to stop the server and then run the callback function.\n\n```js\nconst Webpack = require(\"webpack\");\nconst WebpackDevServer = require(\"webpack-dev-server\");\nconst webpackConfig = require(\"./webpack.config\");\n\nconst compiler = Webpack(webpackConfig);\nconst devServerOptions = { ...webpackConfig.devServer };\nconst server = new WebpackDevServer(devServerOptions, compiler);\n\nserver.startCallback(() => {\n  console.log(\"Successfully started server on http://localhost:8080\");\n});\n\nconst stopServer = () =>\n  server.stopCallback(() => {\n    console.log(\"Server stopped.\");\n  });\n\nsetTimeout(stopServer, 5000);\n```\n\nUse the following command to run this example:\n\n```console\nnode server.js\n```\n\n## What Should Happen\n\n1. The script should start the server and open `http://localhost:8080/` in your default browser.\n2. You should see the text on the page itself change to read `Success! Reload the page after 5 seconds.`.\n3. After 5 seconds, the script will stop the server. Confirm by reloading the browser page after 5 seconds.\n4. You should see `Server stopped.` in your terminal output.\n"
  },
  {
    "path": "examples/api/stop-callback/app.js",
    "content": "\"use strict\";\n\nconst target = document.querySelector(\"#target\");\n\ntarget.classList.add(\"pass\");\ntarget.innerHTML = \"Success! Reload the page after 5 seconds.\";\n"
  },
  {
    "path": "examples/api/stop-callback/server.js",
    "content": "\"use strict\";\n\nconst Webpack = require(\"webpack\");\nconst WebpackDevServer = require(\"../../../lib/Server\");\nconst webpackConfig = require(\"./webpack.config\");\n\nconst compiler = Webpack(webpackConfig);\nconst devServerOptions = { ...webpackConfig.devServer, open: true };\nconst server = new WebpackDevServer(devServerOptions, compiler);\n\nserver.startCallback(() => {\n  console.log(\"Successfully started server on http://localhost:8080\");\n});\n\nconst stopServer = () =>\n  server.stopCallback(() => {\n    console.log(\"Server stopped.\");\n  });\n\nsetTimeout(stopServer, 5000);\n"
  },
  {
    "path": "examples/api/stop-callback/webpack.config.js",
    "content": "\"use strict\";\n\n// our setup function adds behind-the-scenes bits to the config that all of our\n// examples need\nconst { setup } = require(\"../../util\");\n\nmodule.exports = setup({\n  context: __dirname,\n  entry: \"./app.js\",\n  output: {\n    filename: \"bundle.js\",\n  },\n  stats: {\n    colors: true,\n  },\n});\n"
  },
  {
    "path": "examples/app/connect/README.md",
    "content": "# `app` Option\n\nServe using [`connect`](https://github.com/senchalabs/connect) as an application.\n\n**webpack.config.js**\n\n```js\nconst connect = require(\"connect\");\n\nmodule.exports = {\n  // ...\n  devServer: {\n    server: {\n      app: () => connect(),\n    },\n  },\n};\n```\n\n## What Should Happen\n\n1. The script should open `https://localhost:8080/` in your default browser.\n2. You should see the text on the page itself change to read `Success!`.\n"
  },
  {
    "path": "examples/app/connect/app.js",
    "content": "\"use strict\";\n\nconst target = document.querySelector(\"#target\");\n\ntarget.classList.add(\"pass\");\ntarget.innerHTML = \"Success!\";\n"
  },
  {
    "path": "examples/app/connect/webpack.config.js",
    "content": "\"use strict\";\n\n// our setup function adds behind-the-scenes bits to the config that all of our\n// examples need\nconst connect = require(\"connect\");\nconst { setup } = require(\"../../util\");\n\nmodule.exports = setup({\n  context: __dirname,\n  entry: \"./app.js\",\n  devServer: {\n    app: () => connect(),\n  },\n});\n"
  },
  {
    "path": "examples/app/hono/README.md",
    "content": "# `app` Option\n\nServe using [`hono`](https://github.com/honojs/hono) as an application.\n\n**webpack.config.js**\n\n```js\nconst connect = require(\"connect\");\n\nmodule.exports = {\n  // ...\n  devServer: {\n    server: {\n      app: () => connect(),\n    },\n  },\n};\n```\n\n## What Should Happen\n\n1. The script should open `https://localhost:8080/` in your default browser.\n2. You should see the text on the page itself change to read `Success!`.\n"
  },
  {
    "path": "examples/app/hono/app.js",
    "content": "\"use strict\";\n\nconst target = document.querySelector(\"#target\");\n\ntarget.classList.add(\"pass\");\ntarget.innerHTML = \"Success!\";\n"
  },
  {
    "path": "examples/app/hono/ssl/localhost-cert.pem",
    "content": "-----BEGIN CERTIFICATE-----\nMIIDCTCCAfGgAwIBAgIUevWiuCfenWuq9KyC8aQ/tc1Io14wDQYJKoZIhvcNAQEL\nBQAwFDESMBAGA1UEAwwJbG9jYWxob3N0MB4XDTI0MDQyNDE2MDYyMloXDTI0MDUy\nNDE2MDYyMlowFDESMBAGA1UEAwwJbG9jYWxob3N0MIIBIjANBgkqhkiG9w0BAQEF\nAAOCAQ8AMIIBCgKCAQEA1v/lb9u9WkqkF7zjIKe2R+b4S0sQnWIfBFZ0ggtaOL0a\nntud/EuaGQgLtJgSwO2M2xIqKx+yoLhoM+273EJe0KmfJMxYNAkhwP9h6vrKnaQJ\nmpAhoalfEGyCrnHHMKISAAn4Rlc8NXnULoFhHzNm8bdqvP33rCmsJ+tNYC5kwzyt\nHvRNFyg9BOUfACiPW17opFH0rao3IfZrQ6yRbknef1pX1x2pbDAH14rCT/vXaTs6\nVGuqLE/wRsSt+7nMHy/PmXxMyb4G4/UflYtnKfmXpDRw+TDEGzvTZedtoOz+rrJC\ne989R9qYGrlPfyfZbI+O348FV66I+jcD+/EUQs+HkwIDAQABo1MwUTAdBgNVHQ4E\nFgQU6bk4LSwtVQEt7V/ev+Zj270zdAkwHwYDVR0jBBgwFoAU6bk4LSwtVQEt7V/e\nv+Zj270zdAkwDwYDVR0TAQH/BAUwAwEB/zANBgkqhkiG9w0BAQsFAAOCAQEAUBgo\nE3CZrrc/MaadFg1meNk+eKACmTsIa5cT6zi7MsvoKakXEd4bGd+iLifUzlAa1ygj\ndQppfprb5t68I7oO9/lkh2DfKrXxW/RpdhB05KslUd8q/3XY5kyao5quzeiVoMHR\nu+XYjoy2mTwdUC2uzFy6rkHsAkJy2vJJoDdlNsrKn6AZmh+voHHKrAtOL4gnanQV\nwR1u8eBVfk2MKIl2pNSCA4bD16uZyp3+oqq097BEoVa1pR+l8nwbsh/YfALifq/d\nP3yiN5+EqgiOIF9b8PZORe+Ry1O7uvPnU2ZRkVWPJ1S17Ms0lnr7IY3qjSBTuK66\n5uYi7ojrb5Vf0UL5oQ==\n-----END CERTIFICATE-----\n"
  },
  {
    "path": "examples/app/hono/ssl/localhost-privkey.pem",
    "content": "-----BEGIN PRIVATE KEY-----\nMIIEugIBADANBgkqhkiG9w0BAQEFAASCBKQwggSgAgEAAoIBAQDW/+Vv271aSqQX\nvOMgp7ZH5vhLSxCdYh8EVnSCC1o4vRqe2538S5oZCAu0mBLA7YzbEiorH7KguGgz\n7bvcQl7QqZ8kzFg0CSHA/2Hq+sqdpAmakCGhqV8QbIKucccwohIACfhGVzw1edQu\ngWEfM2bxt2q8/fesKawn601gLmTDPK0e9E0XKD0E5R8AKI9bXuikUfStqjch9mtD\nrJFuSd5/WlfXHalsMAfXisJP+9dpOzpUa6osT/BGxK37ucwfL8+ZfEzJvgbj9R+V\ni2cp+ZekNHD5MMQbO9Nl522g7P6uskJ73z1H2pgauU9/J9lsj47fjwVXroj6NwP7\n8RRCz4eTAgMBAAECggEAA+zbFv43iEj5kvdfXC7DrK9iVBmUPZNXhqA/c0paxNNr\nA4B182+76f4UHKF0IjKUEkHUJEJpY/bJ7DzIY76QdZXLMoRKjfSmuZvQAVa/0T33\n8Or1ujpZ4nZgsmegX9ptorOL5VjdYAqP3aN+DvBEzl/vYnDujyWZn4bzvDBMpaXS\n39qW1MkcZ8UiP1fRad76+S57WnieBV+NRHYEAiDdMFKXLuw/igX/xOSZgq5Jh3I2\nhLS49S41dN1P9l9H2bPMw0CthNvMPPaemwKHz+84hSS+P4VJOWJzlGnXEdIFuqBR\nGFBESQzcemfS9DDB22Yt06YujBCbwTVVAxj73lnKkQKBgQDvYXK36J9y/NphDAWi\nCwti5oE3eSfV0YazQwm+rRwC64wbpBFAm9ujwjUmaYBg75lBLF5nOOe8s1n95g5I\ntLfFb+zuZh8NNLjhfNE9/SNmRnnMvbcaDHeIE2RMAz+PuLN/gFLmsVIwK2X1LRC2\n0vHjw9Yzh6JLiOajAchzhZiCEQKBgQDl7R6Wfggo8myETA8Uv5tWot3IcquRkEl/\nTRCyao2/79rAGexS7piwD7FPdSDOk1zfZFYUOMzyMjj60sGcPRPqRX6D0usEODLQ\nTwsTJSCNgPnIOkqKkccwtqlTimbRIrPUSQfFPj56RzKKWdrJ/P3LPRjzkK7i3vLV\nEGlAENaLYwKBgHKSOnzpWr+HY+IFBgErthRs7LWnSDifYxATauuXIQwIvvNP0G4S\n6snzHss2vZonszstSDWxV8DKOq052eZUkIxv6H+l4wDIFiDeQ6uep73Ax3UF7EgM\nZX18gombGGXqagcBXSxK/GJPsynomtJWHi38Ql5BcZ0jdffY157q9zZxAoGAPZtD\nTt+GIDKUkP4wLEcKwDPzaPoQrngSuWFUz/ls8bi6zC4l/DKiBsqtn7Sqja8+ezzP\nM6vkfiCm084UwmA7LdJhC8E/52mHc/k55m9UQZYFV3kG8AoPbSYESLYUxoSd2ouW\n4WrEIs9g42EgFm8LMaG1Rc3GjlNejWhQSzI3yjECf3v7VoAcUwVfuVkwbm9W24vR\nneFTF8QBl//fxIdxZwoj5SrSgMOjmZ3pXA/ZbFJ0pB4Rh5dmKTYqdpfXsOTiBuwB\nXlqPVpN8UZEl3edpufLDyPldNej/9kEAkK5FS3YVyIQEg75739bCTlfzzCX1HdMx\nq98XYm/n5LWYFezsAt0=\n-----END PRIVATE KEY-----\n"
  },
  {
    "path": "examples/app/hono/webpack.config.js",
    "content": "\"use strict\";\n\nconst { createAdaptorServer } = require(\"@hono/node-server\");\n// eslint-disable-next-line import/no-unresolved\nconst { serveStatic } = require(\"@hono/node-server/serve-static\");\nconst { Hono } = require(\"hono\");\nconst wdm = require(\"webpack-dev-middleware\");\nconst { setup } = require(\"../../util\");\n\n// our setup function adds behind-the-scenes bits to the config that all of our\n// examples need\nmodule.exports = setup({\n  context: __dirname,\n  entry: \"./app.js\",\n  devServer: {\n    // WARNING:\n    //\n    // You always need to set up middlewares which you required for your app,\n    // built-in middlewares (like `history-api-fallback`/etc) doesn't work by default with `hono`\n    setupMiddlewares: (_, devServer) => [\n      {\n        name: \"webpack-dev-middleware\",\n        middleware: wdm.honoWrapper(devServer.compiler),\n      },\n      {\n        name: \"static\",\n        path: \"/.assets/*\",\n        middleware: serveStatic({\n          root: \"../../.assets\",\n          rewriteRequestPath: (item) => item.replace(/^\\/\\.assets\\//, \"/\"),\n        }),\n      },\n    ],\n    app: () => new Hono(),\n    server: (_, app) =>\n      createAdaptorServer({\n        fetch: app.fetch,\n        //\n        // Uncomment for `https`\n        // createServer: require('node:https').createServer,\n        // serverOptions: {\n        //   key: fs.readFileSync(\"./ssl/localhost-privkey.pem\"),\n        //   cert: fs.readFileSync(\"./ssl/localhost-cert.pem\"),\n        // },\n        //\n        // Uncomment for `http2`\n        // createServer: require(\"node:http2\").createSecureServer,\n        // serverOptions: {\n        //   allowHTTP1: true,\n        //   key: require(\"fs\").readFileSync(\"./ssl/localhost-privkey.pem\"),\n        //   cert: require(\"fs\").readFileSync(\"./ssl/localhost-cert.pem\"),\n        // },\n      }),\n  },\n});\n"
  },
  {
    "path": "examples/bonjour/boolean/README.md",
    "content": "# Bonjour (ZeroConf)\n\nThe Bonjour capability broadcasts server information via ZeroConf when the Server\nis started.\n\n## boolean\n\n**webpack.config.js**\n\n```js\nmodule.exports = {\n  // ...\n  devServer: {\n    bonjour: true,\n  },\n};\n```\n\nUsage via CLI:\n\n```console\nnpx webpack serve --bonjour\n```\n\n## What Should Happen\n\nA Zeroconf broadcast should occur, containing data with a type of `http` and a\nsubtype of `webpack`.\n"
  },
  {
    "path": "examples/bonjour/boolean/app.js",
    "content": "\"use strict\";\n\nconst target = document.querySelector(\"#target\");\n\ntarget.innerHTML = \"Please check your Zeroconf service.\";\n"
  },
  {
    "path": "examples/bonjour/boolean/webpack.config.js",
    "content": "\"use strict\";\n\n// our setup function adds behind-the-scenes bits to the config that all of our\n// examples need\nconst { setup } = require(\"../../util\");\n\nmodule.exports = setup({\n  context: __dirname,\n  entry: \"./app.js\",\n  devServer: {\n    bonjour: true,\n  },\n});\n"
  },
  {
    "path": "examples/bonjour/object/README.md",
    "content": "# Bonjour (ZeroConf)\n\nThe Bonjour capability broadcasts server information via ZeroConf when the Server\nis started.\n\n## Bonjour options\n\nAllows options from bonjour for more [configuration](https://github.com/watson/bonjour#initializing):\n\n```js\n// webpack.config.js\nmodule.exports = {\n  // ...\n  devServer: {\n    bonjour: {\n      name: \"webpack-dev-server\",\n      type: \"https\",\n      subtype: \"webpack\",\n    },\n  },\n};\n```\n\n```console\nnpx webpack serve --config webpack.config.js\n```\n\n## What Should Happen\n\nA Zeroconf broadcast should occur, containing data with a type of `https` and a\nsubtype of `webpack`.\n"
  },
  {
    "path": "examples/bonjour/object/app.js",
    "content": "\"use strict\";\n\nconst target = document.querySelector(\"#target\");\n\ntarget.innerHTML = \"Please check your Zeroconf service.\";\n"
  },
  {
    "path": "examples/bonjour/object/webpack.config.js",
    "content": "\"use strict\";\n\n// our setup function adds behind-the-scenes bits to the config that all of our\n// examples need\nconst { setup } = require(\"../../util\");\n\nmodule.exports = setup({\n  context: __dirname,\n  entry: \"./app.js\",\n  devServer: {\n    bonjour: {\n      name: \"webpack-dev-server\",\n      type: \"https\",\n      subtype: \"webpack\",\n    },\n  },\n});\n"
  },
  {
    "path": "examples/client/logging/README.md",
    "content": "# client.logging Option\n\n`'log' | 'info' | 'warn' | 'error' | 'none' | 'verbose'`\n\nAllows to set log level in the browser, e.g. before reloading, before an error or when Hot Module Replacement is enabled.\n\n**webpack.config.js**\n\n```js\nmodule.exports = {\n  // ...\n  devServer: {\n    client: {\n      logging: \"info\",\n    },\n  },\n};\n```\n\nUsage via CLI:\n\n```shell\nnpx webpack serve --open --client-logging info\n```\n\n## What Should Happen\n\n1. The script should open `http://localhost:8080/` in your default browser.\n2. You should see an overlay in browser for compilation warnings.\n3. Open the console in your browser's devtools.\n\nIn the devtools console you should see:\n\n```\n[HMR] Waiting for update signal from WDS...\n[webpack-dev-server] Hot Module Replacement enabled.\n[webpack-dev-server] Live Reloading enabled.\n[webpack-dev-server] Warnings while compiling.\n[webpack-dev-server] Manual warnings produced during compilation.\n```\n"
  },
  {
    "path": "examples/client/logging/app.js",
    "content": "\"use strict\";\n\nconst target = document.querySelector(\"#target\");\n\ntarget.classList.add(\"pass\");\ntarget.innerHTML = \"Success!\";\n"
  },
  {
    "path": "examples/client/logging/webpack.config.js",
    "content": "\"use strict\";\n\n// our setup function adds behind-the-scenes bits to the config that all of our\n// examples need\nconst { setup } = require(\"../../util\");\n\nmodule.exports = setup({\n  context: __dirname,\n  entry: \"./app.js\",\n  plugins: [\n    {\n      apply(compiler) {\n        compiler.hooks.thisCompilation.tap(\n          \"warnings-webpack-plugin\",\n          (compilation) => {\n            compilation.warnings.push(\n              new Error(\"Manual warnings produced during compilation.\"),\n            );\n          },\n        );\n      },\n    },\n  ],\n  devServer: {\n    client: {\n      logging: \"info\",\n    },\n  },\n});\n"
  },
  {
    "path": "examples/client/overlay/README.md",
    "content": "# client.overlay option\n\n**webpack.config.js**\n\n```js\nmodule.exports = {\n  // ...\n  devServer: {\n    client: {\n      overlay: true,\n    },\n  },\n};\n```\n\nUsage via CLI:\n\n```shell\nnpx webpack serve --open --client-overlay\n```\n\nTo disable:\n\n```shell\nnpx webpack serve --open --no-client-overlay\n```\n\n## What Should Happen\n\n1. The script should open `http://localhost:8080/` in your default browser.\n2. You should see an overlay in browser for compilation errors.\n3. Update `entry` in webpack.config.js to `app.js` and save.\n4. You should see the text on the page itself change to read `Success!`.\n\n## Additional Configurations\n\n### Filter errors by function\n\n**webpack.config.js**\n\n```js\nmodule.exports = {\n  devServer: {\n    client: {\n      overlay: {\n        runtimeErrors: (msg) => {\n          if (msg) {\n            if (msg instanceof DOMException && msg.name === \"AbortError\") {\n              return false;\n            }\n\n            let msgString;\n\n            if (msg instanceof Error) {\n              msgString = msg.message;\n            } else if (typeof msg === \"string\") {\n              msgString = msg;\n            }\n\n            if (msgString) {\n              return !/something/i.test(msgString);\n            }\n          }\n\n          return true;\n        },\n      },\n    },\n  },\n};\n```\n\nRun the command:\n\n```shell\nnpx webpack serve --open\n```\n\nWhat should happens:\n\n1. When you click the \"Click to throw error\" button, the overlay should appears.\n1. When you click the \"Click to throw ignored error\" button, the overlay should not appear but you should see an error is logged in console (default browser behavior).\n1. When you click the \"Click to throw unhandled promise rejection\" button, the overlay should appears.\n1. When you click the \"Click to throw ignored promise rejection\" button, the overlay should not appear but you should see an error is logged in console (default browser behavior).\n"
  },
  {
    "path": "examples/client/overlay/app.js",
    "content": "\"use strict\";\n\nconst createButton = require(\"./create-button\");\n\n/**\n * @param {string} errorMessage\n */\nfunction unsafeOperation(errorMessage) {\n  throw new Error(errorMessage);\n}\n\nconst target = document.querySelector(\"#target\");\n\ntarget.insertAdjacentElement(\n  \"afterend\",\n  createButton(\"Click to throw ignored promise rejection\", () => {\n    const abortController = new AbortController();\n\n    fetch(\"https://google.com\", {\n      signal: abortController.signal,\n      mode: \"no-cors\",\n    });\n\n    setTimeout(() => abortController.abort(), 100);\n  }),\n);\n\ntarget.insertAdjacentElement(\n  \"afterend\",\n  createButton(\"Click to throw unhandled promise rejection\", () => {\n    setTimeout(() => Promise.reject(new Error(\"Async error\")), 100);\n  }),\n);\n\ntarget.insertAdjacentElement(\n  \"afterend\",\n  createButton(\"Click to throw ignored error\", () => {\n    unsafeOperation(\"something something\");\n  }),\n);\n\ntarget.insertAdjacentElement(\n  \"afterend\",\n  createButton(\"Click to throw error\", () => {\n    unsafeOperation(\"Error message thrown from JS\");\n  }),\n);\n\n// eslint-disable-next-line import/no-unresolved, import/extensions\nconst invalid = require(\"./invalid.js\");\n\nconsole.log(invalid);\ntarget.classList.add(\"pass\");\ntarget.innerHTML = \"Success!\";\n"
  },
  {
    "path": "examples/client/overlay/create-button.js",
    "content": "\"use strict\";\n\n/**\n * @param {string} label\n * @param {() => void} onClick\n * @returns HTMLButtonElement\n */\nmodule.exports = function createButton(label, onClick) {\n  const button = document.createElement(\"button\");\n\n  button.addEventListener(\"click\", onClick);\n  button.innerHTML = label;\n\n  return button;\n};\n"
  },
  {
    "path": "examples/client/overlay/webpack.config.js",
    "content": "\"use strict\";\n\n// our setup function adds behind-the-scenes bits to the config that all of our\n// examples need\nconst { setup } = require(\"../../util\");\n\nmodule.exports = setup({\n  context: __dirname,\n  // create error for overlay\n  entry: \"./app.js\",\n  devServer: {\n    client: {\n      overlay: {\n        warnings: false,\n        runtimeErrors: (msg) => {\n          if (msg) {\n            if (msg instanceof DOMException && msg.name === \"AbortError\") {\n              return false;\n            }\n\n            let msgString;\n\n            if (msg instanceof Error) {\n              msgString = msg.message;\n            } else if (typeof msg === \"string\") {\n              msgString = msg;\n            }\n\n            if (msgString) {\n              return !/something/i.test(msgString);\n            }\n          }\n\n          return true;\n        },\n      },\n    },\n  },\n  // uncomment to test for IE\n  // target: [\"web\", \"es5\"],\n});\n"
  },
  {
    "path": "examples/client/progress/README.md",
    "content": "# client.progress Option\n\n**webpack.config.js**\n\n```js\nmodule.exports = {\n  // ...\n  devServer: {\n    client: {\n      progress: true | \"linear\" | \"circular\",\n    },\n  },\n};\n```\n\nUsage via CLI:\n\n```shell\nnpx webpack serve --open --client-progress\nnpx webpack serve --open --client-progress linear\nnpx webpack serve --open --client-progress circular\n```\n\nTo disable:\n\n```shell\nnpx webpack serve --open --no-client-progress\n```\n\n## What Should Happen\n\n1. The script should open `http://localhost:8080/` in your default browser.\n2. You should see the text on the page itself change to read `Success!`.\n3. In `app.js` change the text and save.\n4. You should see the compilation progress in the browser console.\n"
  },
  {
    "path": "examples/client/progress/app.js",
    "content": "\"use strict\";\n\nconst target = document.querySelector(\"#target\");\n\ntarget.classList.add(\"pass\");\ntarget.innerHTML = \"Success!\";\n"
  },
  {
    "path": "examples/client/progress/webpack.config.js",
    "content": "\"use strict\";\n\n// our setup function adds behind-the-scenes bits to the config that all of our\n// examples need\nconst { setup } = require(\"../../util\");\n\nmodule.exports = setup({\n  context: __dirname,\n  entry: \"./app.js\",\n  devServer: {\n    client: {\n      progress: true,\n    },\n  },\n});\n"
  },
  {
    "path": "examples/client/reconnect/false/README.md",
    "content": "# client.reconnect: false\n\n## false\n\nTells dev-server the number of times it should try to reconnect the client. When `false` it will not try to reconnect.\n\n**webpack.config.js**\n\n```js\nmodule.exports = {\n  // ...\n  devServer: {\n    client: {\n      reconnect: false,\n    },\n  },\n};\n```\n\nUsage via CLI:\n\n```shell\nnpx webpack serve --open --no-client-reconnect\n```\n\n## What Should Happen\n\n1. The script should open `http://localhost:8080/` in your default browser.\n2. Open the console tab in your browser's devtools.\n3. Now close the server with `Ctrl+C` to disconnect the client.\n\nIn the devtools console you should see that webpack-dev-server is not trying to reconnect:\n\n```\n[webpack-dev-server] Hot Module Replacement enabled.\n[webpack-dev-server] Live Reloading enabled.\n[webpack-dev-server] Disconnected!\n```\n"
  },
  {
    "path": "examples/client/reconnect/false/app.js",
    "content": "\"use strict\";\n\nconst target = document.querySelector(\"#target\");\n\ntarget.classList.add(\"pass\");\ntarget.innerHTML =\n  \"Success! <br> Now, open the console tab in your browser's devtools. Then, close the server with `Ctrl+C` to disconnect the client.\";\n"
  },
  {
    "path": "examples/client/reconnect/false/webpack.config.js",
    "content": "\"use strict\";\n\n// our setup function adds behind-the-scenes bits to the config that all of our\n// examples need\nconst { setup } = require(\"../../../util\");\n\nmodule.exports = setup({\n  context: __dirname,\n  entry: \"./app.js\",\n  devServer: {\n    client: {\n      reconnect: false,\n    },\n  },\n});\n"
  },
  {
    "path": "examples/client/reconnect/number/README.md",
    "content": "# client.reconnect Option\n\n## number\n\nTells dev-server the number of times it should try to reconnect the client.\n\n**webpack.config.js**\n\n```js\nmodule.exports = {\n  // ...\n  devServer: {\n    client: {\n      reconnect: 2,\n    },\n  },\n};\n```\n\nUsage via CLI:\n\n```shell\nnpx webpack serve --open --client-reconnect 2\n```\n\n## What Should Happen\n\n1. The script should open `http://localhost:8080/` in your default browser.\n2. Open the console tab in your browser's devtools.\n3. Now close the server with `Ctrl+C` to disconnect the client.\n\nIn the devtools console you should see that webpack-dev-server tried to reconnect the client 2 times:\n\n```\n[webpack-dev-server] Hot Module Replacement enabled.\n[webpack-dev-server] Live Reloading enabled.\n[webpack-dev-server] Disconnected!\n[webpack-dev-server] Trying to reconnect...\nWebSocket connection to 'ws://127.0.0.1:8163/ws' failed: Error in connection establishment: net::ERR_CONNECTION_REFUSED\n[webpack-dev-server] JSHandle@object\n[webpack-dev-server] Trying to reconnect...\nWebSocket connection to 'ws://127.0.0.1:8163/ws' failed: Error in connection establishment: net::ERR_CONNECTION_REFUSED\n[webpack-dev-server] JSHandle@object\n```\n"
  },
  {
    "path": "examples/client/reconnect/number/app.js",
    "content": "\"use strict\";\n\nconst target = document.querySelector(\"#target\");\n\ntarget.classList.add(\"pass\");\ntarget.innerHTML =\n  \"Success! <br> Now, open the console tab in your browser's devtools. Then, close the server with `Ctrl+C` to disconnect the client.\";\n"
  },
  {
    "path": "examples/client/reconnect/number/webpack.config.js",
    "content": "\"use strict\";\n\n// our setup function adds behind-the-scenes bits to the config that all of our\n// examples need\nconst { setup } = require(\"../../../util\");\n\nmodule.exports = setup({\n  context: __dirname,\n  entry: \"./app.js\",\n  devServer: {\n    client: {\n      reconnect: 2,\n    },\n  },\n});\n"
  },
  {
    "path": "examples/client/reconnect/true/README.md",
    "content": "# client.reconnect: true\n\n## true\n\nTells dev-server the number of times it should try to reconnect the client. When `true` it will try to reconnect unlimited times.\n\n**webpack.config.js**\n\n```js\nmodule.exports = {\n  // ...\n  devServer: {\n    client: {\n      reconnect: true,\n    },\n  },\n};\n```\n\nUsage via CLI:\n\n```shell\nnpx webpack serve --open --client-reconnect\n```\n\n## What Should Happen\n\n1. The script should open `http://localhost:8080/` in your default browser.\n2. Open the console tab in your browser's devtools.\n3. Now close the server with `Ctrl+C` to disconnect the client.\n\nIn the devtools console you should see that webpack-dev-server is trying to reconnect:\n\n```\n[webpack-dev-server] Hot Module Replacement enabled.\n[webpack-dev-server] Live Reloading enabled.\n[webpack-dev-server] Disconnected!\n[webpack-dev-server] Trying to reconnect...\nWebSocket connection to 'ws://127.0.0.1:8163/ws' failed: Error in connection establishment: net::ERR_CONNECTION_REFUSED\n[webpack-dev-server] JSHandle@object\n[webpack-dev-server] Trying to reconnect...\nWebSocket connection to 'ws://127.0.0.1:8163/ws' failed: Error in connection establishment: net::ERR_CONNECTION_REFUSED\n[webpack-dev-server] JSHandle@object\n[webpack-dev-server] Trying to reconnect...\nWebSocket connection to 'ws://127.0.0.1:8163/ws' failed: Error in connection establishment: net::ERR_CONNECTION_REFUSED\n[webpack-dev-server] JSHandle@object\n```\n"
  },
  {
    "path": "examples/client/reconnect/true/app.js",
    "content": "\"use strict\";\n\nconst target = document.querySelector(\"#target\");\n\ntarget.classList.add(\"pass\");\ntarget.innerHTML =\n  \"Success! <br> Now, open the console tab in your browser's devtools. Then, close the server with `Ctrl+C` to disconnect the client.\";\n"
  },
  {
    "path": "examples/client/reconnect/true/webpack.config.js",
    "content": "\"use strict\";\n\n// our setup function adds behind-the-scenes bits to the config that all of our\n// examples need\nconst { setup } = require(\"../../../util\");\n\nmodule.exports = setup({\n  context: __dirname,\n  entry: \"./app.js\",\n  devServer: {\n    client: {\n      reconnect: true,\n    },\n  },\n});\n"
  },
  {
    "path": "examples/client/trusted-types-overlay/README.md",
    "content": "# client.overlay.trustedTypesPolicyName option\n\n**webpack.config.js**\n\n```js\nmodule.exports = {\n  // ...\n  output: {\n    trustedTypes: { policyName: \"webpack\" },\n  },\n  devServer: {\n    client: {\n      overlay: {\n        trustedTypesPolicyName: \"webpack#dev-overlay\",\n      },\n    },\n  },\n};\n```\n\nUsage via CLI:\n\n```shell\nnpx webpack serve --open\n```\n\n## What Should Happen\n\n1. The script should open `http://localhost:8080/` in your default browser.\n2. You should see an overlay in browser for compilation errors.\n3. Modify `devServer.client.overlay.trustedTypesPolicyName` in webpack.config.js to `disallowed-policy` and save.\n4. Restart the command and you should not see an overlay at all. In the console you should see the following error:\n\n```\nRefused to create a TrustedTypePolicy named 'disallowed-policy' because it violates the following Content Security Policy directive: \"trusted-types webpack webpack#dev-overlay\".\n```\n"
  },
  {
    "path": "examples/client/trusted-types-overlay/app.js",
    "content": "\"use strict\";\n\nconst target = document.querySelector(\"#target\");\n\ntarget.classList.add(\"pass\");\ntarget.textContent = \"Success!\";\n\n// To display an overlay with an error\n(\n"
  },
  {
    "path": "examples/client/trusted-types-overlay/layout.html",
    "content": "<!-- Originally copied from \"../../.assets/layout.html\" -->\n<!doctype html>\n<html>\n  <head>\n    <!-- Enable Trusted Types -->\n    <meta\n      http-equiv=\"Content-Security-Policy\"\n      content=\"require-trusted-types-for 'script'; trusted-types webpack webpack#dev-overlay;\"\n    />\n\n    <title>WDS ▻ <%= htmlWebpackPlugin.options.title %></title>\n    <meta charset=\"utf-8\" />\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\" />\n    <link rel=\"shortcut icon\" href=\".assets/favicon.ico\" />\n    <link\n      rel=\"stylesheet\"\n      href=\"https://fonts.googleapis.com/css?family=Source+Code+Pro:400,600|Source+Sans+Pro:400,400i,500,600\"\n    />\n    <link rel=\"stylesheet\" href=\".assets/style.css\" />\n  </head>\n  <body>\n    <main>\n      <header>\n        <h1>\n          <img\n            src=\".assets/icon-square.svg\"\n            style=\"width: 35px; height: 35px\"\n          />\n          webpack-dev-server\n        </h1>\n      </header>\n      <section>\n        <h2><%= htmlWebpackPlugin.options.title %></h2>\n        <div id=\"target\"></div>\n      </section>\n    </main>\n  </body>\n</html>\n"
  },
  {
    "path": "examples/client/trusted-types-overlay/webpack.config.js",
    "content": "\"use strict\";\n\nconst path = require(\"node:path\");\nconst HtmlWebpackPlugin = require(\"html-webpack-plugin\");\n// our setup function adds behind-the-scenes bits to the config that all of our\n// examples need\nconst { setup } = require(\"../../util\");\n\nconst config = setup({\n  context: __dirname,\n  // create error for overlay\n  entry: \"./app.js\",\n  output: {\n    trustedTypes: { policyName: \"webpack\" },\n  },\n  devServer: {\n    headers: {\n      \"Content-Security-Policy\": \"require-trusted-types-for 'script'\",\n    },\n    client: {\n      overlay: {\n        trustedTypesPolicyName: \"webpack#dev-overlay\",\n      },\n    },\n  },\n});\n\n// overwrite the index.html with our own to enable Trusted Types\nconfig.plugins[0] = new HtmlWebpackPlugin({\n  filename: \"index.html\",\n  template: path.join(__dirname, \"./layout.html\"),\n  title: \"trusted types overlay\",\n});\n\nmodule.exports = config;\n"
  },
  {
    "path": "examples/client/web-socket-url/README.md",
    "content": "# Web Socket URL Option Protocol\n\n**webpack.config.js**\n\n```js\nmodule.exports = {\n  // ...\n  devServer: {\n    host: \"0.0.0.0\",\n    client: {\n      webSocketURL: \"ws://<insert-host>:8080\",\n    },\n  },\n};\n```\n\nUsage via CLI:\n\n```console\nnpx webpack serve --open --host 0.0.0.0 --client-web-socket-url ws://<insert-host>:8080\n```\n\n_NOTE: replace `<insert-host>` with your local IP Address._\n\nIn order to make the server publicly accessible the client needs to know with\nwhat host to connect to the server. If `--host 0.0.0.0` is given, the client\nwould try to connect to `0.0.0.0`. With the `--client-web-socket-url` and related options it is possible to\noverride this.\n\nYou're now able to explicitly define the protocol used with the `client.webSocketURL` option\n(have a look at the config provided in `webpack.config.js`).\n\n## What Should Happen\n\nThe script should open `http://localhost:8080/` in your default browser.\n\nYou should see a failed attempt to establish a connection to `/ws`\nvia the explicitly defined `https://localhost:8080`. This fails of course since\nwe're not hosting https.\n"
  },
  {
    "path": "examples/client/web-socket-url/app.js",
    "content": "\"use strict\";\n\nconst target = document.querySelector(\"#target\");\n\ntarget.innerHTML =\n  \"Please check the ws request in devtools, it should try to connect to the protocol + server defined in the webSocketURL setting.\";\n"
  },
  {
    "path": "examples/client/web-socket-url/index.html",
    "content": "<!doctype html>\n<html>\n  <head>\n    <script src=\"bundle.js\" type=\"text/javascript\" charset=\"utf-8\"></script>\n  </head>\n  <body></body>\n</html>\n"
  },
  {
    "path": "examples/client/web-socket-url/webpack.config.js",
    "content": "\"use strict\";\n\n// our setup function adds behind-the-scenes bits to the config that all of our\n// examples need\nconst { setup } = require(\"../../util\");\n\nmodule.exports = setup({\n  context: __dirname,\n  entry: \"./app.js\",\n  devServer: {\n    host: \"0.0.0.0\",\n    client: {\n      webSocketURL: \"ws://localhost:8080\",\n    },\n    allowedHosts: \"all\",\n  },\n});\n"
  },
  {
    "path": "examples/compression/false/README.md",
    "content": "# Gzip Compression\n\nWebsite gzip compression makes it possible to reduce the file size of a file\nto roughly 30% of its original size before the files are sent to the browser.\n\nIt is enabled by default. To disable it set `compress` option to `false`.\n\n## false\n\n**webpack.config.js**\n\n```js\nmodule.exports = {\n  // ...\n  devServer: {\n    compress: false,\n  },\n};\n```\n\nUsage via CLI:\n\n```console\nnpx webpack serve --open --no-compress\n```\n\n### What should happen\n\n1. The script should open `http://localhost:8080/`.\n2. Files being sent to the browser from the `webpack` bundle should be gzipped.\n3. Open the console in your browser's devtools and select the _Network_ tab.\n4. Find `main.js`. The response headers should not contain `Content-Encoding: gzip`.\n\n## Notes\n\nSome browsers, such as Chrome, won't show the `Content-Encoding: gzip` within\nthe _Response Headers_. This has been documented [here](https://github.com/expressjs/compression/issues/96).\n\nTo enable `Content-Encoding` for _Response Headers_ in Chrome, you can follow\n[this tutorial](https://www.youtube.com/watch?v=47R6uv0RKCk).\n"
  },
  {
    "path": "examples/compression/false/app.js",
    "content": "\"use strict\";\n\nconst target = document.querySelector(\"#target\");\n\ntarget.classList.add(\"pass\");\ntarget.innerHTML = \"Success!\";\n"
  },
  {
    "path": "examples/compression/false/webpack.config.js",
    "content": "\"use strict\";\n\n// our setup function adds behind-the-scenes bits to the config that all of our\n// examples need\nconst { setup } = require(\"../../util\");\n\nmodule.exports = setup({\n  context: __dirname,\n  entry: \"./app.js\",\n  devServer: {\n    compress: false,\n  },\n});\n"
  },
  {
    "path": "examples/compression/true/README.md",
    "content": "# Gzip Compression\n\nWebsite gzip compression makes it possible to reduce the file size of a file\nto roughly 30% of its original size before the files are sent to the browser.\n\nIt is enabled by default.\n\n## true\n\n**webpack.config.js**\n\n```js\nmodule.exports = {\n  // ...\n  devServer: {\n    compress: true,\n  },\n};\n```\n\nUsage via CLI:\n\n```console\nnpx webpack serve --open --compress\n```\n\n### What should happen\n\n1. The script should open `http://localhost:8080/`.\n2. Files being sent to the browser from the `webpack` bundle should be gzipped.\n3. Open the console in your browser's devtools and select the _Network_ tab.\n4. Find `main.js`. The response headers should contain `Content-Encoding: gzip`.\n\n## Notes\n\nSome browsers, such as Chrome, won't show the `Content-Encoding: gzip` within\nthe _Response Headers_. This has been documented [here](https://github.com/expressjs/compression/issues/96).\n\nTo enable `Content-Encoding` for _Response Headers_ in Chrome, you can follow\n[this tutorial](https://www.youtube.com/watch?v=47R6uv0RKCk).\n"
  },
  {
    "path": "examples/compression/true/app.js",
    "content": "\"use strict\";\n\nconst target = document.querySelector(\"#target\");\n\ntarget.classList.add(\"pass\");\ntarget.innerHTML = \"Success!\";\n"
  },
  {
    "path": "examples/compression/true/webpack.config.js",
    "content": "\"use strict\";\n\n// our setup function adds behind-the-scenes bits to the config that all of our\n// examples need\nconst { setup } = require(\"../../util\");\n\nmodule.exports = setup({\n  context: __dirname,\n  entry: \"./app.js\",\n  devServer: {\n    compress: true,\n  },\n});\n"
  },
  {
    "path": "examples/default/README.md",
    "content": "# Default State\n\nThis example demonstrates how to use `webpack-dev-server`.\n\n```console\nnpx webpack serve --open\n```\n\nTo run your app using an alternative config, use:\n\n```console\nnpx webpack serve --open --config alternative.config.js\n```\n\n## What Should Happen\n\n1. The script should open `http://localhost:8080/` in your default browser.\n2. You should see the text on the page itself change to read `Success!`.\n3. In `app.js` uncomment the code that results in an error and save.\n4. This error should be visible in the console/terminal and in the browser's devtools.\n5. In `app.js` uncomment the code that results in a warning. This warning should\n   be visible in the console/terminal and in the browser's devtools.\n6. Try changing something in `style.less`. The browser should refresh, and the\n   change should be visible in the app.\n"
  },
  {
    "path": "examples/default/app.js",
    "content": "\"use strict\";\n\nrequire(\"./style.less\");\n\nconst target = document.querySelector(\"#target\");\n\ntarget.classList.add(\"pass\");\ntarget.innerHTML = \"Success!\";\n\nconst img = document.createElement(\"img\");\nimg.src = \"/svg.svg\";\nimg.style = \"width: 200px;\";\n\ndocument.body.appendChild(img);\n\n// This results in a warning:\n// if(!window) require(\"./\" + window + \"parseable.js\");\n\n// This results in an error:\n// if(!window) require(\"test\");\n"
  },
  {
    "path": "examples/default/style.less",
    "content": "body {\n  background: url(pixels.png);\n}\n"
  },
  {
    "path": "examples/default/webpack.config.js",
    "content": "\"use strict\";\n\n// our setup function adds behind-the-scenes bits to the config that all of our\n// examples need\nconst { setup } = require(\"../util\");\n\nconst moduleRuleForPNG = {\n  test: /\\.png$/,\n  type: \"asset/resource\",\n  generator: {\n    filename: \"images/[hash][ext][query]\",\n  },\n};\n\nmodule.exports = setup({\n  context: __dirname,\n  entry: \"./app.js\",\n  module: {\n    rules: [\n      {\n        test: /\\.less$/,\n        use: [\"style-loader\", \"css-loader\", \"less-loader\"],\n      },\n      {\n        ...moduleRuleForPNG,\n      },\n    ],\n  },\n});\n"
  },
  {
    "path": "examples/dev-middleware/README.md",
    "content": "# devMiddleware option\n\nProvide options to [webpack-dev-middleware](https://github.com/webpack/webpack-dev-middleware) which handles webpack assets.\n\n**webpack.config.js**\n\n```js\nmodule.exports = {\n  // ...\n  devServer: {\n    devMiddleware: {\n      index: true,\n      headers: {\n        \"X-Custom-Header\": \"yes\",\n      },\n    },\n  },\n};\n```\n\nTo run this example use the following command:\n\n```console\nnpx webpack serve --open\n```\n\n## What should happen\n\n1. The script should open `http://localhost:8080/`.\n2. You should see the text on the page itself change to read `Success!`.\n3. Open the console in your browser's devtools and select the _Network_ tab.\n4. Find `main.js`. The response headers should contain `X-Custom-Header: yes`.\n\nNow update `webpack.config.js` with [`index: false`](https://github.com/webpack/webpack-dev-middleware#index), this will tell the server to not respond to requests to the root URL.\n\nNow close and restart the server with:\n\n```console\nnpx webpack serve --open\n```\n\n## What should happen\n\n1. The script should open `http://localhost:8080/`.\n2. You should see the `Cannot GET /` text on the page.\n"
  },
  {
    "path": "examples/dev-middleware/app.js",
    "content": "\"use strict\";\n\nconst target = document.querySelector(\"#target\");\n\ntarget.classList.add(\"pass\");\ntarget.innerHTML = \"Success!\";\n"
  },
  {
    "path": "examples/dev-middleware/webpack.config.js",
    "content": "\"use strict\";\n\n// our setup function adds behind-the-scenes bits to the config that all of our\n// examples need\nconst { setup } = require(\"../util\");\n\nmodule.exports = setup({\n  context: __dirname,\n  entry: \"./app.js\",\n  devServer: {\n    devMiddleware: {\n      index: false,\n      headers: {\n        \"X-Custom-Header\": \"yes\",\n      },\n    },\n  },\n});\n"
  },
  {
    "path": "examples/general/config-array/README.md",
    "content": "# General: Webpack Config Array\n\nThis example demonstrates using a `webpack` config containing an array of configs.\n\n```console\nnpx webpack serve --open\n```\n\n## What Should Happen\n\n1. The script should open `http://localhost:8080/` in your default browser.\n2. You should see the text on the page itself change to read `Success!`.\n3. Navigate to `http://localhost:8080/bundle2.js`\n4. The browser should display a minified JavaScript bundle.\n"
  },
  {
    "path": "examples/general/config-array/app.js",
    "content": "\"use strict\";\n\nrequire(\"./style.less\");\n\nconst target = document.querySelector(\"#target\");\n\ntarget.classList.add(\"pass\");\ntarget.innerHTML = \"Success!\";\n\n// This results in a warning:\n// if(!window) require(\"./\" + window + \"parseable.js\");\n\n// This results in an error:\n// if(!window) require(\"test\");\n"
  },
  {
    "path": "examples/general/config-array/style.less",
    "content": "body {\n  background: url(pixels.png);\n}\n"
  },
  {
    "path": "examples/general/config-array/webpack.config.js",
    "content": "\"use strict\";\n\n// our setup function adds behind-the-scenes bits to the config that all of our\n// examples need\nconst { setup } = require(\"../../util\");\n\nconst moduleRuleForPNG = {\n  test: /\\.png$/,\n  type: \"asset/resource\",\n  generator: {\n    filename: \"images/[hash][ext][query]\",\n  },\n};\n\nmodule.exports = [\n  setup({\n    context: __dirname,\n    entry: \"./app.js\",\n    module: {\n      rules: [\n        {\n          test: /\\.less$/,\n          use: [\"style-loader\", \"css-loader\", \"less-loader\"],\n        },\n        {\n          ...moduleRuleForPNG,\n        },\n      ],\n    },\n  }),\n  {\n    context: __dirname,\n    entry: \"./app.js\",\n    output: {\n      filename: \"bundle2.js\",\n    },\n    mode: \"development\",\n    module: {\n      rules: [\n        {\n          test: /\\.less$/,\n          use: [\"style-loader\", \"css-loader\", \"less-loader\"],\n        },\n        {\n          test: /\\.png$/,\n          type: \"asset/resource\",\n          generator: {\n            filename: \"images/[hash][ext][query]\",\n          },\n        },\n      ],\n    },\n    optimization: {\n      minimize: true,\n    },\n  },\n];\n"
  },
  {
    "path": "examples/general/config-promise/README.md",
    "content": "# General: Promise-Based Webpack Config\n\nThis example demonstrates using `webpack-dev-server` with a `webpack` config that\nreturns a `Promise`.\n\n```console\nnpx webpack serve --open\n```\n\n## What Should Happen\n\n1. The script should open `http://localhost:8080/` in your default browser.\n2. You should see the text on the page itself change to read `Success!`.\n"
  },
  {
    "path": "examples/general/config-promise/app.js",
    "content": "\"use strict\";\n\n// Change the following line and save to see the compilation status\n\nconst target = document.querySelector(\"#target\");\n\ntarget.classList.add(\"pass\");\ntarget.innerHTML = \"Success!\";\n"
  },
  {
    "path": "examples/general/config-promise/index.html",
    "content": "<!doctype html>\n<html>\n  <head>\n    <title>Promise Config Example</title>\n    <script src=\"/bundle.js\" type=\"text/javascript\" charset=\"utf-8\"></script>\n  </head>\n  <body>\n    <h1>Example: Promise Config</h1>\n  </body>\n</html>\n"
  },
  {
    "path": "examples/general/config-promise/webpack.config.js",
    "content": "\"use strict\";\n\n// our setup function adds behind-the-scenes bits to the config that all of our\n// examples need\nconst { setup } = require(\"../../util\");\n\nmodule.exports = new Promise((resolve) => {\n  resolve(\n    setup({\n      context: __dirname,\n      entry: \"./app.js\",\n      devServer: {},\n    }),\n  );\n});\n"
  },
  {
    "path": "examples/general/proxy-advanced/README.md",
    "content": "# General: Proxy Advanced\n\nThis example demonstrates a user case whereby the app proxies all urls that start with `/api` to\n`http://jsonplaceholder.typicode.com/`, but removes `/api` from the url. So\n`http://localhost:8080/api/users` should perform a request to\n`http://jsonplaceholder.typicode.com/users`.\n\n```console\nnpx webpack serve --open\n```\n\n## What should happen\n\n1. The script should open `http://localhost:8080/` in your default browser.\n2. You should see the text on the page itself change to read `Success!`.\n3. Navigate to `http://localhost:8080/api/users`.\n4. The page should display several JSON objects.\n5. Navigate to `http://localhost:8080/api/nope`.\n6. The page should display `Bypassed proxy!``.\n"
  },
  {
    "path": "examples/general/proxy-advanced/app.js",
    "content": "\"use strict\";\n\nconst target = document.querySelector(\"#target\");\n\ntarget.classList.add(\"pass\");\ntarget.innerHTML = \"Success!\";\n"
  },
  {
    "path": "examples/general/proxy-advanced/bypass.html",
    "content": "<!doctype html>\n<html>\n  <body>\n    <h1>Example: proxy advanced</h1>\n\n    Bypassed proxy!\n  </body>\n</html>\n"
  },
  {
    "path": "examples/general/proxy-advanced/webpack.config.js",
    "content": "\"use strict\";\n\n// our setup function adds behind-the-scenes bits to the config that all of our\n// examples need\nconst { setup } = require(\"../../util\");\n\nmodule.exports = setup({\n  context: __dirname,\n  entry: \"./app.js\",\n  devServer: {\n    proxy: {\n      \"/api\": {\n        target: \"http://jsonplaceholder.typicode.com/\",\n        changeOrigin: true,\n        pathRewrite: {\n          \"^/api\": \"\",\n        },\n        bypass(req) {\n          if (req.url === \"/api/nope\") {\n            return \"/bypass.html\";\n          }\n        },\n      },\n    },\n  },\n});\n"
  },
  {
    "path": "examples/general/proxy-hot-reload/README.md",
    "content": "# General: Proxy Hot Reload\n\n```shell\nnpx webpack serve --open\n```\n\nEnables hot reloading for proxy config. If function is provided instead of\nobject, dev server calls it on each request to get proxy config and replaces proxy middleware if config was changed.\n\n## What should happen\n\n1. The script should open `http://localhost:8080/` in your default browser.\n2. You should see the text on the page itself change to read `Success!`.\n3. Navigate to `http://localhost:8080/api/users`.\n4. The page should display several JSON objects.\n\nWhile the server is running, open `proxy-config.js` and replace the following:\n\n```js\nmodule.exports = {\n  target: \"http://jsonplaceholder.typicode.com/\",\n  pathRewrite: {\n    \"^/api\": \"\",\n  },\n};\n```\n\nwith:\n\n```js\nmodule.exports = {\n  target: \"http://reqres.in/\",\n};\n```\n\nA request to `http://localhost:8080/api/users` should return a response from `http://reqres.in/`.\n"
  },
  {
    "path": "examples/general/proxy-hot-reload/app.js",
    "content": "\"use strict\";\n\nconst target = document.querySelector(\"#target\");\n\ntarget.classList.add(\"pass\");\ntarget.innerHTML = \"Success!\";\n"
  },
  {
    "path": "examples/general/proxy-hot-reload/proxy-config.js",
    "content": "\"use strict\";\n\n/**/\nmodule.exports = {\n  target: \"http://jsonplaceholder.typicode.com/\",\n  pathRewrite: {\n    \"^/api\": \"\",\n  },\n};\n/**/\n\n//\n// Replace it with following and save the file:\n//\n\n/**\n * /\n * module.exports = {\n * target: 'http://reqres.in/'\n * };\n * /*\n */\n"
  },
  {
    "path": "examples/general/proxy-hot-reload/webpack.config.js",
    "content": "\"use strict\";\n\nconst fs = require(\"node:fs\");\n// our setup function adds behind-the-scenes bits to the config that all of our\n// examples need\nconst { setup } = require(\"../../util\");\nconst proxyConfig = require(\"./proxy-config\");\n\nlet proxyOptions = {\n  context: \"/api\",\n  target: proxyConfig.target,\n  pathRewrite: proxyConfig.pathRewrite,\n  changeOrigin: true,\n};\n\nfs.watch(\"./proxy-config.js\", () => {\n  delete require.cache[require.resolve(\"./proxy-config\")];\n  try {\n    const newProxyConfig = require(\"./proxy-config\");\n\n    if (proxyOptions.target !== newProxyConfig.target) {\n      console.log(\"Proxy target changed:\", newProxyConfig.target);\n      proxyOptions = {\n        context: \"/api\",\n        target: newProxyConfig.target,\n        pathRewrite: newProxyConfig.pathRewrite,\n        changeOrigin: true,\n      };\n    }\n  } catch {\n    // ignore\n  }\n});\n\nmodule.exports = setup({\n  context: __dirname,\n  entry: \"./app.js\",\n  devServer: {\n    proxy: [\n      function proxy() {\n        return proxyOptions;\n      },\n    ],\n  },\n});\n"
  },
  {
    "path": "examples/general/proxy-simple/README.md",
    "content": "# General: Simple Proxy\n\n```console\nnpx webpack serve --open\n```\n\nIn `webpack.config.js` there is a very simple configuration for a proxy. Note that this only works when proxying to a direct ip address. See the proxy-advanced example if you want to proxy to a domain.\n\n## What Should Happen\n\n1. The script should open `http://localhost:8080/` in your default browser.\n2. You should see the text on the page itself change to read `Success!`.\n3. Navigate to `http://localhost:8080/api/hey`.\n4. Since the proxy target does not actually exist, the console/terminal should\n   display an error that reads\n   `[HPM] PROXY ERROR: ECONNREFUSED. localhost -> http://127.0.0.1:50545/api/hey`.\n"
  },
  {
    "path": "examples/general/proxy-simple/app.js",
    "content": "\"use strict\";\n\nconst target = document.querySelector(\"#target\");\n\ntarget.classList.add(\"pass\");\ntarget.innerHTML = \"Success!\";\n"
  },
  {
    "path": "examples/general/proxy-simple/webpack.config.js",
    "content": "\"use strict\";\n\n// our setup function adds behind-the-scenes bits to the config that all of our\n// examples need\nconst { setup } = require(\"../../util\");\n\nmodule.exports = setup({\n  context: __dirname,\n  entry: \"./app.js\",\n  devServer: {\n    proxy: {\n      \"/api\": \"http://127.0.0.1:50545\",\n    },\n  },\n});\n"
  },
  {
    "path": "examples/general/universal-config/README.md",
    "content": "# General: Webpack Universal Config\n\nThis example demonstrates using a `webpack` config containing a `target: web` config and `target:node` config.\n\n```console\nnpx webpack serve --open\n```\n\n## What Should Happen\n\n1. The script should open `http://localhost:8080/` in your default browser.\n2. You should see the text on the page itself change to read `[client.js, server.js]: Success!`.\n"
  },
  {
    "path": "examples/general/universal-config/client.js",
    "content": "\"use strict\";\n\nconst target = document.querySelector(\"#target\");\n\nif (!globalThis.fetch) {\n  target.classList.add(\"fail\");\n  target.innerHTML = \"fetch is not supported\";\n} else {\n  fetch(\"/server.js\")\n    .then((res) => {\n      if (res.status === 404) throw new Error(\"[server.js]: Not Found\");\n      return res;\n    })\n    .then((res) => res.text())\n    .then((res) => {\n      if (res.includes(\"console.log('webpack-dev-server/server');\")) {\n        target.classList.add(\"pass\");\n        target.innerHTML = \"[client.js, server.js]: Success!\";\n      }\n    })\n    .catch((err) => {\n      target.classList.add(\"fail\");\n      target.innerHTML = err.message;\n    });\n}\n"
  },
  {
    "path": "examples/general/universal-config/server.js",
    "content": "\"use strict\";\n\nconsole.log(\"webpack-dev-server/server\");\n"
  },
  {
    "path": "examples/general/universal-config/webpack.config.js",
    "content": "\"use strict\";\n\nconst { setup } = require(\"../../util\");\n\nmodule.exports = [\n  setup({\n    mode: \"development\",\n    entry: \"./client.js\",\n    output: {\n      filename: \"client.js\",\n    },\n    context: __dirname,\n  }),\n  {\n    mode: \"development\",\n    target: \"node\",\n    entry: \"./server.js\",\n    output: {\n      filename: \"server.js\",\n    },\n    context: __dirname,\n    node: false,\n  },\n];\n"
  },
  {
    "path": "examples/general/webworker/README.md",
    "content": "# General: WebWorker\n\nThis example demonstrates using a WebWorker within an app run by `webpack-dev-server`.\n\n```console\nnpx webpack serve\n```\n\n## What should happen\n\n1. The main thread sends a message to the Worker.\n2. The worker outputs the message in the console.\n3. The worker sends a message back to the main thread.\n4. The main thread posts the message in the console.\n\nNo error, warning or other log traces should be in the console.\n"
  },
  {
    "path": "examples/general/webworker/web.js",
    "content": "\"use strict\";\n\n/* eslint-env browser */\n\nconst worker = new Worker(\"worker.bundle.js\");\nworker.onmessage = function onMessage(e) {\n  console.log(\"[MAIN]\", e);\n};\nworker.postMessage({\n  hello: 111,\n});\n"
  },
  {
    "path": "examples/general/webworker/webpack.config.js",
    "content": "\"use strict\";\n\n// our setup function adds behind-the-scenes bits to the config that all of our\n// examples need\nconst { setup } = require(\"../../util\");\n\nmodule.exports = [\n  setup({\n    devtool: \"source-map\",\n    target: \"web\",\n    entry: \"./web.js\",\n  }),\n  {\n    devtool: \"source-map\",\n    target: \"webworker\",\n    entry: \"./worker.js\",\n    output: {\n      filename: \"worker.bundle.js\",\n      path: __dirname,\n    },\n  },\n];\n"
  },
  {
    "path": "examples/general/webworker/worker.js",
    "content": "\"use strict\";\n\n/* eslint-env worker */\n\nglobalThis.onmessage = function onMessage(e) {\n  console.log(\"[WORKER]\", e);\n  self.postMessage({\n    hello: 222,\n  });\n};\n"
  },
  {
    "path": "examples/headers/array/README.md",
    "content": "# headers option as an object\n\nAdds headers to all responses.\n\n**webpack.config.js**\n\n```js\nmodule.exports = {\n  // ...\n  devServer: {\n    headers: [\n      {\n        key: \"X-Foo\",\n        value: \"value1\",\n      },\n      {\n        key: \"X-Bar\",\n        value: \"value2\",\n      },\n    ],\n  },\n};\n```\n\nTo run this example use the following command:\n\n```console\nnpx webpack serve --open\n```\n\n## What should happen\n\n1. The script should open `http://localhost:8080/`.\n2. You should see the text on the page itself change to read `Success!`.\n3. Open the console in your browser's devtools and select the _Network_ tab.\n4. Find `main.js`. The response headers should contain `X-Foo: value1` and `X-Bar: value2`.\n"
  },
  {
    "path": "examples/headers/array/app.js",
    "content": "\"use strict\";\n\nconst target = document.querySelector(\"#target\");\n\ntarget.classList.add(\"pass\");\ntarget.innerHTML = \"Success!\";\n"
  },
  {
    "path": "examples/headers/array/webpack.config.js",
    "content": "\"use strict\";\n\n// our setup function adds behind-the-scenes bits to the config that all of our\n// examples need\nconst { setup } = require(\"../../util\");\n\nmodule.exports = setup({\n  context: __dirname,\n  entry: \"./app.js\",\n  devServer: {\n    headers: [\n      {\n        key: \"X-Foo\",\n        value: \"value1\",\n      },\n      {\n        key: \"X-Bar\",\n        value: \"value2\",\n      },\n    ],\n  },\n});\n"
  },
  {
    "path": "examples/headers/function/README.md",
    "content": "# headers option as a function\n\nAdds headers to all responses.\n\n**webpack.config.js**\n\n```js\nmodule.exports = {\n  // ...\n  devServer: {\n    headers: () => ({ \"X-Custom-Header\": [\"key1=value1\", \"key2=value2\"] }),\n  },\n};\n```\n\nTo run this example use the following command:\n\n```console\nnpx webpack serve --open\n```\n\n## What should happen\n\n1. The script should open `http://localhost:8080/`.\n2. You should see the text on the page itself change to read `Success!`.\n3. Open the console in your browser's devtools and select the _Network_ tab.\n4. Find `main.js`. The response headers should contain `X-Custom-Header: key1=value1` and `X-Custom-Header: key2=value2`.\n"
  },
  {
    "path": "examples/headers/function/app.js",
    "content": "\"use strict\";\n\nconst target = document.querySelector(\"#target\");\n\ntarget.classList.add(\"pass\");\ntarget.innerHTML = \"Success!\";\n"
  },
  {
    "path": "examples/headers/function/webpack.config.js",
    "content": "\"use strict\";\n\n// our setup function adds behind-the-scenes bits to the config that all of our\n// examples need\nconst { setup } = require(\"../../util\");\n\nmodule.exports = setup({\n  context: __dirname,\n  entry: \"./app.js\",\n  devServer: {\n    headers: () => ({ \"X-Custom-Header\": [\"key1=value1\", \"key2=value2\"] }),\n  },\n});\n"
  },
  {
    "path": "examples/headers/object/README.md",
    "content": "# headers option as an object\n\nAdds headers to all responses.\n\n**webpack.config.js**\n\n```js\nmodule.exports = {\n  // ...\n  devServer: {\n    headers: {\n      \"X-Custom-Header\": \"yes\",\n    },\n  },\n};\n```\n\nTo run this example use the following command:\n\n```console\nnpx webpack serve --open\n```\n\n## What should happen\n\n1. The script should open `http://localhost:8080/`.\n2. You should see the text on the page itself change to read `Success!`.\n3. Open the console in your browser's devtools and select the _Network_ tab.\n4. Find `main.js`. The response headers should contain `X-Custom-Header: yes`.\n"
  },
  {
    "path": "examples/headers/object/app.js",
    "content": "\"use strict\";\n\nconst target = document.querySelector(\"#target\");\n\ntarget.classList.add(\"pass\");\ntarget.innerHTML = \"Success!\";\n"
  },
  {
    "path": "examples/headers/object/webpack.config.js",
    "content": "\"use strict\";\n\n// our setup function adds behind-the-scenes bits to the config that all of our\n// examples need\nconst { setup } = require(\"../../util\");\n\nmodule.exports = setup({\n  context: __dirname,\n  entry: \"./app.js\",\n  devServer: {\n    headers: {\n      \"X-Custom-Header\": \"yes\",\n    },\n  },\n});\n"
  },
  {
    "path": "examples/history-api-fallback/README.md",
    "content": "# historyApiFallback Option\n\nThis option enables [History API Fallback](https://github.com/bripkens/connect-history-api-fallback)\nsupport in `webpack-dev-server`, effectively asking the server to fallback to\n`index.html` in the event that a requested resource cannot be found.\n\n**webpack.config.js**\n\n```js\nmodule.exports = {\n  // ...\n  devServer: {\n    historyApiFallback: true,\n  },\n};\n```\n\nUsage via CLI:\n\n```console\nnpx webpack serve --open --history-api-fallback\n```\n\n## What Should Happen\n\n1. The script should open `http://0.0.0.0:8080/` in your default browser.\n2. You should see text on the page that reads `Current Path: /`.\n3. Navigate to `http://localhost:8080/foo-bar`.\n4. You should see text on the page that reads `Current Path: /foo-bar`.\n\n_Note: some URLs don't work by default. For example, if the url contains a dot (`/file.txt` in this example).\nBe sure to checkout the [connect-history-api-fallback](https://github.com/bripkens/connect-history-api-fallback)\noptions._\n\nTo allow `/file.txt` to fallback, update the `webpack.config.js` as follows:\n\n**webpack.config.js**\n\n```js\nmodule.exports = {\n  // ...\n  devServer: {\n    historyApiFallback: {\n      disableDotRule: true,\n    },\n  },\n};\n```\n\nUse the following command to run the example:\n\n```console\nnpx webpack serve --open\n```\n\n## What Should Happen\n\n1. The script should open `http://0.0.0.0:8080/` in your default browser.\n2. You should see text on the page that reads `Current Path: /`.\n3. Navigate to `http://localhost:8080/file.txt`.\n4. You should see text on the page that reads `Current Path: /file.txt`.\n"
  },
  {
    "path": "examples/history-api-fallback/app.js",
    "content": "\"use strict\";\n\nconst path = document.location.pathname;\nconst target = document.querySelector(\"#target\");\nconst style = document.createElement(\"style\");\nconst css = `table {\n    border-radius: 0.3rem;\n    border: 0.1rem solid #474747;\n    border-spacing: 0;\n    padding: 0;\n    width: 50%;\n  }\n\n  table td {\n    border-right: 0.1rem solid #474747;\n    padding: 0.5rem 1rem;\n  }\n\n  table tr td:last-child {\n    border-right: 0;\n    text-align: center;\n  }\n\n  table td.pass {\n    background: #f2f9f4;\n    color: #4db277;\n  }\n\n  table td.fail {\n    background: #f2dede;\n    color: #a94442;\n  }`;\n\nstyle.appendChild(document.createTextNode(css));\ndocument.head.appendChild(style);\ntarget.innerHTML = `Current Path: <code>${path}</code>`;\n\ndocument.addEventListener(\n  \"DOMContentLoaded\",\n  () => {\n    if (document.querySelector(\"#files\")) {\n      return;\n    }\n\n    const tests = [\n      { url: \"/\", name: \"index\", re: /^<!doctype html>/i },\n      { url: \"/test\", name: \"non-existent path\", re: /^<!doctype html>/i },\n      { url: \"/file.txt\", name: \"existing path\", re: /^file/ },\n    ];\n    const table = document.createElement(\"table\");\n    const tbody = document.createElement(\"tbody\");\n\n    table.id = \"files\";\n    table.appendChild(tbody);\n    target.parentNode.appendChild(table);\n\n    for (const test of tests) {\n      const tr = document.createElement(\"tr\");\n      tbody.appendChild(tr);\n      check(test.url, test.re, (res) => {\n        tr.innerHTML = `<td>${test.name}</td>`;\n        tr.innerHTML += `<td><a href=\"${test.url}\">${test.url}</a></td>`;\n        tr.innerHTML += `<td class=\"${res}\">${res}</td>`;\n      });\n    }\n  },\n  true,\n);\n\n/**\n * @param url\n * @param re\n * @param cb\n */\nfunction check(url, re, cb) {\n  const xhr = new XMLHttpRequest();\n  xhr.addEventListener(\"load\", () => {\n    cb(re.test(xhr.responseText) ? \"pass\" : \"fail\");\n  });\n  xhr.open(\"GET\", url);\n  xhr.send();\n}\n"
  },
  {
    "path": "examples/history-api-fallback/file.txt",
    "content": "file\n"
  },
  {
    "path": "examples/history-api-fallback/webpack.config.js",
    "content": "\"use strict\";\n\n// our setup function adds behind-the-scenes bits to the config that all of our\n// examples need\nconst { setup } = require(\"../util\");\n\nmodule.exports = setup({\n  context: __dirname,\n  entry: \"./app.js\",\n  devServer: {\n    historyApiFallback: true,\n  },\n});\n"
  },
  {
    "path": "examples/hmr/boolean/README.md",
    "content": "# Hot Module Reloading\n\nHot Module Replacement (HMR) exchanges, adds, or removes modules while an application is running, without a full reload of the page.\n\n## true\n\nEnable webpack's [Hot Module Replacement](https://webpack.js.org/concepts/hot-module-replacement/) feature:\n\n**webpack.config.js**\n\n```js\nmodule.exports = {\n  // ...\n  devServer: {\n    hot: true,\n  },\n};\n```\n\nUsage via CLI:\n\n```console\nnpx webpack serve --open --hot\n```\n\n## What Should Happen\n\n1. The script should open `http://localhost:8080/` in your default browser.\n2. In your editor, open `example.js` and change any part of the `innerHTML` string.\n3. Open the console in your browser's devtools.\n\nIn the devtools console you should see:\n\n```\n[webpack-dev-server] App updated. Recompiling...\n[webpack-dev-server] App hot update...\n[HMR] Checking for updates on the server...\n[HMR] Updated modules:\n[HMR]  - ./example.js\n[HMR] App is up to date.\n```\n\nYou should also see the text on the page itself change to match your edits in\n`example.js`.\n\n## false\n\nDisable webpack's [Hot Module Replacement](https://webpack.js.org/concepts/hot-module-replacement/) feature:\n\n**webpack.config.js**\n\n```js\nmodule.exports = {\n  // ...\n  devServer: {\n    hot: false,\n  },\n};\n```\n\nUsage via CLI:\n\n```console\nnpx webpack serve --open --no-hot\n```\n\n## What Should Happen\n\n1. The script should open `http://localhost:8080/` in your default browser.\n2. In your editor, open `example.js` and change any part of the `innerHTML` string.\n3. text on the page shouldn't change itself to match your edits in `example.js`, without reloading the page.\n"
  },
  {
    "path": "examples/hmr/boolean/app.js",
    "content": "\"use strict\";\n\nrequire(\"./example\");\n\nif (module.hot) {\n  module.hot.accept((err) => {\n    if (err) {\n      console.error(\"Cannot apply HMR update.\", err);\n    }\n  });\n}\n"
  },
  {
    "path": "examples/hmr/boolean/example.js",
    "content": "\"use strict\";\n\nconst target = document.querySelector(\"#target\");\n\ntarget.innerHTML =\n  \"Modify and save <code>/examples/hmr/example.js</code> to update this element without reloading the page.\";\n"
  },
  {
    "path": "examples/hmr/boolean/webpack.config.js",
    "content": "\"use strict\";\n\n// our setup function adds behind-the-scenes bits to the config that all of our\n// examples need\nconst { setup } = require(\"../../util\");\n\nmodule.exports = setup({\n  context: __dirname,\n  entry: \"./app.js\",\n  devServer: {\n    hot: true,\n  },\n});\n"
  },
  {
    "path": "examples/hmr/only/README.md",
    "content": "# Hot Module Reloading\n\nHot Module Replacement (HMR) exchanges, adds, or removes modules while an application is running, without a full reload of the page.\n\n## only\n\nEnables Hot Module Replacement without page refresh as a fallback in case of build failures.\n\n**webpack.config.js**\n\n```js\nmodule.exports = {\n  // ...\n  devServer: {\n    hot: \"only\",\n  },\n};\n```\n\nUsage via CLI:\n\n```console\nnpx webpack serve --open --hot only\n```\n\n## What Should Happen\n\n1. The script should open `http://localhost:8080/` in your default browser.\n2. In your editor, open `example.js` and change any part of the `innerHTML` string.\n3. Open the console in your browser's devtools.\n\nIn the devtools console you should see:\n\n```\n[webpack-dev-server] App updated. Recompiling...\n[webpack-dev-server] App hot update...\n[HMR] Checking for updates on the server...\n ⚠️ Ignored an update to unaccepted module ./example.js -> ./app.js\n[HMR] Nothing hot Updated.\n[HMR] App is up to date.\n```\n\n5. Refresh the page and see the text on the page itself change to match your edits in `example.js`.\n"
  },
  {
    "path": "examples/hmr/only/app.js",
    "content": "\"use strict\";\n\nrequire(\"./example\");\n\nif (module.hot) {\n  module.hot.accept((err) => {\n    if (err) {\n      console.error(\"Cannot apply HMR update.\", err);\n    }\n  });\n}\n"
  },
  {
    "path": "examples/hmr/only/example.js",
    "content": "\"use strict\";\n\nconst target = document.querySelector(\"#target\");\n\ntarget.innerHTML =\n  \"Modify and save <code>/examples/hmr/example.js</code> to update this element without reloading the page.\";\n"
  },
  {
    "path": "examples/hmr/only/webpack.config.js",
    "content": "\"use strict\";\n\n// our setup function adds behind-the-scenes bits to the config that all of our\n// examples need\nconst { setup } = require(\"../../util\");\n\nmodule.exports = setup({\n  context: __dirname,\n  entry: \"./app.js\",\n  devServer: {\n    hot: \"only\",\n  },\n});\n"
  },
  {
    "path": "examples/host-and-port/README.md",
    "content": "# Host and Port Options\n\nYou may choose to wish to change the host and port on which `webpack-dev-server`\nwill run. The `host` and `port` options allow for that.\n\n## host\n\n### IPv4\n\n**webpack.config.js**\n\n```js\nmodule.exports = {\n  // ...\n  devServer: {\n    host: \"0.0.0.0\",\n    port: 5000,\n  },\n};\n```\n\nUsage via CLI:\n\n```console\nnpx webpack serve --open --port 5000 --host 0.0.0.0\n```\n\n### IPv6\n\n_This also works with IPv6_\n\n**webpack.config.js**\n\n```js\nmodule.exports = {\n  // ...\n  devServer: {\n    host: \"::\",\n    port: 5000,\n  },\n};\n```\n\nUsage via CLI:\n\n```console\nnpx webpack serve --open --port 5000 --host ::\n```\n\n### local-ip\n\nSpecifying `local-ip` as `host` will try to resolve the `host` option as your local `IPv4` address if available, if `IPv4` is not available it will try to resolve your local `IPv6` address.\n\n```js\nmodule.exports = {\n  // ...\n  devServer: {\n    host: \"local-ip\",\n    port: 5000,\n  },\n};\n```\n\nUsage via CLI:\n\n```console\nnpx webpack serve --open --port 5000 --host local-ip\n```\n\n### local-ipv4\n\nSpecifying `local-ipv4` as `host` will try to resolve the `host` option as your local `IPv4` address.\n\n```js\nmodule.exports = {\n  // ...\n  devServer: {\n    host: \"local-ipv4\",\n    port: 5000,\n  },\n};\n```\n\nUsage via CLI:\n\n```console\nnpx webpack serve --open --port 5000 --host local-ipv4\n```\n\n### local-ipv6\n\nSpecifying `local-ipv6` as `host` will try to resolve the `host` option as your local `IPv6` address.\n\n```js\nmodule.exports = {\n  // ...\n  devServer: {\n    host: \"local-ipv6\",\n    port: 5000,\n  },\n};\n```\n\nUsage via CLI:\n\n```console\nnpx webpack serve --open --port 5000 --host local-ipv6\n```\n\n#### What Should Happen\n\n1. The script should open `http://0.0.0.0:5000/` if specifying the IPv4 option,\n   or `http://[::]:5000/` for IPv6, in your default browser.\n2. You should see the text on the page itself change to read `Success!`.\n\n## port\n\n### specific port\n\nTell the server to connect to a specific port with the following:\n\n```js\nmodule.exports = {\n  // ...\n  devServer: {\n    port: 9000,\n  },\n};\n```\n\nUsage via CLI:\n\n```console\nnpx webpack serve --open --port 9000\n```\n\n#### What Should Happen\n\n1. The script should open `http://localhost:9000/` in your default browser.\n2. You should see the text on the page itself change to read `Success!`.\n\n### auto\n\nSpecifying `auto` as `port` will try to connect the server to the default port `8080` and if not available it will automatically search for another free port.\n\n```js\nmodule.exports = {\n  // ...\n  devServer: {\n    port: \"auto\",\n  },\n};\n```\n\nUsage via CLI:\n\n```console\nnpx webpack serve --open --port auto\n```\n\n#### What Should Happen\n\n1. The script should open `http://localhost:8080/` in your default browser.\n2. You should see the text on the page itself change to read `Success!`.\n3. Keep the server open and switch to a new terminal window.\n4. Run the script once again.\n5. The script should open `http://localhost:8081/` (or any other port if it is not free) in your default browser.\n"
  },
  {
    "path": "examples/host-and-port/app.js",
    "content": "\"use strict\";\n\nconst target = document.querySelector(\"#target\");\n\ntarget.classList.add(\"pass\");\ntarget.innerHTML = \"Success!\";\n"
  },
  {
    "path": "examples/host-and-port/webpack.config.js",
    "content": "\"use strict\";\n\n// our setup function adds behind-the-scenes bits to the config that all of our\n// examples need\nconst { setup } = require(\"../util\");\n\nmodule.exports = setup({\n  context: __dirname,\n  entry: \"./app.js\",\n});\n"
  },
  {
    "path": "examples/ipc/README.md",
    "content": "# IPC\n\nThe Unix socket to listen to (instead of a [host](../host-and-port/README.md)).\n\n## true\n\nSetting it to `true` will listen to a socket at `/your-os-temp-dir/webpack-dev-server.sock`:\n\n**webpack.config.js**\n\n```js\nmodule.exports = {\n  // ...\n  devServer: {\n    ipc: true,\n  },\n};\n```\n\nUsage via CLI:\n\n```console\nnpx webpack serve --ipc\n```\n\n## string\n\nYou can also listen to a different socket with:\n\n**webpack.config.js**\n\n```js\nconst path = require(\"node:path\");\n\nmodule.exports = {\n  // ...\n  devServer: {\n    ipc: path.join(__dirname, \"my-socket.sock\"),\n  },\n};\n```\n\nUsage via CLI:\n\n```console\nnpx webpack serve --ipc ./my-socket.sock\n```\n\n## What Should Happen\n\n1. The script should listen to the socket provided.\n1. A proxy server should be created.\n1. Go to `http://localhost:8080/`, you should see the text on the page itself change to read `Success!`.\n"
  },
  {
    "path": "examples/ipc/app.js",
    "content": "\"use strict\";\n\nconst target = document.querySelector(\"#target\");\n\ntarget.classList.add(\"pass\");\ntarget.innerHTML = \"Success!\";\n"
  },
  {
    "path": "examples/ipc/webpack.config.js",
    "content": "\"use strict\";\n\nconst http = require(\"node:http\");\nconst httpProxy = require(\"http-proxy\");\n// our setup function adds behind-the-scenes bits to the config that all of our\n// examples need\nconst { setup } = require(\"../util\");\n\nmodule.exports = setup({\n  context: __dirname,\n  entry: \"./app.js\",\n  devServer: {\n    webSocketServer: \"ws\",\n    onAfterSetupMiddleware: (server) => {\n      const proxyPort = 8080;\n      const proxyHost = \"127.0.0.1\";\n      const proxy = httpProxy.createProxyServer({\n        target: { socketPath: server.options.ipc },\n      });\n\n      const proxyServer = http.createServer((request, response) => {\n        // You can define here your custom logic to handle the request\n        // and then proxy the request.\n        proxy.web(request, response);\n      });\n\n      proxyServer.on(\"upgrade\", (request, socket, head) => {\n        proxy.ws(request, socket, head);\n      });\n\n      proxyServer.listen(proxyPort, proxyHost);\n    },\n  },\n});\n"
  },
  {
    "path": "examples/multi-compiler/README.md",
    "content": "# Multi Compiler\n\n`webpack-dev-server` should be able to compile multiple webpack configs.\n\n```shell\nnpx webpack serve --open\n```\n\n## What Should Happen\n\n1. The script should open `http://localhost:8080/` in your default browser.\n2. You should see the text on the page itself change to read `Success!`.\n3. In `app.js` write code containing a syntax error and save the file.\n4. The page should now refresh and show a full screen error overlay, displaying\n   the syntax error.\n"
  },
  {
    "path": "examples/multi-compiler/app.js",
    "content": "\"use strict\";\n\nconst target = document.querySelector(\"#target\");\n\ntarget.classList.add(\"pass\");\ntarget.innerHTML = \"Success!\";\n\n// This results in an error:\n// if(!window) require(\"test\");\n"
  },
  {
    "path": "examples/multi-compiler/webpack.config.js",
    "content": "\"use strict\";\n\n// our setup function adds behind-the-scenes bits to the config that all of our\n// examples need\nconst { setup } = require(\"../util\");\n\nmodule.exports = [\n  setup({\n    context: __dirname,\n    entry: \"./app.js\",\n  }),\n];\n"
  },
  {
    "path": "examples/node-false/README.md",
    "content": "# Webpack `node` Option\n\n```console\nnpx webpack serve --open\n```\n\n## What should happen\n\n1. The script should open `http://localhost:8080/` in your default browser.\n2. You should see the text on the page itself change to read `Success!`.\n"
  },
  {
    "path": "examples/node-false/app.js",
    "content": "\"use strict\";\n\nconst target = document.querySelector(\"#target\");\n\ntarget.classList.add(\"pass\");\ntarget.innerHTML = \"Success!\";\n"
  },
  {
    "path": "examples/node-false/webpack.config.js",
    "content": "\"use strict\";\n\n// our setup function adds behind-the-scenes bits to the config that all of our\n// examples need\nconst { setup } = require(\"../util\");\n\nmodule.exports = setup({\n  context: __dirname,\n  entry: \"./app.js\",\n  node: false,\n});\n"
  },
  {
    "path": "examples/on-listening/README.md",
    "content": "# onListening\n\nProvides the ability to execute a custom function when webpack-dev-server starts listening for connections on a port.\n\n**webpack.config.js**\n\n```js\nmodule.exports = {\n  // ...\n  devServer: {\n    onListening: (devServer) => {\n      const { port } = devServer.server.address();\n      console.log(\"Listening on port:\", port);\n    },\n  },\n};\n```\n\nTo run this example use the following command:\n\n```console\nnpx webpack serve --open\n```\n\n## What Should Happen\n\n1. The script should open `http://localhost:8080/` in your default browser.\n2. You should see the text on the page itself change to read `Success!`.\n3. Check the terminal output, you should see `Listening on port: 8080` in the output.\n"
  },
  {
    "path": "examples/on-listening/app.js",
    "content": "\"use strict\";\n\nconst target = document.querySelector(\"#target\");\n\ntarget.classList.add(\"pass\");\ntarget.innerHTML = \"Success!\";\n"
  },
  {
    "path": "examples/on-listening/webpack.config.js",
    "content": "\"use strict\";\n\n// our setup function adds behind-the-scenes bits to the config that all of our\n// examples need\nconst { setup } = require(\"../util\");\n\nmodule.exports = setup({\n  context: __dirname,\n  entry: \"./app.js\",\n  devServer: {\n    onListening: (devServer) => {\n      const { port } = devServer.server.address();\n      console.log(\"Listening on port:\", port);\n    },\n  },\n});\n"
  },
  {
    "path": "examples/open-target/README.md",
    "content": "# Open Target Option\n\n## Open default generated URL in browser:\n\n**webpack.config.js**\n\n```js\nmodule.exports = {\n  // ...\n  devServer: {\n    open: {\n      target: \"<url>\",\n    },\n  },\n};\n```\n\nUsage via CLI:\n\n```\nnpx webpack serve --open-target <url>\n```\n\n## Open specific page in browser:\n\n**webpack.config.js**\n\n```js\nmodule.exports = {\n  // ...\n  devServer: {\n    open: {\n      target: \"/example.html#page1\",\n    },\n  },\n};\n```\n\nUsage via CLI:\n\n```\nnpx webpack serve --open-target /example.html#page1\n```\n\n## Open specific browser:\n\n**webpack.config.js**\n\n```js\nmodule.exports = {\n  // ...\n  devServer: {\n    open: {\n      app: \"firefox\",\n    },\n  },\n};\n```\n\nUsage via CLI:\n\n```\nnpx webpack serve --open-app-name firefox\n```\n\n## Open specific page in specific browser:\n\n**webpack.config.js**\n\n```js\nmodule.exports = {\n  // ...\n  devServer: {\n    open: {\n      target: \"/example.html#page1\",\n      app: \"firefox\",\n    },\n  },\n};\n```\n\nUsage via CLI:\n\n```\nnpx webpack serve --open-target example.html#page1 --open-app-name firefox\n```\n\nSome applications may consist of multiple pages. During development it may\nbe useful to directly open a particular page. The page to open may be specified\nas the argument to the `open-target` option.\n\n## What Should Happen\n\nThe script should open `http://localhost:8080/example.html#page1` in your\ndefault/specified browser. You should see the text on the page itself change to read `Success!`.\n"
  },
  {
    "path": "examples/open-target/app.js",
    "content": "\"use strict\";\n\nconst target = document.querySelector(\"#target\");\n\nif (globalThis.location.href.endsWith(\"example.html#page1\")) {\n  target.classList.add(\"pass\");\n  target.innerHTML = \"Success!\";\n} else {\n  target.classList.add(\"fail\");\n  target.innerHTML = \"Houston, we have a problem.\";\n}\n"
  },
  {
    "path": "examples/open-target/webpack.config.js",
    "content": "\"use strict\";\n\nconst HtmlWebpackPlugin = require(\"html-webpack-plugin\");\n// our setup function adds behind-the-scenes bits to the config that all of our\n// examples need\nconst { setup } = require(\"../util\");\n\nmodule.exports = setup({\n  context: __dirname,\n  entry: \"./app.js\",\n  plugins: [\n    new HtmlWebpackPlugin({\n      filename: \"example.html\",\n      template: \"../.assets/layout.html\",\n      title: \"Open Target / Example\",\n    }),\n  ],\n});\n"
  },
  {
    "path": "examples/open-target-multiple/README.md",
    "content": "# Open Target Option (Multiple)\n\n**webpack.config.js**\n\n```js\nmodule.exports = {\n  // ...\n  devServer: {\n    open: {\n      target: [\"/example1.html\", \"example2.html\"],\n    },\n  },\n};\n```\n\nUsage via CLI:\n\n```console\nnpx webpack serve --open-target example1.html --open-target example2.html\n```\n\nSome applications may consist of multiple pages. During development it may\nbe useful to directly open multiple pages at the same time. The pages to open\nmay be specified as the argument to the `open-target` option.\n\n## What Should Happen\n\nThe script should open `http://localhost:8080/example1.html` and\n`http://localhost:8080/example2.html` in your default browser.\nYou should see the text on the page itself change to read `Success!`.\n"
  },
  {
    "path": "examples/open-target-multiple/app1.js",
    "content": "\"use strict\";\n\nconst target = document.querySelector(\"#target\");\n\nif (globalThis.location.href.endsWith(\"example1.html\")) {\n  target.classList.add(\"pass\");\n  target.innerHTML = \"Success!\";\n} else {\n  target.classList.add(\"fail\");\n  target.innerHTML = \"Houston, we have a problem.\";\n}\n"
  },
  {
    "path": "examples/open-target-multiple/app2.js",
    "content": "\"use strict\";\n\nconst target = document.querySelector(\"#target\");\n\nif (globalThis.location.href.endsWith(\"example2.html\")) {\n  target.classList.add(\"pass\");\n  target.innerHTML = \"Success!\";\n} else {\n  target.classList.add(\"fail\");\n  target.innerHTML = \"Houston, we have a problem.\";\n}\n"
  },
  {
    "path": "examples/open-target-multiple/webpack.config.js",
    "content": "\"use strict\";\n\nconst HtmlWebpackPlugin = require(\"html-webpack-plugin\");\n// our setup function adds behind-the-scenes bits to the config that all of our\n// examples need\nconst { setup } = require(\"../util\");\n\nmodule.exports = [\n  setup({\n    context: __dirname,\n    entry: \"./app1.js\",\n    output: {\n      filename: \"app1.js\",\n    },\n    plugins: [\n      new HtmlWebpackPlugin({\n        filename: \"example1.html\",\n        template: \"../.assets/layout.html\",\n        title: \"Open Target (Multiple) / Example / Page 1\",\n      }),\n    ],\n  }),\n  setup({\n    context: __dirname,\n    entry: \"./app2.js\",\n    output: {\n      filename: \"app2.js\",\n    },\n    plugins: [\n      new HtmlWebpackPlugin({\n        filename: \"example2.html\",\n        template: \"../.assets/layout.html\",\n        title: \"Open Target (Multiple) / Example / Page 2\",\n      }),\n    ],\n  }),\n];\n"
  },
  {
    "path": "examples/proxy/README.md",
    "content": "# proxy\n\nProxying some URLs can be useful when you have a separate API backend development server and you want to send API requests on the same domain.\n\n**webpack.config.js**\n\n```js\nmodule.exports = {\n  // ...\n  devServer: {\n    proxy: {\n      \"/proxy\": {\n        target: \"http://localhost:5000\",\n      },\n    },\n  },\n};\n```\n\nTo run this example use the following command:\n\n```console\nnpx webpack serve --open\n```\n\n## What Should Happen\n\n1. The script start a proxy server on `http://localhost:5000/` and open `http://localhost:8080/` in your default browser.\n2. You should see the text on the page itself change to read `Success! Now visit /proxy`.\n3. Now visit the `/proxy` route by clicking on the `/proxy` text, you should see the text on the page itself change to read `response from proxy`.\n"
  },
  {
    "path": "examples/proxy/app.js",
    "content": "\"use strict\";\n\nconst target = document.querySelector(\"#target\");\n\ntarget.classList.add(\"pass\");\ntarget.innerHTML = \"Success! Now visit <a href='/proxy'>/proxy</a>\";\n"
  },
  {
    "path": "examples/proxy/webpack.config.js",
    "content": "\"use strict\";\n\nconst express = require(\"express\");\n// our setup function adds behind-the-scenes bits to the config that all of our\n// examples need\nconst { setup } = require(\"../util\");\n\n/**\n *\n */\nasync function listenProxyServer() {\n  const proxyApp = express();\n\n  proxyApp.get(\"/proxy\", (req, res) => {\n    res.send(\"response from proxy\");\n  });\n\n  await new Promise((resolve) => {\n    proxyApp.listen(5000, () => {\n      resolve();\n    });\n  });\n}\n\nmodule.exports = setup({\n  context: __dirname,\n  entry: \"./app.js\",\n  devServer: {\n    onBeforeSetupMiddleware: async () => {\n      await listenProxyServer();\n    },\n    proxy: {\n      \"/proxy\": {\n        target: \"http://localhost:5000\",\n      },\n    },\n  },\n});\n"
  },
  {
    "path": "examples/server/http2/README.md",
    "content": "# HTTP2 server\n\n**webpack.config.js**\n\n```js\nconst connect = require(\"connect\");\n\nmodule.exports = {\n  // ...\n  devServer: {\n    server: {\n      server: \"http2\",\n      app: () => connect(),\n    },\n  },\n};\n```\n\n## What Should Happen\n\n1. The script should open `https://localhost:8080/` in your default browser.\n2. You should see the text on the page itself change to read `Success!`.\n"
  },
  {
    "path": "examples/server/http2/app.js",
    "content": "\"use strict\";\n\nconst target = document.querySelector(\"#target\");\n\ntarget.classList.add(\"pass\");\ntarget.innerHTML = \"Success!\";\n"
  },
  {
    "path": "examples/server/http2/webpack.config.js",
    "content": "\"use strict\";\n\n// our setup function adds behind-the-scenes bits to the config that all of our\n// examples need\nconst connect = require(\"connect\");\nconst { setup } = require(\"../../util\");\n\nmodule.exports = setup({\n  context: __dirname,\n  entry: \"./app.js\",\n  devServer: {\n    server: \"http2\",\n    // Only `connect` supports `http2`\n    app: () => connect(),\n  },\n});\n"
  },
  {
    "path": "examples/server/https/README.md",
    "content": "# HTTPS server\n\nYou may choose to run `webpack-dev-server` on `https`.\n\nCustomize `server.options` configuration with the following options:\n\n- `key`: Path to an SSL key.\n- `pfx`: Path to an SSL pfx file.\n- `cert`: Path to an SSL certificate or content of an SSL certificate.\n- `ca`: Path to an SSL CA certificate or content of an SSL CA certificate.\n- `crl`: Path to PEM formatted CRLs (Certificate Revocation Lists) or content of PEM formatted CRLs (Certificate Revocation Lists).\n- `passphrase`: Passphrase for a pfx file.\n- `requestCert`: Request for an SSL certificate.\n\n```js\nmodule.exports = {\n  // ...\n  devServer: {\n    server: {\n      type: \"https\",\n      options: {\n        key: \"./ssl/server.key\",\n        pfx: \"./ssl/server.pfx\",\n        cert: \"./ssl/server.crt\",\n        ca: \"./ssl/ca.pem\",\n        passphrase: \"webpack-dev-server\",\n      },\n    },\n  },\n};\n```\n\nUsage via CLI:\n\n```console\nnpx webpack serve --open --server-type https --server-options-key ./ssl/server.key --server-options-cert ./ssl/server.crt --server-options-ca ./ssl/ca.pem --server-options-passphrase webpack-dev-server\n```\n\nYou can also directly pass the contents of respective files:\n\n```js\nconst fs = require(\"node:fs\");\nconst path = require(\"node:path\");\n\nmodule.exports = {\n  // ...\n  devServer: {\n    server: {\n      type: \"https\",\n      options: {\n        key: fs.readFileSync(path.join(__dirname, \"./ssl/server.key\")),\n        pfx: fs.readFileSync(path.join(__dirname, \"./ssl/server.pfx\")),\n        cert: fs.readFileSync(path.join(__dirname, \"./ssl/server.crt\")),\n        ca: fs.readFileSync(path.join(__dirname, \"./ssl/ca.pem\")),\n        passphrase: \"webpack-dev-server\",\n        requestCert: true,\n      },\n    },\n  },\n};\n```\n\n## What Should Happen\n\n1. The script should open `https://localhost:8080/` in your default browser.\n2. You should see the text on the page itself change to read `Success!`.\n"
  },
  {
    "path": "examples/server/https/app.js",
    "content": "\"use strict\";\n\nconst target = document.querySelector(\"#target\");\n\ntarget.classList.add(\"pass\");\ntarget.innerHTML = \"Success!\";\n"
  },
  {
    "path": "examples/server/https/ssl/ca.pem",
    "content": "-----BEGIN RSA PRIVATE KEY-----\nMIIEpQIBAAKCAQEAxAUVLFM+K3XDLQkBi7xt0s1Ip7JoHYDskzUDQNHjjMkUq5kv\nC/hf5Ei1J6qruJs3Xqg86Nl4+ed4ynUajAkRRibhp0P1SG1tgPssIK6iC7g8heYu\nDy9WkFuMie0513zjSn6bMEAK5TegxYAWCbaCZX/Fw9bDniabL/zuOv4sf8J4EPhs\nEENnH6sUE9HxPUgQmNt1Tbd0j1Cd5PXrSTLyfVPRh0m9QhXTUHuxsse8XSn9U2sw\nduxJTWRINmhffYn+O7kbJGI77xYr8u58Rsf3HCMI8DTKZNvQLChvvtLJ9ckyu7Q+\nT8emgklStASm3V2UtnriaK/IQEhgSdxqVRib3QIDAQABAoIBAGqWKPE1QnT3T+3J\nG+ITz9P0dDFbvWltlTZmeSJh/s2q+WZloUNtBxdmwbqT/1QecnkyGgyzVCjvSKsu\nCgVjWNVAhysgtNtxRT4BVflffBXLVH2qsBjpsLRGU6EcMXuPGTiEp3YRHNuO6Aj8\noP8fEsCGPc9DlJMGgxQRAKlrVF8TN/0j6Qk+YpS4MZ0YFQfBY+WdKu04Z8TVTplQ\ntTkiGpBI+Oj85jF59aQiizglJgADkAZ6zmbrctm/G9jPxh7JLS2cKI0ECZgK5yAc\npk10E1YWhoCksjr9arxy6fS9TiX9P15vv06k+s7c4c5X7XDm3X0GWeSbqBMJb8q7\nBhZQNzECgYEA4kAtymDBvFYiZFq7+lzQBRKAI1RCq7YqxlieumH0PSkie2bba3dW\nNVdTi7at8+GDB9/cHUPKzg/skfJllek57MZmusiVwB/Lmp/IlW8YyGShdYZ7zQsV\nKMWJljpky3BEDM5sb08wIkfrOkelI/S4Bqqabd9JzOMJzoTiVOlMam8CgYEA3ctN\nyonWz2bsnCUstQvQCLdI5a8Q7GJvlH2awephxGXIKGUuRmyyop0AnRnIBEWtOQV7\nyZjW32bU+Wt+2BJ247EyJiIQ4gT+T51t+v/Wt1YNbL3dSj9ttOvwYd4H2W4E7EIO\nGKIF4I39FM7r8NfG7YE7S1aVcnrqs01N3nhd9HMCgYEAjepbzpmqbAxLPk97oase\nAFB+d6qetz5ozklAJwDSRprKukTmVR5hwMup5/UKX/OQURwl4WVojKCIb3NwLPxC\nDTbVsUuoQv6uo6qeEr3A+dHFRQa6GP9eolhl2Ql/t+wPg0jn01oEgzxBXCkceNVD\nqUrR2yE4FYBD4nqPzVsZR5kCgYEA1yTi7NkQeldIpZ6Z43T18753A/Xx4JsLyWqd\nuAT3mV9x7V1Yqg++qGbLtZjQoPRFt85N6ZxMsqA5b0iK3mXq1auJDdx1rAlT9z6q\n9JM/YNAkbZsvEVq9vIYxw31w98T1GYhpzBM+yDhzir+9tv5YhQKa1dXDWi1JhWwz\nYN45pWkCgYEAxuVsJ4D4Th5o050ppWpnxM/WuMhIUKqaoFTVucMKFzn+g24y9pv5\nmiYdNYIk4Y+4pzHG6ZGZSHJcQ9BLui6H/nLQnqkgCb2lT5nfp7/GKdus7BdcjPGs\nfcV46yL7/X0m8nDb3hkwwrDTU4mKFkMrzKpjdZBsttEmW0Aw/3y36gU=\n-----END RSA PRIVATE KEY-----\n"
  },
  {
    "path": "examples/server/https/ssl/server.crt",
    "content": "-----BEGIN CERTIFICATE-----\nMIIDXTCCAkWgAwIBAgIJALz8gD/gAt0OMA0GCSqGSIb3DQEBCwUAMEUxCzAJBgNV\nBAYTAkFVMRMwEQYDVQQIDApTb21lLVN0YXRlMSEwHwYDVQQKDBhJbnRlcm5ldCBX\naWRnaXRzIFB0eSBMdGQwHhcNMTgxMDIzMTgyMTQ5WhcNMTkxMDIzMTgyMTQ5WjBF\nMQswCQYDVQQGEwJBVTETMBEGA1UECAwKU29tZS1TdGF0ZTEhMB8GA1UECgwYSW50\nZXJuZXQgV2lkZ2l0cyBQdHkgTHRkMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIB\nCgKCAQEAxAUVLFM+K3XDLQkBi7xt0s1Ip7JoHYDskzUDQNHjjMkUq5kvC/hf5Ei1\nJ6qruJs3Xqg86Nl4+ed4ynUajAkRRibhp0P1SG1tgPssIK6iC7g8heYuDy9WkFuM\nie0513zjSn6bMEAK5TegxYAWCbaCZX/Fw9bDniabL/zuOv4sf8J4EPhsEENnH6sU\nE9HxPUgQmNt1Tbd0j1Cd5PXrSTLyfVPRh0m9QhXTUHuxsse8XSn9U2swduxJTWRI\nNmhffYn+O7kbJGI77xYr8u58Rsf3HCMI8DTKZNvQLChvvtLJ9ckyu7Q+T8emgklS\ntASm3V2UtnriaK/IQEhgSdxqVRib3QIDAQABo1AwTjAdBgNVHQ4EFgQUDZBhVKdb\n3BRhLIhuuE522Vsul0IwHwYDVR0jBBgwFoAUDZBhVKdb3BRhLIhuuE522Vsul0Iw\nDAYDVR0TBAUwAwEB/zANBgkqhkiG9w0BAQsFAAOCAQEABh9WWZwWLgb9/DcTxL72\n6pI96t4jiF79Q+pPefkaIIi0mE6yodWrTAsBQu9I6bNRaEcCSoiXkP2bqskD/UGg\nLwUFgSrDOAA3UjdHw3QU5g2NocduG7mcFwA40TB98sOsxsUyYlzSyWzoiQWwPYwb\nhek1djuWkqPXsTjlj54PTPN/SjTFmo4p5Ip6nbRf2nOREl7v0rJpGbJvXiCMYyd+\nZv+j4mRjCGo8ysMR2HjCUGkYReLAgKyyz3M7i8vevJhKslyOmy6Txn4F0nPVumaU\nDDIy4xXPW1STWfsmSYJfYW3wa0wk+pJQ3j2cTzkPQQ8gwpvM3U9DJl43uwb37v6I\n7Q==\n-----END CERTIFICATE-----\n"
  },
  {
    "path": "examples/server/https/ssl/server.key",
    "content": "-----BEGIN PRIVATE KEY-----\nMIIEvwIBADANBgkqhkiG9w0BAQEFAASCBKkwggSlAgEAAoIBAQDEBRUsUz4rdcMt\nCQGLvG3SzUinsmgdgOyTNQNA0eOMyRSrmS8L+F/kSLUnqqu4mzdeqDzo2Xj553jK\ndRqMCRFGJuGnQ/VIbW2A+ywgrqILuDyF5i4PL1aQW4yJ7TnXfONKfpswQArlN6DF\ngBYJtoJlf8XD1sOeJpsv/O46/ix/wngQ+GwQQ2cfqxQT0fE9SBCY23VNt3SPUJ3k\n9etJMvJ9U9GHSb1CFdNQe7Gyx7xdKf1TazB27ElNZEg2aF99if47uRskYjvvFivy\n7nxGx/ccIwjwNMpk29AsKG++0sn1yTK7tD5Px6aCSVK0BKbdXZS2euJor8hASGBJ\n3GpVGJvdAgMBAAECggEAapYo8TVCdPdP7ckb4hPP0/R0MVu9aW2VNmZ5ImH+zar5\nZmWhQ20HF2bBupP/VB5yeTIaDLNUKO9Iqy4KBWNY1UCHKyC023FFPgFV+V98FctU\nfaqwGOmwtEZToRwxe48ZOISndhEc247oCPyg/x8SwIY9z0OUkwaDFBEAqWtUXxM3\n/SPpCT5ilLgxnRgVB8Fj5Z0q7ThnxNVOmVC1OSIakEj46PzmMXn1pCKLOCUmAAOQ\nBnrOZuty2b8b2M/GHsktLZwojQQJmArnIBymTXQTVhaGgKSyOv1qvHLp9L1OJf0/\nXm+/TqT6ztzhzlftcObdfQZZ5JuoEwlvyrsGFlA3MQKBgQDiQC3KYMG8ViJkWrv6\nXNAFEoAjVEKrtirGWJ66YfQ9KSJ7Zttrd1Y1V1OLtq3z4YMH39wdQ8rOD+yR8mWV\n6Tnsxma6yJXAH8uan8iVbxjIZKF1hnvNCxUoxYmWOmTLcEQMzmxvTzAiR+s6R6Uj\n9LgGqppt30nM4wnOhOJU6UxqbwKBgQDdy03KidbPZuycJSy1C9AIt0jlrxDsYm+U\nfZrB6mHEZcgoZS5GbLKinQCdGcgERa05BXvJmNbfZtT5a37YEnbjsTImIhDiBP5P\nnW36/9a3Vg1svd1KP2206/Bh3gfZbgTsQg4YogXgjf0Uzuvw18btgTtLVpVyeuqz\nTU3eeF30cwKBgQCN6lvOmapsDEs+T3uhqx4AUH53qp63PmjOSUAnANJGmsq6ROZV\nHmHAy6nn9Qpf85BRHCXhZWiMoIhvc3As/EINNtWxS6hC/q6jqp4SvcD50cVFBroY\n/16iWGXZCX+37A+DSOfTWgSDPEFcKRx41UOpStHbITgVgEPieo/NWxlHmQKBgQDX\nJOLs2RB6V0ilnpnjdPXzvncD9fHgmwvJap24BPeZX3HtXViqD76oZsu1mNCg9EW3\nzk3pnEyyoDlvSIreZerVq4kN3HWsCVP3Pqr0kz9g0CRtmy8RWr28hjHDfXD3xPUZ\niGnMEz7IOHOKv722/liFAprV1cNaLUmFbDNg3jmlaQKBgQDG5WwngPhOHmjTnSml\namfEz9a4yEhQqpqgVNW5wwoXOf6DbjL2m/maJh01giThj7inMcbpkZlIclxD0Eu6\nLof+ctCeqSAJvaVPmd+nv8Yp26zsF1yM8ax9xXjrIvv9fSbycNveGTDCsNNTiYoW\nQyvMqmN1kGy20SZbQDD/fLfqBQ==\n-----END PRIVATE KEY-----\n"
  },
  {
    "path": "examples/server/https/webpack.config.js",
    "content": "\"use strict\";\n\n// our setup function adds behind-the-scenes bits to the config that all of our\n// examples need\nconst { setup } = require(\"../../util\");\n\nmodule.exports = setup({\n  context: __dirname,\n  entry: \"./app.js\",\n  devServer: {\n    server: {\n      type: \"https\",\n      options: {\n        key: \"./ssl/server.key\",\n        pfx: \"./ssl/server.pfx\",\n        cert: \"./ssl/server.crt\",\n        ca: \"./ssl/ca.pem\",\n        passphrase: \"webpack-dev-server\",\n      },\n    },\n  },\n});\n"
  },
  {
    "path": "examples/server/spdy/README.md",
    "content": "# spdy server\n\nServe over HTTP/2 using [spdy](https://www.npmjs.com/package/spdy). This option is ignored for Node 15.0.0 and above, as `spdy` is broken for those versions.\n\n## HTTP/2 with a custom certificate:\n\nProvide your own certificate using the `server.options` configuration:\n\n- `key`: Path to an SSL key.\n- `pfx`: Path to an SSL pfx file.\n- `cert`: Path to an SSL certificate or content of an SSL certificate.\n- `ca`: Path to an SSL CA certificate or content of an SSL CA certificate.\n- `crl`: Path to PEM formatted CRLs (Certificate Revocation Lists) or content of PEM formatted CRLs (Certificate Revocation Lists).\n- `passphrase`: Passphrase for a pfx file.\n- `requestCert`: Request for an SSL certificate.\n\n```js\nmodule.exports = {\n  // ...\n  devServer: {\n    server: {\n      type: \"spdy\",\n      options: {\n        key: \"./ssl/server.key\",\n        pfx: \"./ssl/server.pfx\",\n        cert: \"./ssl/server.crt\",\n        ca: \"./ssl/ca.pem\",\n        passphrase: \"webpack-dev-server\",\n      },\n    },\n  },\n};\n```\n\nUsage via CLI:\n\n```console\nnpx webpack serve --open --server-type spdy --server-options-key ./ssl/server.key --server-options-cert ./ssl/server.crt --server-options-ca ./ssl/ca.pem --server-options-passphrase webpack-dev-server\n```\n\n## What Should Happen\n\n1. The script should open `https://localhost:8080/` in your default browser.\n2. You should see the text on the page itself change to read `Success!`.\n"
  },
  {
    "path": "examples/server/spdy/app.js",
    "content": "\"use strict\";\n\nconst target = document.querySelector(\"#target\");\n\ntarget.classList.add(\"pass\");\ntarget.innerHTML = \"Success!\";\n"
  },
  {
    "path": "examples/server/spdy/ssl/ca.pem",
    "content": "-----BEGIN RSA PRIVATE KEY-----\nMIIEpQIBAAKCAQEAxAUVLFM+K3XDLQkBi7xt0s1Ip7JoHYDskzUDQNHjjMkUq5kv\nC/hf5Ei1J6qruJs3Xqg86Nl4+ed4ynUajAkRRibhp0P1SG1tgPssIK6iC7g8heYu\nDy9WkFuMie0513zjSn6bMEAK5TegxYAWCbaCZX/Fw9bDniabL/zuOv4sf8J4EPhs\nEENnH6sUE9HxPUgQmNt1Tbd0j1Cd5PXrSTLyfVPRh0m9QhXTUHuxsse8XSn9U2sw\nduxJTWRINmhffYn+O7kbJGI77xYr8u58Rsf3HCMI8DTKZNvQLChvvtLJ9ckyu7Q+\nT8emgklStASm3V2UtnriaK/IQEhgSdxqVRib3QIDAQABAoIBAGqWKPE1QnT3T+3J\nG+ITz9P0dDFbvWltlTZmeSJh/s2q+WZloUNtBxdmwbqT/1QecnkyGgyzVCjvSKsu\nCgVjWNVAhysgtNtxRT4BVflffBXLVH2qsBjpsLRGU6EcMXuPGTiEp3YRHNuO6Aj8\noP8fEsCGPc9DlJMGgxQRAKlrVF8TN/0j6Qk+YpS4MZ0YFQfBY+WdKu04Z8TVTplQ\ntTkiGpBI+Oj85jF59aQiizglJgADkAZ6zmbrctm/G9jPxh7JLS2cKI0ECZgK5yAc\npk10E1YWhoCksjr9arxy6fS9TiX9P15vv06k+s7c4c5X7XDm3X0GWeSbqBMJb8q7\nBhZQNzECgYEA4kAtymDBvFYiZFq7+lzQBRKAI1RCq7YqxlieumH0PSkie2bba3dW\nNVdTi7at8+GDB9/cHUPKzg/skfJllek57MZmusiVwB/Lmp/IlW8YyGShdYZ7zQsV\nKMWJljpky3BEDM5sb08wIkfrOkelI/S4Bqqabd9JzOMJzoTiVOlMam8CgYEA3ctN\nyonWz2bsnCUstQvQCLdI5a8Q7GJvlH2awephxGXIKGUuRmyyop0AnRnIBEWtOQV7\nyZjW32bU+Wt+2BJ247EyJiIQ4gT+T51t+v/Wt1YNbL3dSj9ttOvwYd4H2W4E7EIO\nGKIF4I39FM7r8NfG7YE7S1aVcnrqs01N3nhd9HMCgYEAjepbzpmqbAxLPk97oase\nAFB+d6qetz5ozklAJwDSRprKukTmVR5hwMup5/UKX/OQURwl4WVojKCIb3NwLPxC\nDTbVsUuoQv6uo6qeEr3A+dHFRQa6GP9eolhl2Ql/t+wPg0jn01oEgzxBXCkceNVD\nqUrR2yE4FYBD4nqPzVsZR5kCgYEA1yTi7NkQeldIpZ6Z43T18753A/Xx4JsLyWqd\nuAT3mV9x7V1Yqg++qGbLtZjQoPRFt85N6ZxMsqA5b0iK3mXq1auJDdx1rAlT9z6q\n9JM/YNAkbZsvEVq9vIYxw31w98T1GYhpzBM+yDhzir+9tv5YhQKa1dXDWi1JhWwz\nYN45pWkCgYEAxuVsJ4D4Th5o050ppWpnxM/WuMhIUKqaoFTVucMKFzn+g24y9pv5\nmiYdNYIk4Y+4pzHG6ZGZSHJcQ9BLui6H/nLQnqkgCb2lT5nfp7/GKdus7BdcjPGs\nfcV46yL7/X0m8nDb3hkwwrDTU4mKFkMrzKpjdZBsttEmW0Aw/3y36gU=\n-----END RSA PRIVATE KEY-----\n"
  },
  {
    "path": "examples/server/spdy/ssl/server.crt",
    "content": "-----BEGIN CERTIFICATE-----\nMIIDXTCCAkWgAwIBAgIJALz8gD/gAt0OMA0GCSqGSIb3DQEBCwUAMEUxCzAJBgNV\nBAYTAkFVMRMwEQYDVQQIDApTb21lLVN0YXRlMSEwHwYDVQQKDBhJbnRlcm5ldCBX\naWRnaXRzIFB0eSBMdGQwHhcNMTgxMDIzMTgyMTQ5WhcNMTkxMDIzMTgyMTQ5WjBF\nMQswCQYDVQQGEwJBVTETMBEGA1UECAwKU29tZS1TdGF0ZTEhMB8GA1UECgwYSW50\nZXJuZXQgV2lkZ2l0cyBQdHkgTHRkMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIB\nCgKCAQEAxAUVLFM+K3XDLQkBi7xt0s1Ip7JoHYDskzUDQNHjjMkUq5kvC/hf5Ei1\nJ6qruJs3Xqg86Nl4+ed4ynUajAkRRibhp0P1SG1tgPssIK6iC7g8heYuDy9WkFuM\nie0513zjSn6bMEAK5TegxYAWCbaCZX/Fw9bDniabL/zuOv4sf8J4EPhsEENnH6sU\nE9HxPUgQmNt1Tbd0j1Cd5PXrSTLyfVPRh0m9QhXTUHuxsse8XSn9U2swduxJTWRI\nNmhffYn+O7kbJGI77xYr8u58Rsf3HCMI8DTKZNvQLChvvtLJ9ckyu7Q+T8emgklS\ntASm3V2UtnriaK/IQEhgSdxqVRib3QIDAQABo1AwTjAdBgNVHQ4EFgQUDZBhVKdb\n3BRhLIhuuE522Vsul0IwHwYDVR0jBBgwFoAUDZBhVKdb3BRhLIhuuE522Vsul0Iw\nDAYDVR0TBAUwAwEB/zANBgkqhkiG9w0BAQsFAAOCAQEABh9WWZwWLgb9/DcTxL72\n6pI96t4jiF79Q+pPefkaIIi0mE6yodWrTAsBQu9I6bNRaEcCSoiXkP2bqskD/UGg\nLwUFgSrDOAA3UjdHw3QU5g2NocduG7mcFwA40TB98sOsxsUyYlzSyWzoiQWwPYwb\nhek1djuWkqPXsTjlj54PTPN/SjTFmo4p5Ip6nbRf2nOREl7v0rJpGbJvXiCMYyd+\nZv+j4mRjCGo8ysMR2HjCUGkYReLAgKyyz3M7i8vevJhKslyOmy6Txn4F0nPVumaU\nDDIy4xXPW1STWfsmSYJfYW3wa0wk+pJQ3j2cTzkPQQ8gwpvM3U9DJl43uwb37v6I\n7Q==\n-----END CERTIFICATE-----\n"
  },
  {
    "path": "examples/server/spdy/ssl/server.key",
    "content": "-----BEGIN PRIVATE KEY-----\nMIIEvwIBADANBgkqhkiG9w0BAQEFAASCBKkwggSlAgEAAoIBAQDEBRUsUz4rdcMt\nCQGLvG3SzUinsmgdgOyTNQNA0eOMyRSrmS8L+F/kSLUnqqu4mzdeqDzo2Xj553jK\ndRqMCRFGJuGnQ/VIbW2A+ywgrqILuDyF5i4PL1aQW4yJ7TnXfONKfpswQArlN6DF\ngBYJtoJlf8XD1sOeJpsv/O46/ix/wngQ+GwQQ2cfqxQT0fE9SBCY23VNt3SPUJ3k\n9etJMvJ9U9GHSb1CFdNQe7Gyx7xdKf1TazB27ElNZEg2aF99if47uRskYjvvFivy\n7nxGx/ccIwjwNMpk29AsKG++0sn1yTK7tD5Px6aCSVK0BKbdXZS2euJor8hASGBJ\n3GpVGJvdAgMBAAECggEAapYo8TVCdPdP7ckb4hPP0/R0MVu9aW2VNmZ5ImH+zar5\nZmWhQ20HF2bBupP/VB5yeTIaDLNUKO9Iqy4KBWNY1UCHKyC023FFPgFV+V98FctU\nfaqwGOmwtEZToRwxe48ZOISndhEc247oCPyg/x8SwIY9z0OUkwaDFBEAqWtUXxM3\n/SPpCT5ilLgxnRgVB8Fj5Z0q7ThnxNVOmVC1OSIakEj46PzmMXn1pCKLOCUmAAOQ\nBnrOZuty2b8b2M/GHsktLZwojQQJmArnIBymTXQTVhaGgKSyOv1qvHLp9L1OJf0/\nXm+/TqT6ztzhzlftcObdfQZZ5JuoEwlvyrsGFlA3MQKBgQDiQC3KYMG8ViJkWrv6\nXNAFEoAjVEKrtirGWJ66YfQ9KSJ7Zttrd1Y1V1OLtq3z4YMH39wdQ8rOD+yR8mWV\n6Tnsxma6yJXAH8uan8iVbxjIZKF1hnvNCxUoxYmWOmTLcEQMzmxvTzAiR+s6R6Uj\n9LgGqppt30nM4wnOhOJU6UxqbwKBgQDdy03KidbPZuycJSy1C9AIt0jlrxDsYm+U\nfZrB6mHEZcgoZS5GbLKinQCdGcgERa05BXvJmNbfZtT5a37YEnbjsTImIhDiBP5P\nnW36/9a3Vg1svd1KP2206/Bh3gfZbgTsQg4YogXgjf0Uzuvw18btgTtLVpVyeuqz\nTU3eeF30cwKBgQCN6lvOmapsDEs+T3uhqx4AUH53qp63PmjOSUAnANJGmsq6ROZV\nHmHAy6nn9Qpf85BRHCXhZWiMoIhvc3As/EINNtWxS6hC/q6jqp4SvcD50cVFBroY\n/16iWGXZCX+37A+DSOfTWgSDPEFcKRx41UOpStHbITgVgEPieo/NWxlHmQKBgQDX\nJOLs2RB6V0ilnpnjdPXzvncD9fHgmwvJap24BPeZX3HtXViqD76oZsu1mNCg9EW3\nzk3pnEyyoDlvSIreZerVq4kN3HWsCVP3Pqr0kz9g0CRtmy8RWr28hjHDfXD3xPUZ\niGnMEz7IOHOKv722/liFAprV1cNaLUmFbDNg3jmlaQKBgQDG5WwngPhOHmjTnSml\namfEz9a4yEhQqpqgVNW5wwoXOf6DbjL2m/maJh01giThj7inMcbpkZlIclxD0Eu6\nLof+ctCeqSAJvaVPmd+nv8Yp26zsF1yM8ax9xXjrIvv9fSbycNveGTDCsNNTiYoW\nQyvMqmN1kGy20SZbQDD/fLfqBQ==\n-----END PRIVATE KEY-----\n"
  },
  {
    "path": "examples/server/spdy/webpack.config.js",
    "content": "\"use strict\";\n\n// our setup function adds behind-the-scenes bits to the config that all of our\n// examples need\nconst { setup } = require(\"../../util\");\n\nmodule.exports = setup({\n  context: __dirname,\n  entry: \"./app.js\",\n  devServer: {\n    server: {\n      type: \"spdy\",\n      options: {\n        key: \"./ssl/server.key\",\n        pfx: \"./ssl/server.pfx\",\n        cert: \"./ssl/server.crt\",\n        ca: \"./ssl/ca.pem\",\n        passphrase: \"webpack-dev-server\",\n      },\n    },\n  },\n});\n"
  },
  {
    "path": "examples/setup-middlewares/README.md",
    "content": "# setupMiddlewares\n\nProvides the ability to execute a custom function and apply custom middleware(s).\n\n**webpack.config.js**\n\n```js\nmodule.exports = {\n  // ...\n  devServer: {\n    setupMiddlewares: (middlewares, devServer) => {\n      if (!devServer) {\n        throw new Error(\"webpack-dev-server is not defined\");\n      }\n\n      devServer.app.get(\"/setup-middleware/some/path\", (_, response) => {\n        response.send(\"setup-middlewares option GET\");\n      });\n\n      middlewares.push({\n        name: \"hello-world-test-one\",\n        // `path` is optional\n        path: \"/foo/bar\",\n        middleware: (req, res) => {\n          res.send(\"Foo Bar!\");\n        },\n      });\n\n      middlewares.push((req, res) => {\n        res.send(\"Hello World!\");\n      });\n\n      return middlewares;\n    },\n  },\n};\n```\n\nTo run this example use the following command:\n\n```console\nnpx webpack serve --open\n```\n\n## What Should Happen\n\n1. The script should open `http://localhost:8080/` in your default browser.\n2. You should see the text on the page itself change to read `Success!`.\n3. Go to `http://localhost:8080/setup-middleware/some/path`, you should see the text on the page itself change to read `setup-middlewares option GET`.\n"
  },
  {
    "path": "examples/setup-middlewares/app.js",
    "content": "\"use strict\";\n\nconst target = document.querySelector(\"#target\");\n\ntarget.classList.add(\"pass\");\ntarget.innerHTML = \"Success!\";\n"
  },
  {
    "path": "examples/setup-middlewares/webpack.config.js",
    "content": "\"use strict\";\n\n// our setup function adds behind-the-scenes bits to the config that all of our\n// examples need\nconst { setup } = require(\"../util\");\n\nmodule.exports = setup({\n  context: __dirname,\n  entry: \"./app.js\",\n  devServer: {\n    setupMiddlewares: (middlewares, devServer) => {\n      if (!devServer) {\n        throw new Error(\"webpack-dev-server is not defined\");\n      }\n\n      devServer.app.get(\"/setup-middleware/some/path\", (_, response) => {\n        response.send(\"setup-middlewares option GET\");\n      });\n\n      middlewares.push({\n        name: \"hello-world-test-one\",\n        // `path` is optional\n        path: \"/foo/bar\",\n        middleware: (req, res) => {\n          res.send(\"Foo Bar!\");\n        },\n      });\n\n      middlewares.push((req, res) => {\n        res.send(\"Hello World!\");\n      });\n\n      return middlewares;\n    },\n  },\n});\n"
  },
  {
    "path": "examples/util.js",
    "content": "\"use strict\";\n\nconst path = require(\"node:path\");\nconst fs = require(\"graceful-fs\");\nconst HtmlWebpackPlugin = require(\"html-webpack-plugin\");\nconst { marked } = require(\"marked\");\nconst mime = require(\"mime\");\n\nmodule.exports = {\n  setup(config) {\n    const defaults = { mode: \"development\", plugins: [], devServer: {} };\n\n    if (config.entry) {\n      if (typeof config.entry === \"string\") {\n        config.entry = path.resolve(config.entry);\n      } else if (Array.isArray(config.entry)) {\n        config.entry = config.entry.map((entry) => path.resolve(entry));\n      } else if (typeof config.entry === \"object\") {\n        for (const [key, value] of Object.entries(config.entry)) {\n          config.entry[key] = path.resolve(value);\n        }\n      }\n    }\n\n    const result = { ...defaults, ...config };\n    const onBeforeSetupMiddleware = ({ app }) => {\n      app.use(\"/.assets/\", (req, res, next) => {\n        if (req.method !== \"GET\" && req.method !== \"HEAD\") {\n          next();\n          return;\n        }\n\n        res.setHeader(\"Content-Type\", mime.lookup(req.url));\n\n        const filename = path.join(__dirname, \"/.assets/\", req.url);\n        const stream = fs.createReadStream(filename);\n\n        stream.pipe(res);\n      });\n    };\n    const renderer = new marked.Renderer();\n    const { heading } = renderer;\n    const markedOptions = {\n      gfm: true,\n      tables: true,\n      breaks: false,\n      pedantic: false,\n      sanitize: false,\n      sanitizer: null,\n      mangle: true,\n      smartLists: false,\n      silent: false,\n      langPrefix: \"lang-\",\n      smartypants: false,\n      headerPrefix: \"\",\n      renderer,\n      xhtml: false,\n    };\n    const readme = fs.readFileSync(\"README.md\", \"utf8\");\n\n    let exampleTitle = \"\";\n\n    renderer.heading = function headingProxy(text, level, raw, slugger) {\n      if (level === 1 && !exampleTitle) {\n        exampleTitle = text;\n      }\n\n      return heading.call(this, text, level, raw, slugger);\n    };\n\n    marked.setOptions(markedOptions);\n\n    marked(readme, { renderer });\n\n    result.plugins.push(\n      new HtmlWebpackPlugin({\n        filename: \"index.html\",\n        template: path.join(__dirname, \".assets/layout.html\"),\n        title: exampleTitle,\n      }),\n    );\n\n    if (result.devServer.setupMiddlewares) {\n      const proxy = result.devServer.setupMiddlewares;\n      result.devServer.setupMiddlewares = (middlewares, devServer) => {\n        onBeforeSetupMiddleware(devServer);\n        return proxy(middlewares, devServer);\n      };\n    } else {\n      result.devServer.setupMiddlewares = (middlewares, devServer) => {\n        onBeforeSetupMiddleware(devServer);\n        return middlewares;\n      };\n    }\n\n    const output = {\n      path: path.dirname(module.parent.filename),\n    };\n\n    result.output = result.output ? { ...result.output, ...output } : output;\n\n    return result;\n  },\n};\n"
  },
  {
    "path": "examples/watch-static/README.md",
    "content": "# Static\n\n## Watching a single directory\n\n**webpack.config.js**\n\n```js\nmodule.exports = {\n  // ...\n  devServer: {\n    static: [\"assets\"],\n  },\n};\n```\n\nUsage via CLI:\n\n```console\nnpx webpack serve --static assets --open\n```\n\n### What Should Happen\n\n1. The script should open `http://localhost:8080/` in your default browser.\n2. You should see the text on the page itself change to read `Success!`.\n3. In your editor, edit `assets/index.html` and save your changes.\n4. The app should reload in the browser.\n\n## Watching an Array of Directories\n\n```js\n// webpack.conf.js\nmodule.exports = {\n  /* ... */\n  devServer: {\n    static: [\"assets\", \"css\"],\n  },\n};\n```\n\n```console\nnpx webpack serve --open\n```\n\nor via CLI only:\n\n```console\nnpx webpack serve --static assets --static css --open\n```\n\n### What Should Happen\n\n1. The script should open `http://localhost:8080/` in your default browser.\n2. You should see the text on the page itself change to read `Success!`.\n3. In your editor, edit `assets/index.html` and save your changes.\n4. The app should reload.\n5. In your editor, edit `css/styles.css` and save your changes.\n6. The app should reload.\n"
  },
  {
    "path": "examples/watch-static/app.js",
    "content": "\"use strict\";\n\nconst target = document.querySelector(\"#target\");\n\ntarget.classList.add(\"pass\");\ntarget.innerHTML = \"Success!\";\n"
  },
  {
    "path": "examples/watch-static/assets/index.html",
    "content": "<!doctype html>\n<html>\n  <head>\n    <link rel=\"stylesheet\" href=\"styles.css\" type=\"text/css\" charset=\"utf-8\" />\n  </head>\n  <body>\n    <h1>Static</h1>\n    <div id=\"mytext\"></div>\n    <script src=\"bundle.js\" type=\"text/javascript\" charset=\"utf-8\"></script>\n  </body>\n</html>\n"
  },
  {
    "path": "examples/watch-static/css/styles.css",
    "content": "h1 {\n  color: blue;\n}\n"
  },
  {
    "path": "examples/watch-static/webpack.config.js",
    "content": "\"use strict\";\n\n// our setup function adds behind-the-scenes bits to the config that all of our\n// examples need\nconst { setup } = require(\"../util\");\n\nmodule.exports = setup({\n  context: __dirname,\n  entry: \"./app.js\",\n  devServer: {\n    static: [\"assets\", \"css\"],\n  },\n});\n"
  },
  {
    "path": "examples/web-socket-server/sockjs/README.md",
    "content": "# web-socket-server (sockjs)\n\nTo create a custom server implementation.\n\n## sockjs\n\nThis mode uses [SockJS-node](https://github.com/sockjs/sockjs-node) as a server.\n\n**webpack.config.js**\n\n```js\nmodule.exports = {\n  // ...\n  devServer: {\n    webSocketServer: \"sockjs\",\n  },\n};\n```\n\nUsage via CLI:\n\n```console\nnpx webpack serve --web-socket-server-type sockjs --open\n```\n\n### What Should Happen\n\n1. The script should open `http://localhost:8080/` in your default browser.\n2. You should see the text on the page itself change to read `Success!`.\n"
  },
  {
    "path": "examples/web-socket-server/sockjs/app.js",
    "content": "\"use strict\";\n\nconst target = document.querySelector(\"#target\");\n\ntarget.classList.add(\"pass\");\ntarget.innerHTML = \"Success!\";\n"
  },
  {
    "path": "examples/web-socket-server/sockjs/webpack.config.js",
    "content": "\"use strict\";\n\n// our setup function adds behind-the-scenes bits to the config that all of our\n// examples need\nconst { setup } = require(\"../../util\");\n\nmodule.exports = setup({\n  context: __dirname,\n  entry: \"./app.js\",\n  devServer: {\n    webSocketServer: \"sockjs\",\n  },\n});\n"
  },
  {
    "path": "examples/web-socket-server/ws/README.md",
    "content": "# web-socket-server (ws)\n\nTo create a custom server implementation.\n\n## ws\n\nThis mode uses [ws](https://github.com/websockets/ws) as a server.\n\n**webpack.config.js**\n\n```js\nmodule.exports = {\n  // ...\n  devServer: {\n    webSocketServer: \"ws\",\n  },\n};\n```\n\nUsage via CLI:\n\n```console\nnpx webpack serve --web-socket-server-type ws --open\n```\n\n### What Should Happen\n\n1. The script should open `http://localhost:8080/` in your default browser.\n2. You should see the text on the page itself change to read `Success!`.\n"
  },
  {
    "path": "examples/web-socket-server/ws/app.js",
    "content": "\"use strict\";\n\nconst target = document.querySelector(\"#target\");\n\ntarget.classList.add(\"pass\");\ntarget.innerHTML = \"Success!\";\n"
  },
  {
    "path": "examples/web-socket-server/ws/webpack.config.js",
    "content": "\"use strict\";\n\n// our setup function adds behind-the-scenes bits to the config that all of our\n// examples need\nconst { setup } = require(\"../../util\");\n\nmodule.exports = setup({\n  context: __dirname,\n  entry: \"./app.js\",\n  devServer: {\n    webSocketServer: \"ws\",\n  },\n});\n"
  },
  {
    "path": "jest.config.js",
    "content": "\"use strict\";\n\nmodule.exports = {\n  testEnvironmentOptions: {\n    url: \"http://localhost/\",\n  },\n  collectCoverage: false,\n  coveragePathIgnorePatterns: [\n    \"/node_modules/\",\n    \"<rootDir>/test/\",\n    \"<rootDir>/client/\",\n  ],\n  testPathIgnorePatterns: [\"<rootDir>/bin/this/process-arguments.js\"],\n  snapshotResolver: \"<rootDir>/test/helpers/snapshotResolver.js\",\n  setupFilesAfterEnv: [\"<rootDir>/scripts/setupTest.js\"],\n  globalSetup: \"<rootDir>/scripts/globalSetupTest.js\",\n  moduleNameMapper: {\n    // This forces Jest/jest-environment-jsdom to use a Node+CommonJS version of uuid, not a Browser+ESM one\n    // See https://github.com/uuidjs/uuid/pull/616\n    //\n    // WARNING: if your dependency tree has multiple paths leading to uuid, this will force all of them to resolve to\n    // whichever one happens to be hoisted to your root node_modules folder. This makes it much more dangerous\n    // to consume future uuid upgrades. Consider using a custom resolver instead of moduleNameMapper.\n    //\n    // More:\n    // https://jestjs.io/docs/upgrading-to-jest28#packagejson-exports\n    // https://github.com/microsoft/accessibility-insights-web/pull/5421#issuecomment-1109168149\n    //\n    // FIXME: this uuid moduleNameMapper workaround can be removed after sockjs > uuid@v9 release\n    // https://github.com/uuidjs/uuid/pull/616#issuecomment-1206283882\n    // eslint-disable-next-line n/no-extraneous-require\n    \"^uuid$\": require.resolve(\"uuid\"),\n  },\n};\n"
  },
  {
    "path": "lib/Server.js",
    "content": "\"use strict\";\n\nconst os = require(\"node:os\");\nconst path = require(\"node:path\");\nconst url = require(\"node:url\");\nconst util = require(\"node:util\");\nconst fs = require(\"graceful-fs\");\nconst ipaddr = require(\"ipaddr.js\");\nconst { validate } = require(\"schema-utils\");\nconst schema = require(\"./options.json\");\n\n/** @typedef {import(\"schema-utils/declarations/validate\").Schema} Schema */\n/** @typedef {import(\"webpack\").Compiler} Compiler */\n/** @typedef {import(\"webpack\").MultiCompiler} MultiCompiler */\n/** @typedef {import(\"webpack\").Configuration} WebpackConfiguration */\n/** @typedef {import(\"webpack\").StatsOptions} StatsOptions */\n/** @typedef {import(\"webpack\").StatsCompilation} StatsCompilation */\n/** @typedef {import(\"webpack\").Stats} Stats */\n/** @typedef {import(\"webpack\").MultiStats} MultiStats */\n/** @typedef {import(\"os\").NetworkInterfaceInfo} NetworkInterfaceInfo */\n/** @typedef {import(\"chokidar\").WatchOptions} WatchOptions */\n/** @typedef {import(\"chokidar\").FSWatcher} FSWatcher */\n/** @typedef {import(\"connect-history-api-fallback\").Options} ConnectHistoryApiFallbackOptions */\n/** @typedef {import(\"bonjour-service\").Bonjour} Bonjour */\n/** @typedef {import(\"bonjour-service\").Service} BonjourOptions */\n/** @typedef {import(\"http-proxy-middleware\").RequestHandler} RequestHandler */\n/** @typedef {import(\"http-proxy-middleware\").Options} HttpProxyMiddlewareOptions */\n/** @typedef {import(\"http-proxy-middleware\").Filter} HttpProxyMiddlewareOptionsFilter */\n/** @typedef {import(\"serve-index\").Options} ServeIndexOptions */\n/** @typedef {import(\"serve-static\").ServeStaticOptions} ServeStaticOptions */\n/** @typedef {import(\"ipaddr.js\").IPv4} IPv4 */\n/** @typedef {import(\"ipaddr.js\").IPv6} IPv6 */\n/** @typedef {import(\"net\").Socket} Socket */\n/** @typedef {import(\"http\").Server} HTTPServer */\n/** @typedef {import(\"http\").IncomingMessage} IncomingMessage */\n/** @typedef {import(\"http\").ServerResponse} ServerResponse */\n/** @typedef {import(\"open\").Options} OpenOptions */\n/** @typedef {import(\"express\").Application} ExpressApplication */\n/** @typedef {import(\"express\").RequestHandler} ExpressRequestHandler */\n/** @typedef {import(\"express\").ErrorRequestHandler} ExpressErrorRequestHandler */\n/** @typedef {import(\"express\").Request} ExpressRequest */\n/** @typedef {import(\"express\").Response} ExpressResponse */\n\n// eslint-disable-next-line jsdoc/no-restricted-syntax\n/** @typedef {any} EXPECTED_ANY */\n\n/** @typedef {(err?: EXPECTED_ANY) => void} NextFunction */\n/** @typedef {(req: IncomingMessage, res: ServerResponse) => void} SimpleHandleFunction */\n/** @typedef {(req: IncomingMessage, res: ServerResponse, next: NextFunction) => void} NextHandleFunction */\n/** @typedef {(err: EXPECTED_ANY, req: IncomingMessage, res: ServerResponse, next: NextFunction) => void} ErrorHandleFunction */\n/** @typedef {SimpleHandleFunction | NextHandleFunction | ErrorHandleFunction} HandleFunction */\n\n/** @typedef {import(\"https\").ServerOptions & { spdy?: { plain?: boolean | undefined, ssl?: boolean | undefined, 'x-forwarded-for'?: string | undefined, protocol?: string | undefined, protocols?: string[] | undefined }}} ServerOptions */\n\n/**\n * @template {BasicApplication} [T=ExpressApplication]\n * @typedef {T extends ExpressApplication ? ExpressRequest : IncomingMessage} Request\n */\n/**\n * @template {BasicApplication} [T=ExpressApplication]\n * @typedef {T extends ExpressApplication ? ExpressResponse : ServerResponse} Response\n */\n\n/**\n * @template {Request} T\n * @template {Response} U\n * @typedef {import(\"webpack-dev-middleware\").Options<T, U>} DevMiddlewareOptions\n */\n\n/**\n * @template {Request} T\n * @template {Response} U\n * @typedef {import(\"webpack-dev-middleware\").Context<T, U>} DevMiddlewareContext\n */\n\n/**\n * @typedef {\"local-ip\" | \"local-ipv4\" | \"local-ipv6\" | string} Host\n */\n\n/**\n * @typedef {number | string | \"auto\"} Port\n */\n\n/**\n * @typedef {object} WatchFiles\n * @property {string | string[]} paths paths\n * @property {(WatchOptions & { aggregateTimeout?: number, ignored?: WatchOptions[\"ignored\"], poll?: number | boolean })=} options options\n */\n\n/**\n * @typedef {object} Static\n * @property {string=} directory directory\n * @property {(string | string[])=} publicPath public path\n * @property {(boolean | ServeIndexOptions)=} serveIndex serve index\n * @property {ServeStaticOptions=} staticOptions static options\n * @property {(boolean | WatchOptions & { aggregateTimeout?: number, ignored?: WatchOptions[\"ignored\"], poll?: number | boolean })=} watch watch and watch options\n */\n\n/**\n * @typedef {object} NormalizedStatic\n * @property {string} directory\n * @property {string[]} publicPath\n * @property {false | ServeIndexOptions} serveIndex\n * @property {ServeStaticOptions} staticOptions\n * @property {false | WatchOptions} watch\n */\n\n/**\n * @template {BasicApplication} [A=ExpressApplication]\n * @template {BasicServer} [S=import(\"http\").Server]\n * @typedef {\"http\" | \"https\" | \"spdy\" | \"http2\" | string | ((serverOptions: ServerOptions, application: A) => S)} ServerType\n */\n\n/**\n * @template {BasicApplication} [A=ExpressApplication]\n * @template {BasicServer} [S=import(\"http\").Server]\n * @typedef {object} ServerConfiguration\n * @property {ServerType<A, S>=} type type\n * @property {ServerOptions=} options options\n */\n\n/**\n * @typedef {object} WebSocketServerConfiguration\n * @property {(\"sockjs\" | \"ws\" | string | (() => WebSocketServerConfiguration))=} type type\n * @property {Record<string, EXPECTED_ANY>=} options options\n */\n\n/**\n * @typedef {(import(\"ws\").WebSocket | import(\"sockjs\").Connection & { send: import(\"ws\").WebSocket[\"send\"], terminate: import(\"ws\").WebSocket[\"terminate\"], ping: import(\"ws\").WebSocket[\"ping\"] }) & { isAlive?: boolean }} ClientConnection\n */\n\n/**\n * @typedef {import(\"ws\").WebSocketServer | import(\"sockjs\").Server & { close: import(\"ws\").WebSocketServer[\"close\"] }} WebSocketServer\n */\n\n/**\n * @typedef {{ implementation: WebSocketServer, clients: ClientConnection[] }} WebSocketServerImplementation\n */\n\n/**\n * @callback ByPass\n * @param {Request} req\n * @param {Response} res\n * @param {ProxyConfigArrayItem} proxyConfig\n */\n\n/**\n * @typedef {{ path?: HttpProxyMiddlewareOptionsFilter | undefined, context?: HttpProxyMiddlewareOptionsFilter | undefined } & { bypass?: ByPass } & HttpProxyMiddlewareOptions } ProxyConfigArrayItem\n */\n\n/**\n * @typedef {(ProxyConfigArrayItem | ((req?: Request | undefined, res?: Response | undefined, next?: NextFunction | undefined) => ProxyConfigArrayItem))[]} ProxyConfigArray\n */\n\n/**\n * @typedef {object} OpenApp\n * @property {string=} name\n * @property {string[]=} arguments\n */\n\n/**\n * @typedef {object} Open\n * @property {(string | string[] | OpenApp)=} app\n * @property {(string | string[])=} target target\n */\n\n/**\n * @typedef {object} NormalizedOpen\n * @property {string} target\n * @property {import(\"open\").Options} options\n */\n\n/**\n * @typedef {object} WebSocketURL\n * @property {string=} hostname hostname\n * @property {string=} password password\n * @property {string=} pathname pathname\n * @property {(number | string)=} port port\n * @property {string=} protocol protocol\n * @property {string=} username username\n */\n\n/**\n * @typedef {boolean | ((error: Error) => void)} OverlayMessageOptions\n */\n\n/**\n * @typedef {object} ClientConfiguration\n * @property {\"log\" | \"info\" | \"warn\" | \"error\" | \"none\" | \"verbose\"=} logging logging\n * @property {(boolean | { warnings?: OverlayMessageOptions, errors?: OverlayMessageOptions, runtimeErrors?: OverlayMessageOptions })=} overlay overlay\n * @property {boolean=} progress progress\n * @property {(boolean | number)=} reconnect reconnect\n * @property {(\"ws\" | \"sockjs\" | string)=} webSocketTransport web socket transport\n * @property {(string | WebSocketURL)=} webSocketURL web socket URL\n */\n\n/**\n * @typedef {Array<{ key: string; value: string }> | Record<string, string | string[]>} Headers\n */\n\n/**\n * @template {BasicApplication} [T=ExpressApplication]\n * @typedef {T extends ExpressApplication ? ExpressRequestHandler | ExpressErrorRequestHandler : HandleFunction} MiddlewareHandler\n */\n\n/**\n * @typedef {{ name?: string, path?: string, middleware: MiddlewareHandler }} MiddlewareObject\n */\n\n/**\n * @typedef {MiddlewareObject | MiddlewareHandler } Middleware\n */\n\n/** @typedef {import(\"net\").Server | import(\"tls\").Server} BasicServer */\n\n/**\n * @template {BasicApplication} [A=ExpressApplication]\n * @template {BasicServer} [S=import(\"http\").Server]\n * @typedef {object} Configuration\n * @property {(boolean | string)=} ipc\n * @property {Host=} host\n * @property {Port=} port\n * @property {(boolean | \"only\")=} hot\n * @property {boolean=} liveReload\n * @property {DevMiddlewareOptions<Request, Response>=} devMiddleware\n * @property {boolean=} compress\n * @property {(\"auto\" | \"all\" | string | string[])=} allowedHosts\n * @property {(boolean | ConnectHistoryApiFallbackOptions)=} historyApiFallback\n * @property {(boolean | Record<string, never> | BonjourOptions)=} bonjour\n * @property {(string | string[] | WatchFiles | Array<string | WatchFiles>)=} watchFiles\n * @property {(boolean | string | Static | Array<string | Static>)=} static\n * @property {(ServerType<A, S> | ServerConfiguration<A, S>)=} server\n * @property {(() => Promise<A>)=} app\n * @property {(boolean | \"sockjs\" | \"ws\" | string | WebSocketServerConfiguration)=} webSocketServer\n * @property {ProxyConfigArray=} proxy\n * @property {(boolean | string | Open | Array<string | Open>)=} open\n * @property {boolean=} setupExitSignals\n * @property {(boolean | ClientConfiguration)=} client\n * @property {(Headers | ((req: Request, res: Response, context: DevMiddlewareContext<Request, Response> | undefined) => Headers))=} headers\n * @property {((devServer: Server<A, S>) => void)=} onListening\n * @property {((middlewares: Middleware[], devServer: Server<A, S>) => Middleware[])=} setupMiddlewares\n */\n\nif (!process.env.WEBPACK_SERVE) {\n  process.env.WEBPACK_SERVE = \"true\";\n}\n\n/**\n * @template T\n * @typedef {() => T} FunctionReturning\n */\n\n/**\n * @template T\n * @param {FunctionReturning<T>} fn memorized function\n * @returns {FunctionReturning<T>} new function\n */\nconst memoize = (fn) => {\n  let cache = false;\n  /** @type {T | undefined} */\n  let result;\n  return () => {\n    if (cache) {\n      return /** @type {T} */ (result);\n    }\n\n    result = fn();\n    cache = true;\n    // Allow to clean up memory for fn\n    // and all dependent resources\n    /** @type {FunctionReturning<T> | undefined} */\n    (fn) = undefined;\n    return /** @type {T} */ (result);\n  };\n};\n\nconst getExpress = memoize(() => require(\"express\"));\n\n/**\n * @param {OverlayMessageOptions=} setting overlay settings\n * @returns {undefined | string | boolean} encoded overlay settings\n */\nconst encodeOverlaySettings = (setting) =>\n  typeof setting === \"function\"\n    ? encodeURIComponent(setting.toString())\n    : setting;\n\n// Working for overload, because typescript doesn't support this yes\n/**\n * @overload\n * @param {NextHandleFunction} fn function\n * @returns {BasicApplication} application\n */\n/**\n * @overload\n * @param {HandleFunction} fn function\n * @returns {BasicApplication} application\n */\n/**\n * @overload\n * @param {string} route route\n * @param {NextHandleFunction} fn function\n * @returns {BasicApplication} application\n */\n/**\n * @param {string} route route\n * @param {HandleFunction} fn function\n * @returns {BasicApplication} application\n */\n// eslint-disable-next-line no-unused-vars\nfunction useFn(route, fn) {\n  return /** @type {BasicApplication} */ ({});\n}\n\nconst DEFAULT_ALLOWED_PROTOCOLS = /^(file|.+-extension):/i;\n\n/**\n * @typedef {object} BasicApplication\n * @property {typeof useFn} use\n */\n\n/**\n * @template {BasicApplication} [A=ExpressApplication]\n * @template {BasicServer} [S=HTTPServer]\n */\nclass Server {\n  /**\n   * @param {Configuration<A, S>} options options\n   * @param {Compiler | MultiCompiler} compiler compiler\n   */\n  constructor(options, compiler) {\n    validate(/** @type {Schema} */ (schema), options, {\n      name: \"Dev Server\",\n      baseDataPath: \"options\",\n    });\n\n    this.compiler = compiler;\n    /**\n     * @type {ReturnType<Compiler[\"getInfrastructureLogger\"]>}\n     */\n    this.logger = this.compiler.getInfrastructureLogger(\"webpack-dev-server\");\n    this.options = options;\n    /**\n     * @type {FSWatcher[]}\n     */\n    this.staticWatchers = [];\n    /**\n     * @private\n     * @type {{ name: string | symbol, listener: (...args: EXPECTED_ANY[]) => void}[] }}\n     */\n    this.listeners = [];\n    // Keep track of websocket proxies for external websocket upgrade.\n    /**\n     * @private\n     * @type {RequestHandler[]}\n     */\n    this.webSocketProxies = [];\n    /**\n     * @type {Socket[]}\n     */\n    this.sockets = [];\n    /**\n     * @private\n     * @type {string | undefined}\n     */\n\n    this.currentHash = undefined;\n  }\n\n  static get schema() {\n    return schema;\n  }\n\n  /**\n   * @private\n   * @returns {StatsOptions} default stats options\n   */\n  static get DEFAULT_STATS() {\n    return {\n      all: false,\n      hash: true,\n      warnings: true,\n      errors: true,\n      errorDetails: false,\n    };\n  }\n\n  /**\n   * @param {string} URL url\n   * @returns {boolean} true when URL is absolute, otherwise false\n   */\n  static isAbsoluteURL(URL) {\n    // Don't match Windows paths `c:\\`\n    if (/^[a-zA-Z]:\\\\/.test(URL)) {\n      return false;\n    }\n\n    // Scheme: https://tools.ietf.org/html/rfc3986#section-3.1\n    // Absolute URL: https://tools.ietf.org/html/rfc3986#section-4.3\n    return /^[a-zA-Z][a-zA-Z\\d+\\-.]*:/.test(URL);\n  }\n\n  /**\n   * @param {string} gatewayOrFamily gateway or family\n   * @param {boolean=} isInternal ip should be internal\n   * @returns {string | undefined} resolved IP\n   */\n  static findIp(gatewayOrFamily, isInternal) {\n    if (gatewayOrFamily === \"v4\" || gatewayOrFamily === \"v6\") {\n      let host;\n\n      const networks = Object.values(os.networkInterfaces())\n        .flatMap((networks) => networks ?? [])\n        .filter((network) => {\n          if (!network || !network.address) {\n            return false;\n          }\n\n          if (network.family !== `IP${gatewayOrFamily}`) {\n            return false;\n          }\n\n          if (\n            typeof isInternal !== \"undefined\" &&\n            network.internal !== isInternal\n          ) {\n            return false;\n          }\n\n          if (gatewayOrFamily === \"v6\") {\n            const range = ipaddr.parse(network.address).range();\n\n            if (\n              range !== \"ipv4Mapped\" &&\n              range !== \"uniqueLocal\" &&\n              range !== \"loopback\"\n            ) {\n              return false;\n            }\n          }\n\n          return network.address;\n        });\n\n      if (networks.length > 0) {\n        // Take the first network found\n        host = networks[0].address;\n\n        if (host.includes(\":\")) {\n          host = `[${host}]`;\n        }\n      }\n\n      return host;\n    }\n\n    const gatewayIp = ipaddr.parse(gatewayOrFamily);\n\n    // Look for the matching interface in all local interfaces.\n    for (const addresses of Object.values(os.networkInterfaces())) {\n      for (const { cidr } of /** @type {NetworkInterfaceInfo[]} */ (\n        addresses\n      )) {\n        const net = ipaddr.parseCIDR(/** @type {string} */ (cidr));\n\n        if (\n          net[0] &&\n          net[0].kind() === gatewayIp.kind() &&\n          // eslint-disable-next-line unicorn/prefer-regexp-test\n          gatewayIp.match(net)\n        ) {\n          return net[0].toString();\n        }\n      }\n    }\n  }\n\n  // TODO remove me in the next major release, we have `findIp`\n  /**\n   * @param {\"v4\" | \"v6\"} family family\n   * @returns {Promise<string | undefined>} internal API\n   */\n  static async internalIP(family) {\n    return Server.findIp(family, false);\n  }\n\n  // TODO remove me in the next major release, we have `findIp`\n  /**\n   * @param {\"v4\" | \"v6\"} family family\n   * @returns {string | undefined} internal IP\n   */\n  static internalIPSync(family) {\n    return Server.findIp(family, false);\n  }\n\n  /**\n   * @param {Host} hostname hostname\n   * @returns {Promise<string>} resolved hostname\n   */\n  static async getHostname(hostname) {\n    if (hostname === \"local-ip\") {\n      return (\n        Server.findIp(\"v4\", false) || Server.findIp(\"v6\", false) || \"0.0.0.0\"\n      );\n    } else if (hostname === \"local-ipv4\") {\n      return Server.findIp(\"v4\", false) || \"0.0.0.0\";\n    } else if (hostname === \"local-ipv6\") {\n      return Server.findIp(\"v6\", false) || \"::\";\n    }\n\n    return hostname;\n  }\n\n  /**\n   * @param {Port} port port\n   * @param {string} host host\n   * @returns {Promise<number | string>} free port\n   */\n  static async getFreePort(port, host) {\n    if (typeof port !== \"undefined\" && port !== null && port !== \"auto\") {\n      return port;\n    }\n\n    const pRetry = (await import(\"p-retry\")).default;\n\n    const getPort = require(\"./getPort\");\n\n    const basePort =\n      typeof process.env.WEBPACK_DEV_SERVER_BASE_PORT !== \"undefined\"\n        ? Number.parseInt(process.env.WEBPACK_DEV_SERVER_BASE_PORT, 10)\n        : 8080;\n\n    // Try to find unused port and listen on it for 3 times,\n    // if port is not specified in options.\n    const defaultPortRetry =\n      typeof process.env.WEBPACK_DEV_SERVER_PORT_RETRY !== \"undefined\"\n        ? Number.parseInt(process.env.WEBPACK_DEV_SERVER_PORT_RETRY, 10)\n        : 3;\n\n    return pRetry(() => getPort(basePort, host), {\n      retries: defaultPortRetry,\n    });\n  }\n\n  /**\n   * @returns {string} path to cache dir\n   */\n  static findCacheDir() {\n    const cwd = process.cwd();\n\n    /**\n     * @type {string | undefined}\n     */\n    let dir = cwd;\n\n    for (;;) {\n      try {\n        if (fs.statSync(path.join(dir, \"package.json\")).isFile()) break;\n        // eslint-disable-next-line no-empty\n      } catch {}\n\n      const parent = path.dirname(dir);\n\n      if (dir === parent) {\n        dir = undefined;\n        break;\n      }\n\n      dir = parent;\n    }\n\n    if (!dir) {\n      return path.resolve(cwd, \".cache/webpack-dev-server\");\n    } else if (process.versions.pnp === \"1\") {\n      return path.resolve(dir, \".pnp/.cache/webpack-dev-server\");\n    } else if (process.versions.pnp === \"3\") {\n      return path.resolve(dir, \".yarn/.cache/webpack-dev-server\");\n    }\n\n    return path.resolve(dir, \"node_modules/.cache/webpack-dev-server\");\n  }\n\n  /**\n   * @private\n   * @param {Compiler} compiler compiler\n   * @returns {boolean} true when target is `web`, otherwise false\n   */\n  static isWebTarget(compiler) {\n    if (compiler.platform && compiler.platform.web) {\n      return compiler.platform.web;\n    }\n\n    // TODO improve for the next major version and keep only `webTargets` to fallback for old versions\n    if (\n      compiler.options.externalsPresets &&\n      compiler.options.externalsPresets.web\n    ) {\n      return true;\n    }\n\n    if (\n      compiler.options.resolve.conditionNames &&\n      compiler.options.resolve.conditionNames.includes(\"browser\")\n    ) {\n      return true;\n    }\n\n    const webTargets = [\n      \"web\",\n      \"webworker\",\n      \"electron-preload\",\n      \"electron-renderer\",\n      \"nwjs\",\n      \"node-webkit\",\n\n      undefined,\n      null,\n    ];\n\n    if (Array.isArray(compiler.options.target)) {\n      return compiler.options.target.some((r) => webTargets.includes(r));\n    }\n\n    return webTargets.includes(/** @type {string} */ (compiler.options.target));\n  }\n\n  /**\n   * @private\n   * @param {Compiler} compiler compiler\n   */\n  addAdditionalEntries(compiler) {\n    /**\n     * @type {string[]}\n     */\n    const additionalEntries = [];\n    const isWebTarget = Server.isWebTarget(compiler);\n\n    // TODO maybe empty client\n    if (this.options.client && isWebTarget) {\n      let webSocketURLStr = \"\";\n\n      if (this.options.webSocketServer) {\n        const webSocketURL =\n          /** @type {WebSocketURL} */\n          (\n            /** @type {ClientConfiguration} */\n            (this.options.client).webSocketURL\n          );\n        const webSocketServer =\n          /** @type {{ type: WebSocketServerConfiguration[\"type\"], options: NonNullable<WebSocketServerConfiguration[\"options\"]> }} */\n          (this.options.webSocketServer);\n        const searchParams = new URLSearchParams();\n\n        /** @type {string} */\n        let protocol;\n\n        // We are proxying dev server and need to specify custom `hostname`\n        if (typeof webSocketURL.protocol !== \"undefined\") {\n          protocol = webSocketURL.protocol;\n        } else {\n          protocol = this.isTlsServer ? \"wss:\" : \"ws:\";\n        }\n\n        searchParams.set(\"protocol\", protocol);\n\n        if (typeof webSocketURL.username !== \"undefined\") {\n          searchParams.set(\"username\", webSocketURL.username);\n        }\n\n        if (typeof webSocketURL.password !== \"undefined\") {\n          searchParams.set(\"password\", webSocketURL.password);\n        }\n\n        /** @type {string} */\n        let hostname;\n\n        // SockJS is not supported server mode, so `hostname` and `port` can't specified, let's ignore them\n        const isSockJSType = webSocketServer.type === \"sockjs\";\n        const isWebSocketServerHostDefined =\n          typeof webSocketServer.options.host !== \"undefined\";\n        const isWebSocketServerPortDefined =\n          typeof webSocketServer.options.port !== \"undefined\";\n\n        if (\n          isSockJSType &&\n          (isWebSocketServerHostDefined || isWebSocketServerPortDefined)\n        ) {\n          this.logger.warn(\n            \"SockJS only supports client mode and does not support custom hostname and port options. Please consider using 'ws' if you need to customize these options.\",\n          );\n        }\n\n        // We are proxying dev server and need to specify custom `hostname`\n        if (typeof webSocketURL.hostname !== \"undefined\") {\n          hostname = webSocketURL.hostname;\n        }\n        // Web socket server works on custom `hostname`, only for `ws` because `sock-js` is not support custom `hostname`\n        else if (isWebSocketServerHostDefined && !isSockJSType) {\n          hostname = webSocketServer.options.host;\n        }\n        // The `host` option is specified\n        else if (typeof this.options.host !== \"undefined\") {\n          hostname = this.options.host;\n        }\n        // The `port` option is not specified\n        else {\n          hostname = \"0.0.0.0\";\n        }\n\n        searchParams.set(\"hostname\", hostname);\n\n        /** @type {number | string} */\n        let port;\n\n        // We are proxying dev server and need to specify custom `port`\n        if (typeof webSocketURL.port !== \"undefined\") {\n          port = webSocketURL.port;\n        }\n        // Web socket server works on custom `port`, only for `ws` because `sock-js` is not support custom `port`\n        else if (isWebSocketServerPortDefined && !isSockJSType) {\n          port = webSocketServer.options.port;\n        }\n        // The `port` option is specified\n        else if (typeof this.options.port === \"number\") {\n          port = this.options.port;\n        }\n        // The `port` option is specified using `string`\n        else if (\n          typeof this.options.port === \"string\" &&\n          this.options.port !== \"auto\"\n        ) {\n          port = Number(this.options.port);\n        }\n        // The `port` option is not specified or set to `auto`\n        else {\n          port = \"0\";\n        }\n\n        searchParams.set(\"port\", String(port));\n\n        /** @type {string} */\n        let pathname = \"\";\n\n        // We are proxying dev server and need to specify custom `pathname`\n        if (typeof webSocketURL.pathname !== \"undefined\") {\n          pathname = webSocketURL.pathname;\n        }\n        // Web socket server works on custom `path`\n        else if (\n          typeof webSocketServer.options.prefix !== \"undefined\" ||\n          typeof webSocketServer.options.path !== \"undefined\"\n        ) {\n          pathname =\n            webSocketServer.options.prefix || webSocketServer.options.path;\n        }\n\n        searchParams.set(\"pathname\", pathname);\n\n        const client = /** @type {ClientConfiguration} */ (this.options.client);\n\n        if (typeof client.logging !== \"undefined\") {\n          searchParams.set(\"logging\", client.logging);\n        }\n\n        if (typeof client.progress !== \"undefined\") {\n          searchParams.set(\"progress\", String(client.progress));\n        }\n\n        if (typeof client.overlay !== \"undefined\") {\n          const overlayString =\n            typeof client.overlay === \"boolean\"\n              ? String(client.overlay)\n              : JSON.stringify({\n                  ...client.overlay,\n                  errors: encodeOverlaySettings(client.overlay.errors),\n                  warnings: encodeOverlaySettings(client.overlay.warnings),\n                  runtimeErrors: encodeOverlaySettings(\n                    client.overlay.runtimeErrors,\n                  ),\n                });\n\n          searchParams.set(\"overlay\", overlayString);\n        }\n\n        if (typeof client.reconnect !== \"undefined\") {\n          searchParams.set(\n            \"reconnect\",\n            typeof client.reconnect === \"number\"\n              ? String(client.reconnect)\n              : \"10\",\n          );\n        }\n\n        if (typeof this.options.hot !== \"undefined\") {\n          searchParams.set(\"hot\", String(this.options.hot));\n        }\n\n        if (typeof this.options.liveReload !== \"undefined\") {\n          searchParams.set(\"live-reload\", String(this.options.liveReload));\n        }\n\n        webSocketURLStr = searchParams.toString();\n      }\n\n      additionalEntries.push(`${this.getClientEntry()}?${webSocketURLStr}`);\n    }\n\n    const clientHotEntry = this.getClientHotEntry();\n    if (clientHotEntry) {\n      additionalEntries.push(clientHotEntry);\n    }\n\n    const webpack = compiler.webpack || require(\"webpack\");\n\n    // use a hook to add entries if available\n    for (const additionalEntry of additionalEntries) {\n      new webpack.EntryPlugin(compiler.context, additionalEntry, {\n        name: undefined,\n      }).apply(compiler);\n    }\n  }\n\n  /**\n   * @private\n   * @returns {Compiler[\"options\"]} compiler options\n   */\n  getCompilerOptions() {\n    if (\n      typeof (/** @type {MultiCompiler} */ (this.compiler).compilers) !==\n      \"undefined\"\n    ) {\n      if (/** @type {MultiCompiler} */ (this.compiler).compilers.length === 1) {\n        return (\n          /** @type {MultiCompiler} */\n          (this.compiler).compilers[0].options\n        );\n      }\n\n      // Configuration with the `devServer` options\n      const compilerWithDevServer =\n        /** @type {MultiCompiler} */\n        (this.compiler).compilers.find((config) => config.options.devServer);\n\n      if (compilerWithDevServer) {\n        return compilerWithDevServer.options;\n      }\n\n      // Configuration with `web` preset\n      const compilerWithWebPreset =\n        /** @type {MultiCompiler} */\n        (this.compiler).compilers.find(\n          (config) =>\n            (config.options.externalsPresets &&\n              config.options.externalsPresets.web) ||\n            [\n              \"web\",\n              \"webworker\",\n              \"electron-preload\",\n              \"electron-renderer\",\n              \"node-webkit\",\n\n              undefined,\n              null,\n            ].includes(/** @type {string} */ (config.options.target)),\n        );\n\n      if (compilerWithWebPreset) {\n        return compilerWithWebPreset.options;\n      }\n\n      // Fallback\n      return /** @type {MultiCompiler} */ (this.compiler).compilers[0].options;\n    }\n\n    return /** @type {Compiler} */ (this.compiler).options;\n  }\n\n  /**\n   * @private\n   * @returns {Promise<void>}\n   */\n  async normalizeOptions() {\n    const { options } = this;\n    const compilerOptions = this.getCompilerOptions();\n    const compilerWatchOptions = compilerOptions.watchOptions;\n    /**\n     * @param {WatchOptions & { aggregateTimeout?: number, ignored?: WatchOptions[\"ignored\"], poll?: number | boolean }} watchOptions watch options\n     * @returns {WatchOptions} normalized watch options\n     */\n    const getWatchOptions = (watchOptions = {}) => {\n      const getPolling = () => {\n        if (typeof watchOptions.usePolling !== \"undefined\") {\n          return watchOptions.usePolling;\n        }\n\n        if (typeof watchOptions.poll !== \"undefined\") {\n          return Boolean(watchOptions.poll);\n        }\n\n        if (typeof compilerWatchOptions.poll !== \"undefined\") {\n          return Boolean(compilerWatchOptions.poll);\n        }\n\n        return false;\n      };\n      const getInterval = () => {\n        if (typeof watchOptions.interval !== \"undefined\") {\n          return watchOptions.interval;\n        }\n\n        if (typeof watchOptions.poll === \"number\") {\n          return watchOptions.poll;\n        }\n\n        if (typeof compilerWatchOptions.poll === \"number\") {\n          return compilerWatchOptions.poll;\n        }\n      };\n\n      const usePolling = getPolling();\n      const interval = getInterval();\n      const { poll, ...rest } = watchOptions;\n\n      return {\n        ignoreInitial: true,\n        persistent: true,\n        followSymlinks: false,\n        atomic: false,\n        alwaysStat: true,\n        ignorePermissionErrors: true,\n        // Respect options from compiler watchOptions\n        usePolling,\n        interval,\n        ignored: watchOptions.ignored,\n        // TODO: we respect these options for all watch options and allow developers to pass them to chokidar, but chokidar doesn't have these options maybe we need revisit that in future\n        ...rest,\n      };\n    };\n    /**\n     * @param {(string | Static | undefined)=} optionsForStatic for static\n     * @returns {NormalizedStatic} normalized options for static\n     */\n    const getStaticItem = (optionsForStatic) => {\n      const getDefaultStaticOptions = () => ({\n        directory: path.join(process.cwd(), \"public\"),\n        staticOptions: {},\n        publicPath: [\"/\"],\n        serveIndex: { icons: true },\n        watch: getWatchOptions(),\n      });\n\n      /** @type {NormalizedStatic} */\n      let item;\n\n      if (typeof optionsForStatic === \"undefined\") {\n        item = getDefaultStaticOptions();\n      } else if (typeof optionsForStatic === \"string\") {\n        item = {\n          ...getDefaultStaticOptions(),\n          directory: optionsForStatic,\n        };\n      } else {\n        const def = getDefaultStaticOptions();\n\n        item = {\n          directory:\n            typeof optionsForStatic.directory !== \"undefined\"\n              ? optionsForStatic.directory\n              : def.directory,\n          staticOptions:\n            typeof optionsForStatic.staticOptions !== \"undefined\"\n              ? { ...def.staticOptions, ...optionsForStatic.staticOptions }\n              : def.staticOptions,\n          publicPath:\n            typeof optionsForStatic.publicPath !== \"undefined\"\n              ? Array.isArray(optionsForStatic.publicPath)\n                ? optionsForStatic.publicPath\n                : [optionsForStatic.publicPath]\n              : def.publicPath,\n          serveIndex:\n            // Check if 'serveIndex' property is defined in 'optionsForStatic'\n            // If 'serveIndex' is a boolean and true, use default 'serveIndex'\n            // If 'serveIndex' is an object, merge its properties with default 'serveIndex'\n            // If 'serveIndex' is neither a boolean true nor an object, use it as-is\n            // If 'serveIndex' is not defined in 'optionsForStatic', use default 'serveIndex'\n            typeof optionsForStatic.serveIndex !== \"undefined\"\n              ? typeof optionsForStatic.serveIndex === \"boolean\" &&\n                optionsForStatic.serveIndex\n                ? def.serveIndex\n                : typeof optionsForStatic.serveIndex === \"object\"\n                  ? { ...def.serveIndex, ...optionsForStatic.serveIndex }\n                  : optionsForStatic.serveIndex\n              : def.serveIndex,\n          watch:\n            typeof optionsForStatic.watch !== \"undefined\"\n              ? typeof optionsForStatic.watch === \"boolean\"\n                ? optionsForStatic.watch\n                  ? def.watch\n                  : false\n                : getWatchOptions(optionsForStatic.watch)\n              : def.watch,\n        };\n      }\n\n      if (Server.isAbsoluteURL(item.directory)) {\n        throw new Error(\"Using a URL as static.directory is not supported\");\n      }\n\n      return item;\n    };\n\n    if (typeof options.allowedHosts === \"undefined\") {\n      // AllowedHosts allows some default hosts picked from `options.host` or `webSocketURL.hostname` and `localhost`\n      options.allowedHosts = \"auto\";\n    }\n    // We store allowedHosts as array when supplied as string\n    else if (\n      typeof options.allowedHosts === \"string\" &&\n      options.allowedHosts !== \"auto\" &&\n      options.allowedHosts !== \"all\"\n    ) {\n      options.allowedHosts = [options.allowedHosts];\n    }\n    // CLI pass options as array, we should normalize them\n    else if (\n      Array.isArray(options.allowedHosts) &&\n      options.allowedHosts.includes(\"all\")\n    ) {\n      options.allowedHosts = \"all\";\n    }\n\n    if (typeof options.bonjour === \"undefined\") {\n      options.bonjour = false;\n    } else if (typeof options.bonjour === \"boolean\") {\n      options.bonjour = options.bonjour ? {} : false;\n    }\n\n    if (\n      typeof options.client === \"undefined\" ||\n      (typeof options.client === \"object\" && options.client !== null)\n    ) {\n      if (!options.client) {\n        options.client = {};\n      }\n\n      if (typeof options.client.webSocketURL === \"undefined\") {\n        options.client.webSocketURL = {};\n      } else if (typeof options.client.webSocketURL === \"string\") {\n        const parsedURL = new URL(options.client.webSocketURL);\n\n        options.client.webSocketURL = {\n          protocol: parsedURL.protocol,\n          hostname: parsedURL.hostname,\n          port: parsedURL.port.length > 0 ? Number(parsedURL.port) : \"\",\n          pathname: parsedURL.pathname,\n          username: parsedURL.username,\n          password: parsedURL.password,\n        };\n      } else if (typeof options.client.webSocketURL.port === \"string\") {\n        options.client.webSocketURL.port = Number(\n          options.client.webSocketURL.port,\n        );\n      }\n\n      // Enable client overlay by default\n      if (typeof options.client.overlay === \"undefined\") {\n        options.client.overlay = true;\n      } else if (typeof options.client.overlay !== \"boolean\") {\n        options.client.overlay = {\n          errors: true,\n          warnings: true,\n          ...options.client.overlay,\n        };\n      }\n\n      if (typeof options.client.reconnect === \"undefined\") {\n        options.client.reconnect = 10;\n      } else if (options.client.reconnect === true) {\n        options.client.reconnect = Infinity;\n      } else if (options.client.reconnect === false) {\n        options.client.reconnect = 0;\n      }\n\n      // Respect infrastructureLogging.level\n      if (typeof options.client.logging === \"undefined\") {\n        options.client.logging = compilerOptions.infrastructureLogging\n          ? compilerOptions.infrastructureLogging.level\n          : \"info\";\n      }\n    }\n\n    if (typeof options.compress === \"undefined\") {\n      options.compress = true;\n    }\n\n    if (typeof options.devMiddleware === \"undefined\") {\n      options.devMiddleware = {};\n    }\n\n    // No need to normalize `headers`\n\n    if (typeof options.historyApiFallback === \"undefined\") {\n      options.historyApiFallback = false;\n    } else if (\n      typeof options.historyApiFallback === \"boolean\" &&\n      options.historyApiFallback\n    ) {\n      options.historyApiFallback = {};\n    }\n\n    // No need to normalize `host`\n\n    options.hot =\n      typeof options.hot === \"boolean\" || options.hot === \"only\"\n        ? options.hot\n        : true;\n\n    if (\n      typeof options.server === \"function\" ||\n      typeof options.server === \"string\"\n    ) {\n      options.server = {\n        type: options.server,\n        options: {},\n      };\n    } else {\n      const serverOptions =\n        /** @type {ServerConfiguration<A, S>} */\n        (options.server || {});\n\n      options.server = {\n        type: serverOptions.type || \"http\",\n        options: { ...serverOptions.options },\n      };\n    }\n\n    const serverOptions = /** @type {ServerOptions} */ (options.server.options);\n\n    if (\n      options.server.type === \"spdy\" &&\n      typeof serverOptions.spdy === \"undefined\"\n    ) {\n      serverOptions.spdy = { protocols: [\"h2\", \"http/1.1\"] };\n    }\n\n    if (\n      options.server.type === \"https\" ||\n      options.server.type === \"http2\" ||\n      options.server.type === \"spdy\"\n    ) {\n      if (typeof serverOptions.requestCert === \"undefined\") {\n        serverOptions.requestCert = false;\n      }\n\n      const httpsProperties =\n        /** @type {Array<keyof ServerOptions>} */\n        ([\"ca\", \"cert\", \"crl\", \"key\", \"pfx\"]);\n\n      for (const property_ of httpsProperties) {\n        const property = /** @type {keyof ServerOptions} */ (property_);\n\n        if (typeof serverOptions[property] === \"undefined\") {\n          continue;\n        }\n\n        const value = serverOptions[property];\n        /**\n         * @param {string | Buffer | undefined} item file to read\n         * @returns {string | Buffer | undefined} content of file\n         */\n        const readFile = (item) => {\n          if (\n            Buffer.isBuffer(item) ||\n            (typeof item === \"object\" && item !== null && !Array.isArray(item))\n          ) {\n            return item;\n          }\n\n          if (item) {\n            let stats = null;\n\n            try {\n              stats = fs.lstatSync(fs.realpathSync(item)).isFile();\n            } catch {\n              // Ignore error\n            }\n\n            // It is a file\n            return stats ? fs.readFileSync(item) : item;\n          }\n        };\n\n        /** @type {EXPECTED_ANY} */\n        (serverOptions)[property] = Array.isArray(value)\n          ? value.map((item) =>\n              readFile(\n                /** @type {string | Buffer | undefined} */\n                (item),\n              ),\n            )\n          : readFile(\n              /** @type {string | Buffer | undefined} */\n              (value),\n            );\n      }\n\n      let fakeCert;\n\n      if (!serverOptions.key || !serverOptions.cert) {\n        const certificateDir = Server.findCacheDir();\n        const certificatePath = path.join(certificateDir, \"server.pem\");\n        let certificateExists;\n\n        try {\n          const certificate = await fs.promises.stat(certificatePath);\n          certificateExists = certificate.isFile();\n        } catch {\n          certificateExists = false;\n        }\n\n        if (certificateExists) {\n          const certificateTtl = 1000 * 60 * 60 * 24;\n          const certificateStat = await fs.promises.stat(certificatePath);\n          const now = Date.now();\n\n          // cert is more than 30 days old, kill it with fire\n          if ((now - Number(certificateStat.ctime)) / certificateTtl > 30) {\n            this.logger.info(\n              \"SSL certificate is more than 30 days old. Removing...\",\n            );\n\n            await fs.promises.rm(certificatePath, { recursive: true });\n\n            certificateExists = false;\n          }\n        }\n\n        if (!certificateExists) {\n          this.logger.info(\"Generating SSL certificate...\");\n\n          const selfsigned = require(\"selfsigned\");\n\n          const attributes = [{ name: \"commonName\", value: \"localhost\" }];\n          const notBeforeDate = new Date();\n          const notAfterDate = new Date();\n          notAfterDate.setDate(notAfterDate.getDate() + 30);\n          const pems = await selfsigned.generate(attributes, {\n            algorithm: \"sha256\",\n            keySize: 2048,\n            notBeforeDate,\n            notAfterDate,\n            extensions: [\n              {\n                name: \"basicConstraints\",\n                cA: true,\n              },\n              {\n                name: \"keyUsage\",\n                keyCertSign: true,\n                digitalSignature: true,\n                nonRepudiation: true,\n                keyEncipherment: true,\n                dataEncipherment: true,\n              },\n              {\n                name: \"extKeyUsage\",\n                serverAuth: true,\n                clientAuth: true,\n                codeSigning: true,\n                timeStamping: true,\n              },\n              {\n                name: \"subjectAltName\",\n                altNames: [\n                  {\n                    // type 2 is DNS\n                    type: 2,\n                    value: \"localhost\",\n                  },\n                  {\n                    type: 2,\n                    value: \"localhost.localdomain\",\n                  },\n                  {\n                    type: 2,\n                    value: \"lvh.me\",\n                  },\n                  {\n                    type: 2,\n                    value: \"*.lvh.me\",\n                  },\n                  {\n                    type: 2,\n                    value: \"[::1]\",\n                  },\n                  {\n                    // type 7 is IP\n                    type: 7,\n                    ip: \"127.0.0.1\",\n                  },\n                  {\n                    type: 7,\n                    ip: \"fe80::1\",\n                  },\n                ],\n              },\n            ],\n          });\n\n          await fs.promises.mkdir(certificateDir, { recursive: true });\n\n          await fs.promises.writeFile(\n            certificatePath,\n            pems.private + pems.cert,\n            {\n              encoding: \"utf8\",\n            },\n          );\n        }\n\n        fakeCert = await fs.promises.readFile(certificatePath);\n\n        this.logger.info(`SSL certificate: ${certificatePath}`);\n      }\n\n      serverOptions.key ||= fakeCert;\n      serverOptions.cert ||= fakeCert;\n    }\n\n    if (typeof options.ipc === \"boolean\") {\n      const isWindows = process.platform === \"win32\";\n      const pipePrefix = isWindows ? \"\\\\\\\\.\\\\pipe\\\\\" : os.tmpdir();\n      const pipeName = \"webpack-dev-server.sock\";\n\n      options.ipc = path.join(pipePrefix, pipeName);\n    }\n\n    options.liveReload =\n      typeof options.liveReload !== \"undefined\" ? options.liveReload : true;\n\n    // https://github.com/webpack/webpack-dev-server/issues/1990\n    const defaultOpenOptions = { wait: false };\n    /**\n     * @param {import(\"open\").Options & { target?: string | string[] } & EXPECTED_ANY} target target\n     * @returns {NormalizedOpen[]} normalized open options\n     */\n    const getOpenItemsFromObject = ({ target, ...rest }) => {\n      const normalizedOptions = { ...defaultOpenOptions, ...rest };\n\n      if (typeof normalizedOptions.app === \"string\") {\n        normalizedOptions.app = {\n          name: normalizedOptions.app,\n        };\n      }\n\n      const normalizedTarget = typeof target === \"undefined\" ? \"<url>\" : target;\n\n      if (Array.isArray(normalizedTarget)) {\n        return normalizedTarget.map((singleTarget) => ({\n          target: singleTarget,\n          options: normalizedOptions,\n        }));\n      }\n\n      return [{ target: normalizedTarget, options: normalizedOptions }];\n    };\n\n    if (typeof options.open === \"undefined\") {\n      /** @type {NormalizedOpen[]} */\n      (options.open) = [];\n    } else if (typeof options.open === \"boolean\") {\n      /** @type {NormalizedOpen[]} */\n      (options.open) = options.open\n        ? [\n            {\n              target: \"<url>\",\n              options: /** @type {OpenOptions} */ (defaultOpenOptions),\n            },\n          ]\n        : [];\n    } else if (typeof options.open === \"string\") {\n      /** @type {NormalizedOpen[]} */\n      (options.open) = [{ target: options.open, options: defaultOpenOptions }];\n    } else if (Array.isArray(options.open)) {\n      /**\n       * @type {NormalizedOpen[]}\n       */\n      const result = [];\n\n      for (const item of options.open) {\n        if (typeof item === \"string\") {\n          result.push({ target: item, options: defaultOpenOptions });\n\n          continue;\n        }\n\n        result.push(...getOpenItemsFromObject(item));\n      }\n\n      /** @type {NormalizedOpen[]} */\n      (options.open) = result;\n    } else {\n      /** @type {NormalizedOpen[]} */\n      (options.open) = [...getOpenItemsFromObject(options.open)];\n    }\n\n    if (typeof options.port === \"string\" && options.port !== \"auto\") {\n      options.port = Number(options.port);\n    }\n\n    /**\n     * Assume a proxy configuration specified as:\n     * proxy: { 'context': { options } }\n     * OR\n     * proxy: { 'context': 'target' }\n     */\n    if (typeof options.proxy !== \"undefined\") {\n      options.proxy = options.proxy.map((item) => {\n        if (typeof item === \"function\") {\n          return item;\n        }\n\n        /**\n         * @param {\"info\" | \"warn\" | \"error\" | \"debug\" | \"silent\" | undefined | \"none\" | \"log\" | \"verbose\"} level level\n         * @returns {\"info\" | \"warn\" | \"error\" | \"debug\" | \"silent\" | undefined} log level for proxy\n         */\n        const getLogLevelForProxy = (level) => {\n          if (level === \"none\") {\n            return \"silent\";\n          }\n\n          if (level === \"log\") {\n            return \"info\";\n          }\n\n          if (level === \"verbose\") {\n            return \"debug\";\n          }\n\n          return level;\n        };\n\n        if (typeof item.logLevel === \"undefined\") {\n          item.logLevel = getLogLevelForProxy(\n            compilerOptions.infrastructureLogging\n              ? compilerOptions.infrastructureLogging.level\n              : \"info\",\n          );\n        }\n\n        if (typeof item.logProvider === \"undefined\") {\n          item.logProvider = () => this.logger;\n        }\n\n        return item;\n      });\n    }\n\n    if (typeof options.setupExitSignals === \"undefined\") {\n      options.setupExitSignals = true;\n    }\n\n    if (typeof options.static === \"undefined\") {\n      options.static = [getStaticItem()];\n    } else if (typeof options.static === \"boolean\") {\n      options.static = options.static ? [getStaticItem()] : false;\n    } else if (typeof options.static === \"string\") {\n      options.static = [getStaticItem(options.static)];\n    } else if (Array.isArray(options.static)) {\n      options.static = options.static.map((item) => getStaticItem(item));\n    } else {\n      options.static = [getStaticItem(options.static)];\n    }\n\n    if (typeof options.watchFiles === \"string\") {\n      options.watchFiles = [\n        { paths: options.watchFiles, options: getWatchOptions() },\n      ];\n    } else if (\n      typeof options.watchFiles === \"object\" &&\n      options.watchFiles !== null &&\n      !Array.isArray(options.watchFiles)\n    ) {\n      options.watchFiles = [\n        {\n          paths: options.watchFiles.paths,\n          options: getWatchOptions(options.watchFiles.options || {}),\n        },\n      ];\n    } else if (Array.isArray(options.watchFiles)) {\n      options.watchFiles = options.watchFiles.map((item) => {\n        if (typeof item === \"string\") {\n          return { paths: item, options: getWatchOptions() };\n        }\n\n        return {\n          paths: item.paths,\n          options: getWatchOptions(item.options || {}),\n        };\n      });\n    } else {\n      options.watchFiles = [];\n    }\n\n    const defaultWebSocketServerType = \"ws\";\n    const defaultWebSocketServerOptions = { path: \"/ws\" };\n\n    if (typeof options.webSocketServer === \"undefined\") {\n      options.webSocketServer = {\n        type: defaultWebSocketServerType,\n        options: defaultWebSocketServerOptions,\n      };\n    } else if (\n      typeof options.webSocketServer === \"boolean\" &&\n      !options.webSocketServer\n    ) {\n      options.webSocketServer = false;\n    } else if (\n      typeof options.webSocketServer === \"string\" ||\n      typeof options.webSocketServer === \"function\"\n    ) {\n      options.webSocketServer = {\n        type: options.webSocketServer,\n        options: defaultWebSocketServerOptions,\n      };\n    } else {\n      options.webSocketServer = {\n        type:\n          /** @type {WebSocketServerConfiguration} */\n          (options.webSocketServer).type || defaultWebSocketServerType,\n        options: {\n          ...defaultWebSocketServerOptions,\n          .../** @type {WebSocketServerConfiguration} */\n          (options.webSocketServer).options,\n        },\n      };\n\n      const webSocketServer =\n        /** @type {{ type: WebSocketServerConfiguration[\"type\"], options: NonNullable<WebSocketServerConfiguration[\"options\"]> }} */\n        (options.webSocketServer);\n\n      if (typeof webSocketServer.options.port === \"string\") {\n        webSocketServer.options.port = Number(webSocketServer.options.port);\n      }\n    }\n  }\n\n  /**\n   * @private\n   * @returns {string} client transport\n   */\n  getClientTransport() {\n    let clientImplementation;\n    let clientImplementationFound = true;\n\n    const isKnownWebSocketServerImplementation =\n      this.options.webSocketServer &&\n      typeof (\n        /** @type {WebSocketServerConfiguration} */\n        (this.options.webSocketServer).type\n      ) === \"string\" &&\n      // @ts-expect-error\n      (this.options.webSocketServer.type === \"ws\" ||\n        /** @type {WebSocketServerConfiguration} */\n        (this.options.webSocketServer).type === \"sockjs\");\n\n    let clientTransport;\n\n    if (this.options.client) {\n      if (\n        typeof (\n          /** @type {ClientConfiguration} */\n          (this.options.client).webSocketTransport\n        ) !== \"undefined\"\n      ) {\n        clientTransport =\n          /** @type {ClientConfiguration} */\n          (this.options.client).webSocketTransport;\n      } else if (isKnownWebSocketServerImplementation) {\n        clientTransport =\n          /** @type {WebSocketServerConfiguration} */\n          (this.options.webSocketServer).type;\n      } else {\n        clientTransport = \"ws\";\n      }\n    } else {\n      clientTransport = \"ws\";\n    }\n\n    switch (typeof clientTransport) {\n      case \"string\":\n        // could be 'sockjs', 'ws', or a path that should be required\n        if (clientTransport === \"sockjs\") {\n          clientImplementation = require.resolve(\n            \"../client/clients/SockJSClient\",\n          );\n        } else if (clientTransport === \"ws\") {\n          clientImplementation = require.resolve(\n            \"../client/clients/WebSocketClient\",\n          );\n        } else {\n          try {\n            clientImplementation = require.resolve(clientTransport);\n          } catch {\n            clientImplementationFound = false;\n          }\n        }\n        break;\n      default:\n        clientImplementationFound = false;\n    }\n\n    if (!clientImplementationFound) {\n      throw new Error(\n        `${\n          !isKnownWebSocketServerImplementation\n            ? \"When you use custom web socket implementation you must explicitly specify client.webSocketTransport. \"\n            : \"\"\n        }client.webSocketTransport must be a string denoting a default implementation (e.g. 'sockjs', 'ws') or a full path to a JS file via require.resolve(...) which exports a class `,\n      );\n    }\n\n    return /** @type {string} */ (clientImplementation);\n  }\n\n  /**\n   * @template T\n   * @private\n   * @returns {T} server transport\n   */\n  getServerTransport() {\n    let implementation;\n    let implementationFound = true;\n\n    switch (\n      typeof (\n        /** @type {WebSocketServerConfiguration} */\n        (this.options.webSocketServer).type\n      )\n    ) {\n      case \"string\":\n        // Could be 'sockjs', in the future 'ws', or a path that should be required\n        if (\n          /** @type {WebSocketServerConfiguration} */ (\n            this.options.webSocketServer\n          ).type === \"sockjs\"\n        ) {\n          implementation = require(\"./servers/SockJSServer\");\n        } else if (\n          /** @type {WebSocketServerConfiguration} */ (\n            this.options.webSocketServer\n          ).type === \"ws\"\n        ) {\n          implementation = require(\"./servers/WebsocketServer\");\n        } else {\n          try {\n            implementation = require(\n              /** @type {WebSocketServerConfiguration} */\n              (this.options.webSocketServer).type,\n            );\n          } catch {\n            implementationFound = false;\n          }\n        }\n        break;\n      case \"function\":\n        implementation =\n          /** @type {WebSocketServerConfiguration} */\n          (this.options.webSocketServer).type;\n        break;\n      default:\n        implementationFound = false;\n    }\n\n    if (!implementationFound) {\n      throw new Error(\n        \"webSocketServer (webSocketServer.type) must be a string denoting a default implementation (e.g. 'ws', 'sockjs'), a full path to \" +\n          \"a JS file which exports a class extending BaseServer (webpack-dev-server/lib/servers/BaseServer.js) \" +\n          \"via require.resolve(...), or the class itself which extends BaseServer\",\n      );\n    }\n\n    return implementation;\n  }\n\n  /**\n   * @returns {string}\n   */\n\n  getClientEntry() {\n    return require.resolve(\"../client/index.js\");\n  }\n\n  /**\n   * @returns {string | void} client hot entry\n   */\n  getClientHotEntry() {\n    if (this.options.hot === \"only\") {\n      return require.resolve(\"webpack/hot/only-dev-server\");\n    } else if (this.options.hot) {\n      return require.resolve(\"webpack/hot/dev-server\");\n    }\n  }\n\n  /**\n   * @private\n   * @returns {void}\n   */\n  setupProgressPlugin() {\n    const { ProgressPlugin } =\n      /** @type {MultiCompiler} */\n      (this.compiler).compilers\n        ? /** @type {MultiCompiler} */ (this.compiler).compilers[0].webpack\n        : /** @type {Compiler} */ (this.compiler).webpack;\n\n    new ProgressPlugin(\n      /**\n       * @param {number} percent percent\n       * @param {string} msg message\n       * @param {string} addInfo extra information\n       * @param {string} pluginName plugin name\n       */\n      (percent, msg, addInfo, pluginName) => {\n        percent = Math.floor(percent * 100);\n\n        if (percent === 100) {\n          msg = \"Compilation completed\";\n        }\n\n        if (addInfo) {\n          msg = `${msg} (${addInfo})`;\n        }\n\n        if (this.webSocketServer) {\n          this.sendMessage(this.webSocketServer.clients, \"progress-update\", {\n            percent,\n            msg,\n            pluginName,\n          });\n        }\n\n        if (this.server) {\n          this.server.emit(\"progress-update\", { percent, msg, pluginName });\n        }\n      },\n    ).apply(this.compiler);\n  }\n\n  /**\n   * @private\n   * @returns {Promise<void>}\n   */\n  async initialize() {\n    this.setupHooks();\n\n    await this.setupApp();\n    await this.createServer();\n\n    if (this.options.webSocketServer) {\n      const compilers =\n        /** @type {MultiCompiler} */\n        (this.compiler).compilers || [this.compiler];\n\n      for (const compiler of compilers) {\n        if (compiler.options.devServer === false) {\n          continue;\n        }\n\n        this.addAdditionalEntries(compiler);\n\n        const webpack = compiler.webpack || require(\"webpack\");\n\n        new webpack.ProvidePlugin({\n          __webpack_dev_server_client__: this.getClientTransport(),\n        }).apply(compiler);\n\n        if (this.options.hot) {\n          const HMRPluginExists = compiler.options.plugins.find(\n            (plugin) =>\n              plugin &&\n              plugin.constructor === webpack.HotModuleReplacementPlugin,\n          );\n\n          if (HMRPluginExists) {\n            this.logger.warn(\n              '\"hot: true\" automatically applies HMR plugin, you don\\'t have to add it manually to your webpack configuration.',\n            );\n          } else {\n            // Apply the HMR plugin\n            const plugin = new webpack.HotModuleReplacementPlugin();\n\n            plugin.apply(compiler);\n          }\n        }\n      }\n\n      if (\n        this.options.client &&\n        /** @type {ClientConfiguration} */ (this.options.client).progress\n      ) {\n        this.setupProgressPlugin();\n      }\n    }\n\n    this.setupWatchFiles();\n    this.setupWatchStaticFiles();\n    this.setupMiddlewares();\n\n    if (this.options.setupExitSignals) {\n      const signals = [\"SIGINT\", \"SIGTERM\"];\n\n      let needForceShutdown = false;\n\n      for (const signal of signals) {\n        // eslint-disable-next-line no-loop-func\n        const listener = () => {\n          if (needForceShutdown) {\n            // eslint-disable-next-line n/no-process-exit\n            process.exit();\n          }\n\n          this.logger.info(\n            \"Gracefully shutting down. To force exit, press ^C again. Please wait...\",\n          );\n\n          needForceShutdown = true;\n\n          this.stopCallback(() => {\n            if (typeof this.compiler.close === \"function\") {\n              this.compiler.close(() => {\n                // eslint-disable-next-line n/no-process-exit\n                process.exit();\n              });\n            } else {\n              // eslint-disable-next-line n/no-process-exit\n              process.exit();\n            }\n          });\n        };\n\n        this.listeners.push({ name: signal, listener });\n\n        process.on(signal, listener);\n      }\n    }\n\n    // Proxy WebSocket without the initial http request\n    // https://github.com/chimurai/http-proxy-middleware#external-websocket-upgrade\n    const webSocketProxies =\n      /** @type {RequestHandler[]} */\n      (this.webSocketProxies);\n\n    for (const webSocketProxy of webSocketProxies) {\n      /** @type {S} */\n      (this.server).on(\n        \"upgrade\",\n        /** @type {RequestHandler & { upgrade: NonNullable<RequestHandler[\"upgrade\"]> }} */\n        (webSocketProxy).upgrade,\n      );\n    }\n  }\n\n  /**\n   * @private\n   * @returns {Promise<void>}\n   */\n  async setupApp() {\n    /** @type {A | undefined} */\n    this.app =\n      /** @type {A} */\n      (\n        typeof this.options.app === \"function\"\n          ? await this.options.app()\n          : getExpress()()\n      );\n  }\n\n  /**\n   * @private\n   * @param {Stats | MultiStats} statsObj stats\n   * @returns {StatsCompilation} stats of compilation\n   */\n  getStats(statsObj) {\n    const stats = Server.DEFAULT_STATS;\n    const compilerOptions = this.getCompilerOptions();\n\n    if (\n      compilerOptions.stats &&\n      /** @type {StatsOptions} */ (compilerOptions.stats).warningsFilter\n    ) {\n      stats.warningsFilter =\n        /** @type {StatsOptions} */\n        (compilerOptions.stats).warningsFilter;\n    }\n\n    return statsObj.toJson(stats);\n  }\n\n  /**\n   * @private\n   * @returns {void}\n   */\n  setupHooks() {\n    this.compiler.hooks.invalid.tap(\"webpack-dev-server\", () => {\n      if (this.webSocketServer) {\n        this.sendMessage(this.webSocketServer.clients, \"invalid\");\n      }\n    });\n    this.compiler.hooks.done.tap(\n      \"webpack-dev-server\",\n      /**\n       * @param {Stats | MultiStats} stats stats\n       */\n      (stats) => {\n        if (this.webSocketServer) {\n          this.sendStats(this.webSocketServer.clients, this.getStats(stats));\n        }\n\n        /**\n         * @private\n         * @type {Stats | MultiStats}\n         */\n        this.stats = stats;\n      },\n    );\n  }\n\n  /**\n   * @private\n   * @returns {void}\n   */\n  setupWatchStaticFiles() {\n    const watchFiles = /** @type {NormalizedStatic[]} */ (this.options.static);\n\n    if (watchFiles.length > 0) {\n      for (const item of watchFiles) {\n        if (item.watch) {\n          this.watchFiles(item.directory, item.watch);\n        }\n      }\n    }\n  }\n\n  /**\n   * @private\n   * @returns {void}\n   */\n  setupWatchFiles() {\n    const watchFiles = /** @type {WatchFiles[]} */ (this.options.watchFiles);\n\n    if (watchFiles.length > 0) {\n      for (const item of watchFiles) {\n        this.watchFiles(item.paths, item.options);\n      }\n    }\n  }\n\n  /**\n   * @private\n   * @returns {void}\n   */\n  setupMiddlewares() {\n    /**\n     * @type {Array<Middleware>}\n     */\n    let middlewares = [];\n\n    // Register setup host header check for security\n    middlewares.push({\n      name: \"host-header-check\",\n      /**\n       * @param {Request} req request\n       * @param {Response} res response\n       * @param {NextFunction} next next function\n       * @returns {void}\n       */\n      middleware: (req, res, next) => {\n        const headers =\n          /** @type {{ [key: string]: string | undefined }} */\n          (req.headers);\n        const headerName = headers[\":authority\"] ? \":authority\" : \"host\";\n\n        if (this.isValidHost(headers, headerName)) {\n          next();\n          return;\n        }\n\n        res.statusCode = 403;\n        res.end(\"Invalid Host header\");\n      },\n    });\n\n    // Register setup cross origin request check for security\n    middlewares.push({\n      name: \"cross-origin-header-check\",\n      /**\n       * @param {Request} req request\n       * @param {Response} res response\n       * @param {NextFunction} next next function\n       * @returns {void}\n       */\n      middleware: (req, res, next) => {\n        const headers =\n          /** @type {{ [key: string]: string | undefined }} */\n          (req.headers);\n        const headerName = headers[\":authority\"] ? \":authority\" : \"host\";\n\n        if (this.isValidHost(headers, headerName, false)) {\n          next();\n          return;\n        }\n\n        if (\n          headers[\"sec-fetch-mode\"] === \"no-cors\" &&\n          headers[\"sec-fetch-site\"] === \"cross-site\"\n        ) {\n          res.statusCode = 403;\n          res.end(\"Cross-Origin request blocked\");\n          return;\n        }\n\n        next();\n      },\n    });\n\n    const isHTTP2 =\n      /** @type {ServerConfiguration<A, S>} */ (this.options.server).type ===\n      \"http2\";\n\n    if (isHTTP2) {\n      // TODO patch for https://github.com/pillarjs/finalhandler/pull/45, need remove then will be resolved\n      middlewares.push({\n        name: \"http2-status-message-patch\",\n        middleware:\n          /** @type {NextHandleFunction} */\n          (_req, res, next) => {\n            Object.defineProperty(res, \"statusMessage\", {\n              get() {\n                return \"\";\n              },\n              set() {},\n            });\n\n            next();\n          },\n      });\n    }\n\n    // compress is placed last and uses unshift so that it will be the first middleware used\n    if (this.options.compress && !isHTTP2) {\n      const compression = require(\"compression\");\n\n      middlewares.push({ name: \"compression\", middleware: compression() });\n    }\n\n    if (typeof this.options.headers !== \"undefined\") {\n      middlewares.push({\n        name: \"set-headers\",\n        middleware: this.setHeaders.bind(this),\n      });\n    }\n\n    middlewares.push({\n      name: \"webpack-dev-middleware\",\n      middleware: /** @type {MiddlewareHandler} */ (this.middleware),\n    });\n\n    // Should be after `webpack-dev-middleware`, otherwise other middlewares might rewrite response\n    middlewares.push({\n      name: \"webpack-dev-server-sockjs-bundle\",\n      path: \"/__webpack_dev_server__/sockjs.bundle.js\",\n      /**\n       * @param {Request} req request\n       * @param {Response} res response\n       * @param {NextFunction} next next function\n       * @returns {void}\n       */\n      middleware: (req, res, next) => {\n        if (req.method !== \"GET\" && req.method !== \"HEAD\") {\n          next();\n          return;\n        }\n\n        const clientPath = path.join(\n          __dirname,\n          \"..\",\n          \"client/modules/sockjs-client/index.js\",\n        );\n\n        // Express send Etag and other headers by default, so let's keep them for compatibility reasons\n        if (typeof res.sendFile === \"function\") {\n          res.sendFile(clientPath);\n          return;\n        }\n\n        let stats;\n\n        try {\n          // TODO implement `inputFileSystem.createReadStream` in webpack\n          stats = fs.statSync(clientPath);\n        } catch {\n          next();\n          return;\n        }\n\n        res.setHeader(\"Content-Type\", \"application/javascript; charset=UTF-8\");\n        res.setHeader(\"Content-Length\", stats.size);\n\n        if (req.method === \"HEAD\") {\n          res.end();\n          return;\n        }\n\n        fs.createReadStream(clientPath).pipe(res);\n      },\n    });\n\n    middlewares.push({\n      name: \"webpack-dev-server-invalidate\",\n      path: \"/webpack-dev-server/invalidate\",\n      /**\n       * @param {Request} req request\n       * @param {Response} res response\n       * @param {NextFunction} next next function\n       * @returns {void}\n       */\n      middleware: (req, res, next) => {\n        if (req.method !== \"GET\" && req.method !== \"HEAD\") {\n          next();\n          return;\n        }\n\n        this.invalidate();\n\n        res.end();\n      },\n    });\n\n    middlewares.push({\n      name: \"webpack-dev-server-open-editor\",\n      path: \"/webpack-dev-server/open-editor\",\n      /**\n       * @param {Request} req request\n       * @param {Response} res response\n       * @param {NextFunction} next next function\n       * @returns {void}\n       */\n      middleware: (req, res, next) => {\n        if (req.method !== \"GET\" && req.method !== \"HEAD\") {\n          next();\n          return;\n        }\n\n        if (!req.url) {\n          next();\n          return;\n        }\n\n        const resolveUrl = new URL(req.url, `http://${req.headers.host}`);\n        const params = new URLSearchParams(resolveUrl.search);\n        const fileName = params.get(\"fileName\");\n\n        if (typeof fileName === \"string\") {\n          const launchEditor = require(\"launch-editor\");\n\n          launchEditor(fileName);\n        }\n\n        res.end();\n      },\n    });\n\n    middlewares.push({\n      name: \"webpack-dev-server-assets\",\n      path: \"/webpack-dev-server\",\n      /**\n       * @param {Request} req request\n       * @param {Response} res response\n       * @param {NextFunction} next next function\n       * @returns {void}\n       */\n      middleware: (req, res, next) => {\n        if (req.method !== \"GET\" && req.method !== \"HEAD\") {\n          next();\n          return;\n        }\n\n        if (!this.middleware) {\n          next();\n          return;\n        }\n\n        this.middleware.waitUntilValid((stats) => {\n          res.setHeader(\"Content-Type\", \"text/html; charset=utf-8\");\n\n          // HEAD requests should not return body content\n          if (req.method === \"HEAD\") {\n            res.end();\n            return;\n          }\n\n          res.write(\n            '<!DOCTYPE html><html><head><meta charset=\"utf-8\"/></head><body>',\n          );\n\n          /**\n           * @type {StatsCompilation[]}\n           */\n          const statsForPrint =\n            typeof (/** @type {MultiStats} */ (stats).stats) !== \"undefined\"\n              ? /** @type {NonNullable<StatsCompilation[\"children\"]>} */\n                (/** @type {MultiStats} */ (stats).toJson().children)\n              : [/** @type {Stats} */ (stats).toJson()];\n\n          res.write(\"<h1>Assets Report:</h1>\");\n\n          for (const [index, item] of statsForPrint.entries()) {\n            res.write(\"<div>\");\n\n            const name =\n              typeof item.name !== \"undefined\"\n                ? item.name\n                : /** @type {MultiStats} */ (stats).stats\n                  ? `unnamed[${index}]`\n                  : \"unnamed\";\n\n            res.write(`<h2>Compilation: ${name}</h2>`);\n            res.write(\"<ul>\");\n\n            const publicPath =\n              item.publicPath === \"auto\" ? \"\" : item.publicPath;\n            const assets =\n              /** @type {NonNullable<StatsCompilation[\"assets\"]>} */\n              (item.assets);\n\n            for (const asset of assets) {\n              const assetName = asset.name;\n              const assetURL = `${publicPath}${assetName}`;\n\n              res.write(\n                `<li>\n              <strong><a href=\"${assetURL}\" target=\"_blank\">${assetName}</a></strong>\n            </li>`,\n              );\n            }\n\n            res.write(\"</ul>\");\n            res.write(\"</div>\");\n          }\n\n          res.end(\"</body></html>\");\n        });\n      },\n    });\n\n    if (this.options.proxy) {\n      const { createProxyMiddleware } = require(\"http-proxy-middleware\");\n\n      /**\n       * @param {ProxyConfigArrayItem} proxyConfig proxy config\n       * @returns {RequestHandler | undefined} request handler\n       */\n      const getProxyMiddleware = (proxyConfig) => {\n        // It is possible to use the `bypass` method without a `target` or `router`.\n        // However, the proxy middleware has no use in this case, and will fail to instantiate.\n        if (proxyConfig.target) {\n          const context = proxyConfig.context || proxyConfig.path;\n\n          return createProxyMiddleware(\n            /** @type {string} */ (context),\n            proxyConfig,\n          );\n        }\n\n        if (proxyConfig.router) {\n          return createProxyMiddleware(proxyConfig);\n        }\n\n        // TODO improve me after drop `bypass` to always generate error when configuration is bad\n        if (!proxyConfig.bypass) {\n          util.deprecate(\n            () => {},\n            `Invalid proxy configuration:\\n\\n${JSON.stringify(proxyConfig, null, 2)}\\n\\nThe use of proxy object notation as proxy routes has been removed.\\nPlease use the 'router' or 'context' options. Read more at https://github.com/chimurai/http-proxy-middleware/tree/v2.0.6#http-proxy-middleware-options`,\n            \"DEP_WEBPACK_DEV_SERVER_PROXY_ROUTES_ARGUMENT\",\n          )();\n        }\n      };\n\n      /**\n       * @example\n       * Assume a proxy configuration specified as:\n       * proxy: [\n       *   {\n       *     context: \"value\",\n       *     ...options,\n       *   },\n       *   // or:\n       *   function() {\n       *     return {\n       *       context: \"context\",\n       *       ...options,\n       *     };\n       *   }\n       * ]\n       */\n      for (const proxyConfigOrCallback of this.options.proxy) {\n        /**\n         * @type {RequestHandler}\n         */\n        let proxyMiddleware;\n\n        let proxyConfig =\n          typeof proxyConfigOrCallback === \"function\"\n            ? proxyConfigOrCallback()\n            : proxyConfigOrCallback;\n\n        proxyMiddleware =\n          /** @type {RequestHandler} */\n          (getProxyMiddleware(proxyConfig));\n\n        if (proxyConfig.ws) {\n          this.webSocketProxies.push(proxyMiddleware);\n        }\n\n        /**\n         * @param {Request} req request\n         * @param {Response} res response\n         * @param {NextFunction} next next function\n         * @returns {Promise<void>}\n         */\n        const handler = async (req, res, next) => {\n          if (typeof proxyConfigOrCallback === \"function\") {\n            const newProxyConfig = proxyConfigOrCallback(req, res, next);\n\n            if (newProxyConfig !== proxyConfig) {\n              proxyConfig = newProxyConfig;\n\n              const socket = req.socket || req.connection;\n              // @ts-expect-error\n              const server = socket ? socket.server : null;\n\n              if (server) {\n                server.removeAllListeners(\"close\");\n              }\n\n              proxyMiddleware =\n                /** @type {RequestHandler} */\n                (getProxyMiddleware(proxyConfig));\n            }\n          }\n\n          // - Check if we have a bypass function defined\n          // - In case the bypass function is defined we'll retrieve the\n          // bypassUrl from it otherwise bypassUrl would be null\n          // TODO remove in the next major in favor `context` and `router` options\n          const isByPassFuncDefined = typeof proxyConfig.bypass === \"function\";\n          if (isByPassFuncDefined) {\n            util.deprecate(\n              () => {},\n              \"Using the 'bypass' option is deprecated. Please use the 'router' or 'context' options. Read more at https://github.com/chimurai/http-proxy-middleware/tree/v2.0.6#http-proxy-middleware-options\",\n              \"DEP_WEBPACK_DEV_SERVER_PROXY_BYPASS_ARGUMENT\",\n            )();\n          }\n          const bypassUrl = isByPassFuncDefined\n            ? await /** @type {ByPass} */ (proxyConfig.bypass)(\n                req,\n                res,\n                proxyConfig,\n              )\n            : null;\n\n          if (typeof bypassUrl === \"boolean\") {\n            // skip the proxy\n            res.statusCode = 404;\n            req.url = \"\";\n            next();\n          } else if (typeof bypassUrl === \"string\") {\n            // byPass to that url\n            req.url = bypassUrl;\n            next();\n          } else if (proxyMiddleware) {\n            return proxyMiddleware(req, res, next);\n          } else {\n            next();\n          }\n        };\n\n        middlewares.push({\n          name: \"http-proxy-middleware\",\n          middleware: handler,\n        });\n\n        // Also forward error requests to the proxy so it can handle them.\n        middlewares.push({\n          name: \"http-proxy-middleware-error-handler\",\n          middleware:\n            /**\n             * @param {Error} error error\n             * @param {Request} req request\n             * @param {Response} res response\n             * @param {NextFunction} next next function\n             * @returns {Promise<void>} nothing\n             */\n            (error, req, res, next) => handler(req, res, next),\n        });\n      }\n\n      middlewares.push({\n        name: \"webpack-dev-middleware\",\n        middleware: /** @type {MiddlewareHandler} */ (this.middleware),\n      });\n    }\n\n    const staticOptions =\n      /** @type {NormalizedStatic[]} */\n      (this.options.static);\n\n    if (staticOptions.length > 0) {\n      for (const staticOption of staticOptions) {\n        for (const publicPath of staticOption.publicPath) {\n          middlewares.push({\n            name: \"express-static\",\n            path: publicPath,\n            middleware: getExpress().static(\n              staticOption.directory,\n              staticOption.staticOptions,\n            ),\n          });\n        }\n      }\n    }\n\n    if (this.options.historyApiFallback) {\n      const connectHistoryApiFallback = require(\"connect-history-api-fallback\");\n\n      const { historyApiFallback } = this.options;\n\n      if (\n        typeof (\n          /** @type {ConnectHistoryApiFallbackOptions} */\n          (historyApiFallback).logger\n        ) === \"undefined\" &&\n        !(\n          /** @type {ConnectHistoryApiFallbackOptions} */\n          (historyApiFallback).verbose\n        )\n      ) {\n        // @ts-expect-error\n        historyApiFallback.logger = this.logger.log.bind(\n          this.logger,\n          \"[connect-history-api-fallback]\",\n        );\n      }\n\n      // Fall back to /index.html if nothing else matches.\n      middlewares.push({\n        name: \"connect-history-api-fallback\",\n        middleware: connectHistoryApiFallback(\n          /** @type {ConnectHistoryApiFallbackOptions} */\n          (historyApiFallback),\n        ),\n      });\n\n      // include our middleware to ensure\n      // it is able to handle '/index.html' request after redirect\n      middlewares.push({\n        name: \"webpack-dev-middleware\",\n        middleware: /** @type {MiddlewareHandler} */ (this.middleware),\n      });\n\n      if (staticOptions.length > 0) {\n        for (const staticOption of staticOptions) {\n          for (const publicPath of staticOption.publicPath) {\n            middlewares.push({\n              name: \"express-static\",\n              path: publicPath,\n              middleware: getExpress().static(\n                staticOption.directory,\n                staticOption.staticOptions,\n              ),\n            });\n          }\n        }\n      }\n    }\n\n    if (staticOptions.length > 0) {\n      const serveIndex = require(\"serve-index\");\n\n      for (const staticOption of staticOptions) {\n        for (const publicPath of staticOption.publicPath) {\n          if (staticOption.serveIndex) {\n            middlewares.push({\n              name: \"serve-index\",\n              path: publicPath,\n              /**\n               * @param {Request} req request\n               * @param {Response} res response\n               * @param {NextFunction} next next function\n               * @returns {void}\n               */\n              middleware: (req, res, next) => {\n                // serve-index doesn't fallthrough non-get/head request to next middleware\n                if (req.method !== \"GET\" && req.method !== \"HEAD\") {\n                  return next();\n                }\n\n                serveIndex(\n                  staticOption.directory,\n                  /** @type {ServeIndexOptions} */\n                  (staticOption.serveIndex),\n                )(req, res, next);\n              },\n            });\n          }\n        }\n      }\n    }\n\n    // Register this middleware always as the last one so that it's only used as a\n    // fallback when no other middleware responses.\n    middlewares.push({\n      name: \"options-middleware\",\n      /**\n       * @param {Request} req request\n       * @param {Response} res response\n       * @param {NextFunction} next next function\n       * @returns {void}\n       */\n      middleware: (req, res, next) => {\n        if (req.method === \"OPTIONS\") {\n          res.statusCode = 204;\n          res.setHeader(\"Content-Length\", \"0\");\n          res.end();\n          return;\n        }\n        next();\n      },\n    });\n\n    if (typeof this.options.setupMiddlewares === \"function\") {\n      middlewares = this.options.setupMiddlewares(middlewares, this);\n    }\n\n    // Lazy init webpack dev middleware\n    const lazyInitDevMiddleware = () => {\n      if (!this.middleware) {\n        const webpackDevMiddleware = require(\"webpack-dev-middleware\");\n\n        // middleware for serving webpack bundle\n        /** @type {import(\"webpack-dev-middleware\").API<Request, Response>} */\n        this.middleware = webpackDevMiddleware(\n          this.compiler,\n          this.options.devMiddleware,\n        );\n      }\n\n      return this.middleware;\n    };\n\n    for (const i of middlewares) {\n      if (i.name === \"webpack-dev-middleware\") {\n        const item = /** @type {MiddlewareObject} */ (i);\n\n        if (typeof item.middleware === \"undefined\") {\n          item.middleware = lazyInitDevMiddleware();\n        }\n      }\n    }\n\n    for (const middleware of middlewares) {\n      if (typeof middleware === \"function\") {\n        /** @type {A} */\n        (this.app).use(\n          /** @type {NextHandleFunction | HandleFunction} */\n          (middleware),\n        );\n      } else if (typeof middleware.path !== \"undefined\") {\n        /** @type {A} */\n        (this.app).use(\n          middleware.path,\n          /** @type {SimpleHandleFunction | NextHandleFunction} */\n          (middleware.middleware),\n        );\n      } else {\n        /** @type {A} */\n        (this.app).use(\n          /** @type {NextHandleFunction | HandleFunction} */\n          (middleware.middleware),\n        );\n      }\n    }\n  }\n\n  /**\n   * @private\n   * @returns {Promise<void>}\n   */\n  async createServer() {\n    const { type, options } =\n      /** @type {ServerConfiguration<A, S>} */\n      (this.options.server);\n\n    if (typeof type === \"function\") {\n      /** @type {S | undefined} */\n      this.server = await type(\n        /** @type {ServerOptions} */\n        (options),\n        /** @type {A} */\n        (this.app),\n      );\n    } else {\n      const serverType = require(/** @type {string} */ (type));\n\n      /** @type {S | undefined} */\n      this.server =\n        type === \"http2\"\n          ? serverType.createSecureServer(\n              { ...options, allowHTTP1: true },\n              this.app,\n            )\n          : serverType.createServer(options, this.app);\n    }\n\n    this.isTlsServer =\n      typeof (\n        /** @type {import(\"tls\").Server} */ (this.server).setSecureContext\n      ) !== \"undefined\";\n\n    /** @type {S} */\n    (this.server).on(\n      \"connection\",\n      /**\n       * @param {Socket} socket connected socket\n       */\n      (socket) => {\n        // Add socket to list\n        this.sockets.push(socket);\n\n        socket.once(\"close\", () => {\n          // Remove socket from list\n          this.sockets.splice(this.sockets.indexOf(socket), 1);\n        });\n      },\n    );\n\n    /** @type {S} */\n    (this.server).on(\n      \"error\",\n      /**\n       * @param {Error} error error\n       */\n      (error) => {\n        throw error;\n      },\n    );\n  }\n\n  /**\n   * @private\n   * @returns {void}\n   */\n  createWebSocketServer() {\n    /** @type {WebSocketServerImplementation | undefined | null} */\n    this.webSocketServer = new (this.getServerTransport())(this);\n\n    /** @type {WebSocketServerImplementation} */\n    (this.webSocketServer).implementation.on(\n      \"connection\",\n      /**\n       * @param {ClientConnection} client client\n       * @param {IncomingMessage} request request\n       */\n      (client, request) => {\n        /** @type {{ [key: string]: string | undefined } | undefined} */\n        const headers =\n          typeof request !== \"undefined\"\n            ? /** @type {{ [key: string]: string | undefined }} */\n              (request.headers)\n            : typeof (\n                  /** @type {import(\"sockjs\").Connection} */ (client).headers\n                ) !== \"undefined\"\n              ? /** @type {import(\"sockjs\").Connection} */ (client).headers\n              : undefined;\n\n        if (!headers) {\n          this.logger.warn(\n            'webSocketServer implementation must pass headers for the \"connection\" event',\n          );\n        }\n\n        if (\n          !headers ||\n          !this.isValidHost(headers, \"host\") ||\n          !this.isValidHost(headers, \"origin\") ||\n          !this.isSameOrigin(headers)\n        ) {\n          this.sendMessage([client], \"error\", \"Invalid Host/Origin header\");\n\n          // With https enabled, the sendMessage above is encrypted asynchronously so not yet sent\n          // Terminate would prevent it sending, so use close to allow it to be sent\n          client.close();\n\n          return;\n        }\n\n        if (this.options.hot === true || this.options.hot === \"only\") {\n          this.sendMessage([client], \"hot\");\n        }\n\n        if (this.options.liveReload) {\n          this.sendMessage([client], \"liveReload\");\n        }\n\n        if (\n          this.options.client &&\n          /** @type {ClientConfiguration} */\n          (this.options.client).progress\n        ) {\n          this.sendMessage(\n            [client],\n            \"progress\",\n            /** @type {ClientConfiguration} */\n            (this.options.client).progress,\n          );\n        }\n\n        if (\n          this.options.client &&\n          /** @type {ClientConfiguration} */\n          (this.options.client).reconnect\n        ) {\n          this.sendMessage(\n            [client],\n            \"reconnect\",\n            /** @type {ClientConfiguration} */\n            (this.options.client).reconnect,\n          );\n        }\n\n        if (\n          this.options.client &&\n          /** @type {ClientConfiguration} */\n          (this.options.client).overlay\n        ) {\n          const overlayConfig =\n            /** @type {ClientConfiguration} */\n            (this.options.client).overlay;\n\n          this.sendMessage(\n            [client],\n            \"overlay\",\n            typeof overlayConfig === \"object\"\n              ? {\n                  ...overlayConfig,\n                  errors:\n                    overlayConfig.errors &&\n                    encodeOverlaySettings(overlayConfig.errors),\n                  warnings:\n                    overlayConfig.warnings &&\n                    encodeOverlaySettings(overlayConfig.warnings),\n                  runtimeErrors:\n                    overlayConfig.runtimeErrors &&\n                    encodeOverlaySettings(overlayConfig.runtimeErrors),\n                }\n              : overlayConfig,\n          );\n        }\n\n        if (!this.stats) {\n          return;\n        }\n\n        this.sendStats([client], this.getStats(this.stats), true);\n      },\n    );\n  }\n\n  /**\n   * @private\n   * @param {string} defaultOpenTarget default open target\n   * @returns {Promise<void>}\n   */\n  async openBrowser(defaultOpenTarget) {\n    const open = (await import(\"open\")).default;\n\n    Promise.all(\n      /** @type {NormalizedOpen[]} */\n      (this.options.open).map((item) => {\n        /**\n         * @type {string}\n         */\n        let openTarget;\n\n        if (item.target === \"<url>\") {\n          openTarget = defaultOpenTarget;\n        } else {\n          openTarget = Server.isAbsoluteURL(item.target)\n            ? item.target\n            : new URL(item.target, defaultOpenTarget).toString();\n        }\n\n        return open(openTarget, item.options).catch(() => {\n          this.logger.warn(\n            `Unable to open \"${openTarget}\" page${\n              item.options.app\n                ? ` in \"${\n                    /** @type {import(\"open\").App} */\n                    (item.options.app).name\n                  }\" app${\n                    /** @type {import(\"open\").App} */\n                    (item.options.app).arguments\n                      ? ` with \"${\n                          /** @type {import(\"open\").App} */\n                          (item.options.app).arguments.join(\" \")\n                        }\" arguments`\n                      : \"\"\n                  }`\n                : \"\"\n            }. If you are running in a headless environment, please do not use the \"open\" option or related flags like \"--open\", \"--open-target\", and \"--open-app-name\".`,\n          );\n        });\n      }),\n    );\n  }\n\n  /**\n   * @private\n   * @returns {void}\n   */\n  runBonjour() {\n    const { Bonjour } = require(\"bonjour-service\");\n\n    const type = this.isTlsServer ? \"https\" : \"http\";\n\n    /**\n     * @private\n     * @type {Bonjour | undefined}\n     */\n    this.bonjour = new Bonjour();\n    this.bonjour.publish({\n      name: `Webpack Dev Server ${os.hostname()}:${this.options.port}`,\n      port: /** @type {number} */ (this.options.port),\n      type,\n      subtypes: [\"webpack\"],\n      .../** @type {Partial<BonjourOptions>} */ (this.options.bonjour),\n    });\n  }\n\n  /**\n   * @private\n   * @param {() => void} callback callback\n   * @returns {void}\n   */\n  stopBonjour(callback = () => {}) {\n    /** @type {Bonjour} */\n    (this.bonjour).unpublishAll(() => {\n      /** @type {Bonjour} */\n      (this.bonjour).destroy();\n\n      if (callback) {\n        callback();\n      }\n    });\n  }\n\n  /**\n   * @private\n   * @returns {Promise<void>}\n   */\n  async logStatus() {\n    const { cyan, isColorSupported, red } = require(\"colorette\");\n\n    /**\n     * @param {Compiler[\"options\"]} compilerOptions compiler options\n     * @returns {boolean} value of the color option\n     */\n    const getColorsOption = (compilerOptions) => {\n      /**\n       * @type {boolean}\n       */\n      let colorsEnabled;\n\n      if (\n        compilerOptions.stats &&\n        typeof (/** @type {StatsOptions} */ (compilerOptions.stats).colors) !==\n          \"undefined\"\n      ) {\n        colorsEnabled =\n          /** @type {boolean} */\n          (/** @type {StatsOptions} */ (compilerOptions.stats).colors);\n      } else {\n        colorsEnabled = isColorSupported;\n      }\n\n      return colorsEnabled;\n    };\n\n    const colors = {\n      /**\n       * @param {boolean} useColor need to use color?\n       * @param {string} msg message\n       * @returns {string} message with color\n       */\n      info(useColor, msg) {\n        if (useColor) {\n          return cyan(msg);\n        }\n\n        return msg;\n      },\n      /**\n       * @param {boolean} useColor need to use color?\n       * @param {string} msg message\n       * @returns {string} message with colors\n       */\n      error(useColor, msg) {\n        if (useColor) {\n          return red(msg);\n        }\n\n        return msg;\n      },\n    };\n    const useColor = getColorsOption(this.getCompilerOptions());\n\n    const server = /** @type {S} */ (this.server);\n\n    if (this.options.ipc) {\n      this.logger.info(`Project is running at: \"${server.address()}\"`);\n    } else {\n      const protocol = this.isTlsServer ? \"https\" : \"http\";\n      const { address, port } =\n        /** @type {import(\"net\").AddressInfo} */\n        (server.address());\n      /**\n       * @param {string} newHostname new hostname\n       * @returns {string} prettified URL\n       */\n      const prettyPrintURL = (newHostname) =>\n        url.format({ protocol, hostname: newHostname, port, pathname: \"/\" });\n\n      let host;\n      let localhost;\n      let loopbackIPv4;\n      let loopbackIPv6;\n      let networkUrlIPv4;\n      let networkUrlIPv6;\n\n      if (this.options.host) {\n        if (this.options.host === \"localhost\") {\n          localhost = prettyPrintURL(\"localhost\");\n        } else {\n          let isIP;\n\n          try {\n            isIP = ipaddr.parse(this.options.host);\n          } catch {\n            // Ignore\n          }\n\n          if (!isIP) {\n            host = prettyPrintURL(this.options.host);\n          }\n        }\n      }\n\n      const parsedIP = ipaddr.parse(address);\n\n      if (parsedIP.range() === \"unspecified\") {\n        localhost = prettyPrintURL(\"localhost\");\n        loopbackIPv6 = prettyPrintURL(\"::1\");\n\n        const networkIPv4 = Server.findIp(\"v4\", false);\n\n        if (networkIPv4) {\n          networkUrlIPv4 = prettyPrintURL(networkIPv4);\n        }\n\n        const networkIPv6 = Server.findIp(\"v6\", false);\n\n        if (networkIPv6) {\n          networkUrlIPv6 = prettyPrintURL(networkIPv6);\n        }\n      } else if (parsedIP.range() === \"loopback\") {\n        if (parsedIP.kind() === \"ipv4\") {\n          loopbackIPv4 = prettyPrintURL(parsedIP.toString());\n        } else if (parsedIP.kind() === \"ipv6\") {\n          loopbackIPv6 = prettyPrintURL(parsedIP.toString());\n        }\n      } else {\n        networkUrlIPv4 =\n          parsedIP.kind() === \"ipv6\" &&\n          /** @type {IPv6} */\n          (parsedIP).isIPv4MappedAddress()\n            ? prettyPrintURL(\n                /** @type {IPv6} */\n                (parsedIP).toIPv4Address().toString(),\n              )\n            : prettyPrintURL(address);\n\n        if (parsedIP.kind() === \"ipv6\") {\n          networkUrlIPv6 = prettyPrintURL(address);\n        }\n      }\n\n      this.logger.info(\"Project is running at:\");\n\n      if (host) {\n        this.logger.info(`Server: ${colors.info(useColor, host)}`);\n      }\n\n      if (localhost || loopbackIPv4 || loopbackIPv6) {\n        const loopbacks = [];\n\n        if (localhost) {\n          loopbacks.push([colors.info(useColor, localhost)]);\n        }\n\n        if (loopbackIPv4) {\n          loopbacks.push([colors.info(useColor, loopbackIPv4)]);\n        }\n\n        if (loopbackIPv6) {\n          loopbacks.push([colors.info(useColor, loopbackIPv6)]);\n        }\n\n        this.logger.info(`Loopback: ${loopbacks.join(\", \")}`);\n      }\n\n      if (networkUrlIPv4) {\n        this.logger.info(\n          `On Your Network (IPv4): ${colors.info(useColor, networkUrlIPv4)}`,\n        );\n      }\n\n      if (networkUrlIPv6) {\n        this.logger.info(\n          `On Your Network (IPv6): ${colors.info(useColor, networkUrlIPv6)}`,\n        );\n      }\n\n      if (/** @type {NormalizedOpen[]} */ (this.options.open).length > 0) {\n        const openTarget = prettyPrintURL(\n          !this.options.host ||\n            this.options.host === \"0.0.0.0\" ||\n            this.options.host === \"::\"\n            ? \"localhost\"\n            : this.options.host,\n        );\n\n        await this.openBrowser(openTarget);\n      }\n    }\n\n    if (/** @type {NormalizedStatic[]} */ (this.options.static).length > 0) {\n      this.logger.info(\n        `Content not from webpack is served from '${colors.info(\n          useColor,\n          /** @type {NormalizedStatic[]} */\n          (this.options.static)\n            .map((staticOption) => staticOption.directory)\n            .join(\", \"),\n        )}' directory`,\n      );\n    }\n\n    if (this.options.historyApiFallback) {\n      this.logger.info(\n        `404s will fallback to '${colors.info(\n          useColor,\n          /** @type {ConnectHistoryApiFallbackOptions} */ (\n            this.options.historyApiFallback\n          ).index || \"/index.html\",\n        )}'`,\n      );\n    }\n\n    if (this.options.bonjour) {\n      const bonjourProtocol =\n        /** @type {BonjourOptions} */\n        (this.options.bonjour).type || this.isTlsServer ? \"https\" : \"http\";\n\n      this.logger.info(\n        `Broadcasting \"${bonjourProtocol}\" with subtype of \"webpack\" via ZeroConf DNS (Bonjour)`,\n      );\n    }\n  }\n\n  /**\n   * @private\n   * @param {Request} req request\n   * @param {Response} res response\n   * @param {NextFunction} next next function\n   */\n  setHeaders(req, res, next) {\n    let { headers } = this.options;\n\n    if (headers) {\n      if (typeof headers === \"function\") {\n        headers = headers(\n          req,\n          res,\n\n          this.middleware ? this.middleware.context : undefined,\n        );\n      }\n\n      /**\n       * @type {{ key: string, value: string }[]}\n       */\n      const allHeaders = [];\n\n      if (!Array.isArray(headers)) {\n        for (const name in headers) {\n          allHeaders.push({\n            key: name,\n            value: /** @type {string} */ (headers[name]),\n          });\n        }\n\n        headers = allHeaders;\n      }\n\n      for (const { key, value } of headers) {\n        res.setHeader(key, value);\n      }\n    }\n\n    next();\n  }\n\n  /**\n   * @private\n   * @param {string} value value\n   * @returns {boolean} true when host allowed, otherwise false\n   */\n  isHostAllowed(value) {\n    const { allowedHosts } = this.options;\n\n    // allow user to opt out of this security check, at their own risk\n    // by explicitly enabling allowedHosts\n    if (allowedHosts === \"all\") {\n      return true;\n    }\n\n    // always allow localhost host, for convenience\n    // allow if value is in allowedHosts\n    if (Array.isArray(allowedHosts) && allowedHosts.length > 0) {\n      for (const allowedHost of allowedHosts) {\n        if (allowedHost === value) {\n          return true;\n        }\n\n        // support \".\" as a subdomain wildcard\n        // e.g. \".example.com\" will allow \"example.com\", \"www.example.com\", \"subdomain.example.com\", etc\n        if (\n          allowedHost.startsWith(\".\") && // \"example.com\"  (value === allowedHost.substring(1))\n          // \"*.example.com\"  (value.endsWith(allowedHost))\n          (value === allowedHost.slice(1) ||\n            /** @type {string} */\n            (value).endsWith(allowedHost))\n        ) {\n          return true;\n        }\n      }\n    }\n\n    // Also allow if `client.webSocketURL.hostname` provided\n    if (\n      this.options.client &&\n      typeof (\n        /** @type {ClientConfiguration} */\n        (this.options.client).webSocketURL\n      ) !== \"undefined\"\n    ) {\n      return (\n        /** @type {WebSocketURL} */\n        (/** @type {ClientConfiguration} */ (this.options.client).webSocketURL)\n          .hostname === value\n      );\n    }\n\n    return false;\n  }\n\n  /**\n   * @private\n   * @param {{ [key: string]: string | undefined }} headers headers\n   * @param {string} headerToCheck header to check\n   * @param {boolean} validateHost need to validate host\n   * @returns {boolean} true when host is valid, otherwise false\n   */\n  isValidHost(headers, headerToCheck, validateHost = true) {\n    if (this.options.allowedHosts === \"all\") {\n      return true;\n    }\n\n    // get the Host header and extract hostname\n    // we don't care about port not matching\n    const header = headers[headerToCheck];\n\n    if (!header) {\n      return false;\n    }\n\n    if (DEFAULT_ALLOWED_PROTOCOLS.test(header)) {\n      return true;\n    }\n\n    // use the node url-parser to retrieve the hostname from the host-header.\n    // TODO resolve me in the next major release\n    // eslint-disable-next-line n/no-deprecated-api\n    const { hostname } = url.parse(\n      // if header doesn't have scheme, add // for parsing.\n      /^(.+:)?\\/\\//.test(header) ? header : `//${header}`,\n      false,\n      true,\n    );\n\n    if (hostname === null) {\n      return false;\n    }\n\n    if (this.isHostAllowed(hostname)) {\n      return true;\n    }\n\n    // always allow requests with explicit IPv4 or IPv6-address.\n    // A note on IPv6 addresses:\n    // header will always contain the brackets denoting\n    // an IPv6-address in URLs,\n    // these are removed from the hostname in url.parse(),\n    // so we have the pure IPv6-address in hostname.\n    // For convenience, always allow localhost (hostname === 'localhost')\n    // and its subdomains (hostname.endsWith(\".localhost\")).\n    // allow hostname of listening address  (hostname === this.options.host)\n    const isValidHostname = validateHost\n      ? ipaddr.IPv4.isValid(hostname) ||\n        ipaddr.IPv6.isValid(hostname) ||\n        hostname === \"localhost\" ||\n        hostname.endsWith(\".localhost\") ||\n        hostname === this.options.host\n      : false;\n\n    return isValidHostname;\n  }\n\n  /**\n   * @private\n   * @param {{ [key: string]: string | undefined }} headers headers\n   * @returns {boolean} true when is same origin, otherwise false\n   */\n  isSameOrigin(headers) {\n    if (this.options.allowedHosts === \"all\") {\n      return true;\n    }\n\n    const originHeader = headers.origin;\n\n    if (!originHeader) {\n      return this.options.allowedHosts === \"all\";\n    }\n\n    if (DEFAULT_ALLOWED_PROTOCOLS.test(originHeader)) {\n      return true;\n    }\n\n    // TODO resolve me in the next major release\n    // eslint-disable-next-line n/no-deprecated-api\n    const origin = url.parse(originHeader, false, true).hostname;\n\n    if (origin === null) {\n      return false;\n    }\n\n    if (this.isHostAllowed(origin)) {\n      return true;\n    }\n\n    const hostHeader = headers.host;\n\n    if (!hostHeader) {\n      return this.options.allowedHosts === \"all\";\n    }\n\n    if (DEFAULT_ALLOWED_PROTOCOLS.test(hostHeader)) {\n      return true;\n    }\n\n    // eslint-disable-next-line n/no-deprecated-api\n    const host = url.parse(\n      // if hostHeader doesn't have scheme, add // for parsing.\n      /^(.+:)?\\/\\//.test(hostHeader) ? hostHeader : `//${hostHeader}`,\n      false,\n      true,\n    ).hostname;\n\n    if (host === null) {\n      return false;\n    }\n\n    if (this.isHostAllowed(host)) {\n      return true;\n    }\n\n    return origin === host;\n  }\n\n  /**\n   * @param {ClientConnection[]} clients clients\n   * @param {string} type type\n   * @param {EXPECTED_ANY=} data data\n   * @param {EXPECTED_ANY=} params params\n   */\n  sendMessage(clients, type, data, params) {\n    for (const client of clients) {\n      // `sockjs` uses `1` to indicate client is ready to accept data\n      // `ws` uses `WebSocket.OPEN`, but it is mean `1` too\n      if (client.readyState === 1) {\n        client.send(JSON.stringify({ type, data, params }));\n      }\n    }\n  }\n\n  // Send stats to a socket or multiple sockets\n  /**\n   * @private\n   * @param {ClientConnection[]} clients clients\n   * @param {StatsCompilation} stats stats\n   * @param {boolean=} force force\n   */\n  sendStats(clients, stats, force) {\n    const shouldEmit =\n      !force &&\n      stats &&\n      (!stats.errors || stats.errors.length === 0) &&\n      (!stats.warnings || stats.warnings.length === 0) &&\n      this.currentHash === stats.hash;\n\n    if (shouldEmit) {\n      this.sendMessage(clients, \"still-ok\");\n\n      return;\n    }\n\n    this.currentHash = stats.hash;\n    this.sendMessage(clients, \"hash\", stats.hash);\n\n    if (\n      /** @type {NonNullable<StatsCompilation[\"errors\"]>} */\n      (stats.errors).length > 0 ||\n      /** @type {NonNullable<StatsCompilation[\"warnings\"]>} */\n      (stats.warnings).length > 0\n    ) {\n      const hasErrors =\n        /** @type {NonNullable<StatsCompilation[\"errors\"]>} */\n        (stats.errors).length > 0;\n\n      if (\n        /** @type {NonNullable<StatsCompilation[\"warnings\"]>} */\n        (stats.warnings).length > 0\n      ) {\n        let params;\n\n        if (hasErrors) {\n          params = { preventReloading: true };\n        }\n\n        this.sendMessage(clients, \"warnings\", stats.warnings, params);\n      }\n\n      if (\n        /** @type {NonNullable<StatsCompilation[\"errors\"]>} */ (stats.errors)\n          .length > 0\n      ) {\n        this.sendMessage(clients, \"errors\", stats.errors);\n      }\n    } else {\n      this.sendMessage(clients, \"ok\");\n    }\n  }\n\n  /**\n   * @param {string | string[]} watchPath watch path\n   * @param {WatchOptions=} watchOptions watch options\n   */\n  watchFiles(watchPath, watchOptions) {\n    const chokidar = require(\"chokidar\");\n\n    const watcher = chokidar.watch(watchPath, watchOptions);\n\n    // disabling refreshing on changing the content\n    if (this.options.liveReload) {\n      watcher.on(\"change\", (item) => {\n        if (this.webSocketServer) {\n          this.sendMessage(\n            this.webSocketServer.clients,\n            \"static-changed\",\n            item,\n          );\n        }\n      });\n    }\n\n    this.staticWatchers.push(watcher);\n  }\n\n  /**\n   * @param {import(\"webpack-dev-middleware\").Callback=} callback callback\n   */\n  invalidate(callback = () => {}) {\n    if (this.middleware) {\n      this.middleware.invalidate(callback);\n    }\n  }\n\n  /**\n   * @returns {Promise<void>}\n   */\n  async start() {\n    await this.normalizeOptions();\n\n    if (this.options.ipc) {\n      await /** @type {Promise<void>} */ (\n        new Promise((resolve, reject) => {\n          const net = require(\"node:net\");\n\n          const socket = new net.Socket();\n\n          socket.on(\n            \"error\",\n            /**\n             * @param {Error & { code?: string }} error error\n             */\n            (error) => {\n              if (error.code === \"ECONNREFUSED\") {\n                // No other server listening on this socket, so it can be safely removed\n                fs.unlinkSync(/** @type {string} */ (this.options.ipc));\n\n                resolve();\n\n                return;\n              } else if (error.code === \"ENOENT\") {\n                resolve();\n\n                return;\n              }\n\n              reject(error);\n            },\n          );\n\n          socket.connect(\n            { path: /** @type {string} */ (this.options.ipc) },\n            () => {\n              throw new Error(`IPC \"${this.options.ipc}\" is already used`);\n            },\n          );\n        })\n      );\n    } else {\n      this.options.host = await Server.getHostname(\n        /** @type {Host} */ (this.options.host),\n      );\n      this.options.port = await Server.getFreePort(\n        /** @type {Port} */ (this.options.port),\n        this.options.host,\n      );\n    }\n\n    await this.initialize();\n\n    const listenOptions = this.options.ipc\n      ? { path: this.options.ipc }\n      : { host: this.options.host, port: this.options.port };\n\n    await /** @type {Promise<void>} */ (\n      new Promise((resolve) => {\n        /** @type {S} */\n        (this.server).listen(listenOptions, () => {\n          resolve();\n        });\n      })\n    );\n\n    if (this.options.ipc) {\n      // chmod 666 (rw rw rw)\n      const READ_WRITE = 438;\n\n      await fs.promises.chmod(\n        /** @type {string} */ (this.options.ipc),\n        READ_WRITE,\n      );\n    }\n\n    if (this.options.webSocketServer) {\n      this.createWebSocketServer();\n    }\n\n    if (this.options.bonjour) {\n      this.runBonjour();\n    }\n\n    await this.logStatus();\n\n    if (typeof this.options.onListening === \"function\") {\n      this.options.onListening(this);\n    }\n  }\n\n  /**\n   * @param {((err?: Error) => void)=} callback callback\n   */\n  startCallback(callback = () => {}) {\n    this.start()\n      .then(() => callback(), callback)\n      .catch(callback);\n  }\n\n  /**\n   * @returns {Promise<void>}\n   */\n  async stop() {\n    if (this.bonjour) {\n      await /** @type {Promise<void>} */ (\n        new Promise((resolve) => {\n          this.stopBonjour(() => {\n            resolve();\n          });\n        })\n      );\n    }\n\n    this.webSocketProxies = [];\n\n    await Promise.all(this.staticWatchers.map((watcher) => watcher.close()));\n\n    this.staticWatchers = [];\n\n    if (this.webSocketServer) {\n      await /** @type {Promise<void>} */ (\n        new Promise((resolve) => {\n          /** @type {WebSocketServerImplementation} */\n          (this.webSocketServer).implementation.close(() => {\n            this.webSocketServer = null;\n\n            resolve();\n          });\n\n          for (const client of /** @type {WebSocketServerImplementation} */ (\n            this.webSocketServer\n          ).clients) {\n            client.terminate();\n          }\n\n          /** @type {WebSocketServerImplementation} */\n          (this.webSocketServer).clients = [];\n        })\n      );\n    }\n\n    if (this.server) {\n      await /** @type {Promise<void>} */ (\n        new Promise((resolve) => {\n          /** @type {S} */\n          (this.server).close(() => {\n            this.server = undefined;\n            resolve();\n          });\n\n          for (const socket of this.sockets) {\n            socket.destroy();\n          }\n\n          this.sockets = [];\n        })\n      );\n\n      if (this.middleware) {\n        await /** @type {Promise<void>} */ (\n          new Promise((resolve, reject) => {\n            /** @type {import(\"webpack-dev-middleware\").API<Request, Response>} */\n            (this.middleware).close((error) => {\n              if (error) {\n                reject(error);\n                return;\n              }\n\n              resolve();\n            });\n          })\n        );\n\n        this.middleware = undefined;\n      }\n    }\n\n    // We add listeners to signals when creating a new Server instance\n    // So ensure they are removed to prevent EventEmitter memory leak warnings\n    for (const item of this.listeners) {\n      process.removeListener(item.name, item.listener);\n    }\n  }\n\n  /**\n   * @param {((err?: Error) => void)=} callback callback\n   */\n  stopCallback(callback = () => {}) {\n    this.stop()\n      .then(() => callback(), callback)\n      .catch(callback);\n  }\n}\n\nmodule.exports = Server;\n"
  },
  {
    "path": "lib/getPort.js",
    "content": "\"use strict\";\n\n/*\n * Based on the packages get-port https://www.npmjs.com/package/get-port\n * and portfinder https://www.npmjs.com/package/portfinder\n * The code structure is similar to get-port, but it searches\n * ports deterministically like portfinder\n */\nconst net = require(\"node:net\");\nconst os = require(\"node:os\");\n\nconst minPort = 1024;\nconst maxPort = 65_535;\n\n/**\n * @returns {Set<string | undefined>} local hosts\n */\nconst getLocalHosts = () => {\n  const interfaces = os.networkInterfaces();\n\n  // Add undefined value for createServer function to use default host,\n  // and default IPv4 host in case createServer defaults to IPv6.\n\n  const results = new Set([undefined, \"0.0.0.0\"]);\n\n  for (const _interface of Object.values(interfaces)) {\n    if (_interface) {\n      for (const config of _interface) {\n        results.add(config.address);\n      }\n    }\n  }\n\n  return results;\n};\n\n/**\n * @param {number} basePort base port\n * @param {string | undefined} host host\n * @returns {Promise<number>} resolved port\n */\nconst checkAvailablePort = (basePort, host) =>\n  new Promise((resolve, reject) => {\n    const server = net.createServer();\n    server.unref();\n    server.on(\"error\", reject);\n\n    server.listen(basePort, host, () => {\n      // Next line should return AddressInfo because we're calling it after listen() and before close()\n      const { port } = /** @type {import(\"net\").AddressInfo} */ (\n        server.address()\n      );\n      server.close(() => {\n        resolve(port);\n      });\n    });\n  });\n\n/**\n * @param {number} port port\n * @param {Set<string|undefined>} hosts hosts\n * @returns {Promise<number>} resolved port\n */\nconst getAvailablePort = async (port, hosts) => {\n  /**\n   * Errors that mean that host is not available.\n   * @type {Set<string | undefined>}\n   */\n  const nonExistentInterfaceErrors = new Set([\"EADDRNOTAVAIL\", \"EINVAL\"]);\n  /* Check if the post is available on every local host name */\n  for (const host of hosts) {\n    try {\n      await checkAvailablePort(port, host);\n    } catch (error) {\n      /* We throw an error only if the interface exists */\n      if (\n        !nonExistentInterfaceErrors.has(\n          /** @type {NodeJS.ErrnoException} */ (error).code,\n        )\n      ) {\n        throw error;\n      }\n    }\n  }\n\n  return port;\n};\n\n/**\n * @param {number} basePort base port\n * @param {string=} host host\n * @returns {Promise<number>} resolved port\n */\nasync function getPorts(basePort, host) {\n  if (basePort < minPort || basePort > maxPort) {\n    throw new Error(`Port number must lie between ${minPort} and ${maxPort}`);\n  }\n\n  let port = basePort;\n\n  const localhosts = getLocalHosts();\n  const hosts =\n    host && !localhosts.has(host)\n      ? new Set([host])\n      : /* If the host is equivalent to localhost\n       we need to check every equivalent host\n       else the port might falsely appear as available\n       on some operating systems  */\n        localhosts;\n  /** @type {Set<string | undefined>} */\n  const portUnavailableErrors = new Set([\"EADDRINUSE\", \"EACCES\"]);\n  while (port <= maxPort) {\n    try {\n      const availablePort = await getAvailablePort(port, hosts);\n      return availablePort;\n    } catch (error) {\n      /* Try next port if port is busy; throw for any other error */\n      if (\n        !portUnavailableErrors.has(\n          /** @type {NodeJS.ErrnoException} */ (error).code,\n        )\n      ) {\n        throw error;\n      }\n      port += 1;\n    }\n  }\n\n  throw new Error(\"No available ports found\");\n}\n\nmodule.exports = getPorts;\n"
  },
  {
    "path": "lib/options.json",
    "content": "{\n  \"title\": \"Dev Server options\",\n  \"type\": \"object\",\n  \"definitions\": {\n    \"App\": {\n      \"instanceof\": \"Function\",\n      \"description\": \"Allows to use custom applications, such as 'connect', 'fastify', etc.\",\n      \"link\": \"https://webpack.js.org/configuration/dev-server/#devserverapp\"\n    },\n    \"AllowedHosts\": {\n      \"anyOf\": [\n        {\n          \"type\": \"array\",\n          \"minItems\": 1,\n          \"items\": {\n            \"$ref\": \"#/definitions/AllowedHostsItem\"\n          }\n        },\n        {\n          \"enum\": [\"auto\", \"all\"]\n        },\n        {\n          \"$ref\": \"#/definitions/AllowedHostsItem\"\n        }\n      ],\n      \"description\": \"Allows to enumerate the hosts from which access to the dev server are allowed (useful when you are proxying dev server, by default is 'auto').\",\n      \"link\": \"https://webpack.js.org/configuration/dev-server/#devserverallowedhosts\"\n    },\n    \"AllowedHostsItem\": {\n      \"type\": \"string\",\n      \"minLength\": 1\n    },\n    \"Bonjour\": {\n      \"anyOf\": [\n        {\n          \"type\": \"boolean\",\n          \"cli\": {\n            \"negatedDescription\": \"Disallows to broadcasts dev server via ZeroConf networking on start.\"\n          }\n        },\n        {\n          \"type\": \"object\",\n          \"description\": \"Options for bonjour.\",\n          \"link\": \"https://github.com/watson/bonjour#initializing\"\n        }\n      ],\n      \"description\": \"Allows to broadcasts dev server via ZeroConf networking on start.\",\n      \"link\": \" https://webpack.js.org/configuration/dev-server/#devserverbonjour\"\n    },\n    \"Client\": {\n      \"description\": \"Allows to specify options for client script in the browser or disable client script.\",\n      \"link\": \"https://webpack.js.org/configuration/dev-server/#devserverclient\",\n      \"anyOf\": [\n        {\n          \"enum\": [false],\n          \"cli\": {\n            \"negatedDescription\": \"Disables client script.\"\n          }\n        },\n        {\n          \"type\": \"object\",\n          \"additionalProperties\": false,\n          \"properties\": {\n            \"logging\": {\n              \"$ref\": \"#/definitions/ClientLogging\"\n            },\n            \"overlay\": {\n              \"$ref\": \"#/definitions/ClientOverlay\"\n            },\n            \"progress\": {\n              \"$ref\": \"#/definitions/ClientProgress\"\n            },\n            \"reconnect\": {\n              \"$ref\": \"#/definitions/ClientReconnect\"\n            },\n            \"webSocketTransport\": {\n              \"$ref\": \"#/definitions/ClientWebSocketTransport\"\n            },\n            \"webSocketURL\": {\n              \"$ref\": \"#/definitions/ClientWebSocketURL\"\n            }\n          }\n        }\n      ]\n    },\n    \"ClientLogging\": {\n      \"enum\": [\"none\", \"error\", \"warn\", \"info\", \"log\", \"verbose\"],\n      \"description\": \"Allows to set log level in the browser.\",\n      \"link\": \"https://webpack.js.org/configuration/dev-server/#logging\"\n    },\n    \"ClientOverlay\": {\n      \"anyOf\": [\n        {\n          \"description\": \"Enables a full-screen overlay in the browser when there are compiler errors or warnings.\",\n          \"link\": \"https://webpack.js.org/configuration/dev-server/#overlay\",\n          \"type\": \"boolean\",\n          \"cli\": {\n            \"negatedDescription\": \"Disables the full-screen overlay in the browser when there are compiler errors or warnings.\"\n          }\n        },\n        {\n          \"type\": \"object\",\n          \"additionalProperties\": false,\n          \"properties\": {\n            \"errors\": {\n              \"anyOf\": [\n                {\n                  \"description\": \"Enables a full-screen overlay in the browser when there are compiler errors.\",\n                  \"type\": \"boolean\",\n                  \"cli\": {\n                    \"negatedDescription\": \"Disables the full-screen overlay in the browser when there are compiler errors.\"\n                  }\n                },\n                {\n                  \"instanceof\": \"Function\",\n                  \"description\": \"Filter compiler errors. Return true to include and return false to exclude.\"\n                }\n              ]\n            },\n            \"warnings\": {\n              \"anyOf\": [\n                {\n                  \"description\": \"Enables a full-screen overlay in the browser when there are compiler warnings.\",\n                  \"type\": \"boolean\",\n                  \"cli\": {\n                    \"negatedDescription\": \"Disables the full-screen overlay in the browser when there are compiler warnings.\"\n                  }\n                },\n                {\n                  \"instanceof\": \"Function\",\n                  \"description\": \"Filter compiler warnings. Return true to include and return false to exclude.\"\n                }\n              ]\n            },\n            \"runtimeErrors\": {\n              \"anyOf\": [\n                {\n                  \"description\": \"Enables a full-screen overlay in the browser when there are uncaught runtime errors.\",\n                  \"type\": \"boolean\",\n                  \"cli\": {\n                    \"negatedDescription\": \"Disables the full-screen overlay in the browser when there are uncaught runtime errors.\"\n                  }\n                },\n                {\n                  \"instanceof\": \"Function\",\n                  \"description\": \"Filter uncaught runtime errors. Return true to include and return false to exclude.\"\n                }\n              ]\n            },\n            \"trustedTypesPolicyName\": {\n              \"description\": \"The name of a Trusted Types policy for the overlay. Defaults to 'webpack-dev-server#overlay'.\",\n              \"type\": \"string\"\n            }\n          }\n        }\n      ]\n    },\n    \"ClientProgress\": {\n      \"description\": \"Displays compilation progress in the browser. Options include 'linear' and 'circular' for visual indicators.\",\n      \"link\": \"https://webpack.js.org/configuration/dev-server/#progress\",\n      \"type\": [\"boolean\", \"string\"],\n      \"enum\": [true, false, \"linear\", \"circular\"],\n      \"cli\": {\n        \"negatedDescription\": \"Does not display compilation progress in the browser.\"\n      }\n    },\n    \"ClientReconnect\": {\n      \"description\": \"Tells dev-server the number of times it should try to reconnect the client.\",\n      \"link\": \"https://webpack.js.org/configuration/dev-server/#reconnect\",\n      \"anyOf\": [\n        {\n          \"type\": \"boolean\",\n          \"cli\": {\n            \"negatedDescription\": \"Tells dev-server to not to try to reconnect the client.\"\n          }\n        },\n        {\n          \"type\": \"number\",\n          \"minimum\": 0\n        }\n      ]\n    },\n    \"ClientWebSocketTransport\": {\n      \"anyOf\": [\n        {\n          \"$ref\": \"#/definitions/ClientWebSocketTransportEnum\"\n        },\n        {\n          \"$ref\": \"#/definitions/ClientWebSocketTransportString\"\n        }\n      ],\n      \"description\": \"Allows to set custom web socket transport to communicate with dev server.\",\n      \"link\": \"https://webpack.js.org/configuration/dev-server/#websockettransport\"\n    },\n    \"ClientWebSocketTransportEnum\": {\n      \"enum\": [\"sockjs\", \"ws\"]\n    },\n    \"ClientWebSocketTransportString\": {\n      \"type\": \"string\",\n      \"minLength\": 1\n    },\n    \"ClientWebSocketURL\": {\n      \"description\": \"Allows to specify URL to web socket server (useful when you're proxying dev server and client script does not always know where to connect to).\",\n      \"link\": \"https://webpack.js.org/configuration/dev-server/#websocketurl\",\n      \"anyOf\": [\n        {\n          \"type\": \"string\",\n          \"minLength\": 1\n        },\n        {\n          \"type\": \"object\",\n          \"additionalProperties\": false,\n          \"properties\": {\n            \"hostname\": {\n              \"description\": \"Tells clients connected to devServer to use the provided hostname.\",\n              \"type\": \"string\",\n              \"minLength\": 1\n            },\n            \"pathname\": {\n              \"description\": \"Tells clients connected to devServer to use the provided path to connect.\",\n              \"type\": \"string\"\n            },\n            \"password\": {\n              \"description\": \"Tells clients connected to devServer to use the provided password to authenticate.\",\n              \"type\": \"string\"\n            },\n            \"port\": {\n              \"description\": \"Tells clients connected to devServer to use the provided port.\",\n              \"anyOf\": [\n                {\n                  \"type\": \"number\"\n                },\n                {\n                  \"type\": \"string\",\n                  \"minLength\": 1\n                }\n              ]\n            },\n            \"protocol\": {\n              \"description\": \"Tells clients connected to devServer to use the provided protocol.\",\n              \"anyOf\": [\n                {\n                  \"enum\": [\"auto\"]\n                },\n                {\n                  \"type\": \"string\",\n                  \"minLength\": 1\n                }\n              ]\n            },\n            \"username\": {\n              \"description\": \"Tells clients connected to devServer to use the provided username to authenticate.\",\n              \"type\": \"string\"\n            }\n          }\n        }\n      ]\n    },\n    \"Compress\": {\n      \"type\": \"boolean\",\n      \"description\": \"Enables gzip compression for everything served.\",\n      \"link\": \"https://webpack.js.org/configuration/dev-server/#devservercompress\",\n      \"cli\": {\n        \"negatedDescription\": \"Disables gzip compression for everything served.\"\n      }\n    },\n    \"DevMiddleware\": {\n      \"description\": \"Provide options to 'webpack-dev-middleware' which handles webpack assets.\",\n      \"link\": \"https://webpack.js.org/configuration/dev-server/#devserverdevmiddleware\",\n      \"type\": \"object\",\n      \"additionalProperties\": true\n    },\n    \"HeaderObject\": {\n      \"type\": \"object\",\n      \"additionalProperties\": false,\n      \"properties\": {\n        \"key\": {\n          \"description\": \"key of header.\",\n          \"type\": \"string\"\n        },\n        \"value\": {\n          \"description\": \"value of header.\",\n          \"type\": \"string\"\n        }\n      },\n      \"cli\": {\n        \"exclude\": true\n      }\n    },\n    \"Headers\": {\n      \"anyOf\": [\n        {\n          \"type\": \"array\",\n          \"items\": {\n            \"$ref\": \"#/definitions/HeaderObject\"\n          },\n          \"minItems\": 1\n        },\n        {\n          \"type\": \"object\"\n        },\n        {\n          \"instanceof\": \"Function\"\n        }\n      ],\n      \"description\": \"Allows to set custom headers on response.\",\n      \"link\": \"https://webpack.js.org/configuration/dev-server/#devserverheaders\"\n    },\n    \"HistoryApiFallback\": {\n      \"anyOf\": [\n        {\n          \"type\": \"boolean\",\n          \"cli\": {\n            \"negatedDescription\": \"Disallows to proxy requests through a specified index page.\"\n          }\n        },\n        {\n          \"type\": \"object\",\n          \"description\": \"Options for `historyApiFallback`.\",\n          \"link\": \"https://github.com/bripkens/connect-history-api-fallback#options\"\n        }\n      ],\n      \"description\": \"Allows to proxy requests through a specified index page (by default 'index.html'), useful for Single Page Applications that utilise the HTML5 History API.\",\n      \"link\": \"https://webpack.js.org/configuration/dev-server/#devserverhistoryapifallback\"\n    },\n    \"Host\": {\n      \"description\": \"Allows to specify a hostname to use.\",\n      \"link\": \"https://webpack.js.org/configuration/dev-server/#devserverhost\",\n      \"anyOf\": [\n        {\n          \"enum\": [\"local-ip\", \"local-ipv4\", \"local-ipv6\"]\n        },\n        {\n          \"type\": \"string\",\n          \"minLength\": 1\n        }\n      ]\n    },\n    \"Hot\": {\n      \"anyOf\": [\n        {\n          \"type\": \"boolean\",\n          \"cli\": {\n            \"negatedDescription\": \"Disables Hot Module Replacement.\"\n          }\n        },\n        {\n          \"enum\": [\"only\"]\n        }\n      ],\n      \"description\": \"Enables Hot Module Replacement.\",\n      \"link\": \"https://webpack.js.org/configuration/dev-server/#devserverhot\"\n    },\n    \"IPC\": {\n      \"anyOf\": [\n        {\n          \"type\": \"string\",\n          \"minLength\": 1\n        },\n        {\n          \"type\": \"boolean\",\n          \"enum\": [true]\n        }\n      ],\n      \"description\": \"Listen to a unix socket.\",\n      \"link\": \"https://webpack.js.org/configuration/dev-server/#devserveripc\"\n    },\n    \"LiveReload\": {\n      \"type\": \"boolean\",\n      \"description\": \"Enables reload/refresh the page(s) when file changes are detected (enabled by default).\",\n      \"cli\": {\n        \"negatedDescription\": \"Disables reload/refresh the page(s) when file changes are detected (enabled by default).\"\n      },\n      \"link\": \"https://webpack.js.org/configuration/dev-server/#devserverlivereload\"\n    },\n    \"OnListening\": {\n      \"instanceof\": \"Function\",\n      \"description\": \"Provides the ability to execute a custom function when dev server starts listening.\",\n      \"link\": \"https://webpack.js.org/configuration/dev-server/#devserveronlistening\"\n    },\n    \"Open\": {\n      \"anyOf\": [\n        {\n          \"type\": \"array\",\n          \"items\": {\n            \"anyOf\": [\n              {\n                \"$ref\": \"#/definitions/OpenString\"\n              },\n              {\n                \"$ref\": \"#/definitions/OpenObject\"\n              }\n            ]\n          }\n        },\n        {\n          \"$ref\": \"#/definitions/OpenBoolean\"\n        },\n        {\n          \"$ref\": \"#/definitions/OpenString\"\n        },\n        {\n          \"$ref\": \"#/definitions/OpenObject\"\n        }\n      ],\n      \"description\": \"Allows to configure dev server to open the browser(s) and page(s) after server had been started (set it to true to open your default browser).\",\n      \"link\": \"https://webpack.js.org/configuration/dev-server/#devserveropen\"\n    },\n    \"OpenBoolean\": {\n      \"type\": \"boolean\",\n      \"cli\": {\n        \"negatedDescription\": \"Does not open the default browser.\"\n      }\n    },\n    \"OpenObject\": {\n      \"type\": \"object\",\n      \"additionalProperties\": false,\n      \"properties\": {\n        \"target\": {\n          \"anyOf\": [\n            {\n              \"type\": \"array\",\n              \"items\": {\n                \"type\": \"string\"\n              }\n            },\n            {\n              \"type\": \"string\"\n            }\n          ],\n          \"description\": \"Opens specified page in browser.\"\n        },\n        \"app\": {\n          \"anyOf\": [\n            {\n              \"type\": \"object\",\n              \"additionalProperties\": false,\n              \"properties\": {\n                \"name\": {\n                  \"anyOf\": [\n                    {\n                      \"type\": \"array\",\n                      \"items\": {\n                        \"type\": \"string\",\n                        \"minLength\": 1\n                      },\n                      \"minItems\": 1\n                    },\n                    {\n                      \"type\": \"string\",\n                      \"minLength\": 1\n                    }\n                  ]\n                },\n                \"arguments\": {\n                  \"items\": {\n                    \"type\": \"string\",\n                    \"minLength\": 1\n                  }\n                }\n              }\n            },\n            {\n              \"type\": \"string\",\n              \"minLength\": 1,\n              \"description\": \"Open specified browser.\",\n              \"cli\": {\n                \"exclude\": true\n              }\n            }\n          ],\n          \"description\": \"Open specified browser.\"\n        }\n      }\n    },\n    \"OpenString\": {\n      \"type\": \"string\",\n      \"minLength\": 1\n    },\n    \"Port\": {\n      \"anyOf\": [\n        {\n          \"type\": \"number\",\n          \"minimum\": 0,\n          \"maximum\": 65535\n        },\n        {\n          \"type\": \"string\",\n          \"minLength\": 1\n        },\n        {\n          \"enum\": [\"auto\"]\n        }\n      ],\n      \"description\": \"Allows to specify a port to use.\",\n      \"link\": \"https://webpack.js.org/configuration/dev-server/#devserverport\"\n    },\n    \"Proxy\": {\n      \"type\": \"array\",\n      \"items\": {\n        \"anyOf\": [\n          {\n            \"type\": \"object\"\n          },\n          {\n            \"instanceof\": \"Function\"\n          }\n        ]\n      },\n      \"description\": \"Allows to proxy requests, can be useful when you have a separate API backend development server and you want to send API requests on the same domain.\",\n      \"link\": \"https://webpack.js.org/configuration/dev-server/#devserverproxy\"\n    },\n    \"Server\": {\n      \"anyOf\": [\n        {\n          \"$ref\": \"#/definitions/ServerEnum\"\n        },\n        {\n          \"$ref\": \"#/definitions/ServerFn\"\n        },\n        {\n          \"$ref\": \"#/definitions/ServerString\"\n        },\n        {\n          \"$ref\": \"#/definitions/ServerObject\"\n        }\n      ],\n      \"link\": \"https://webpack.js.org/configuration/dev-server/#devserverserver\",\n      \"description\": \"Allows to set server and options (by default 'http').\"\n    },\n    \"ServerType\": {\n      \"enum\": [\"http\", \"https\", \"spdy\", \"http2\"]\n    },\n    \"ServerFn\": {\n      \"instanceof\": \"Function\"\n    },\n    \"ServerEnum\": {\n      \"enum\": [\"http\", \"https\", \"spdy\", \"http2\"],\n      \"cli\": {\n        \"exclude\": true\n      }\n    },\n    \"ServerString\": {\n      \"type\": \"string\",\n      \"minLength\": 1,\n      \"cli\": {\n        \"exclude\": true\n      }\n    },\n    \"ServerObject\": {\n      \"type\": \"object\",\n      \"properties\": {\n        \"type\": {\n          \"anyOf\": [\n            {\n              \"$ref\": \"#/definitions/ServerType\"\n            },\n            {\n              \"$ref\": \"#/definitions/ServerString\"\n            },\n            {\n              \"$ref\": \"#/definitions/ServerFn\"\n            }\n          ]\n        },\n        \"options\": {\n          \"$ref\": \"#/definitions/ServerOptions\"\n        }\n      },\n      \"additionalProperties\": false\n    },\n    \"ServerOptions\": {\n      \"type\": \"object\",\n      \"additionalProperties\": true,\n      \"properties\": {\n        \"passphrase\": {\n          \"type\": \"string\",\n          \"description\": \"Passphrase for a pfx file.\"\n        },\n        \"requestCert\": {\n          \"type\": \"boolean\",\n          \"description\": \"Request for an SSL certificate.\",\n          \"cli\": {\n            \"negatedDescription\": \"Does not request for an SSL certificate.\"\n          }\n        },\n        \"ca\": {\n          \"anyOf\": [\n            {\n              \"type\": \"array\",\n              \"items\": {\n                \"anyOf\": [\n                  {\n                    \"type\": \"string\"\n                  },\n                  {\n                    \"instanceof\": \"Buffer\"\n                  }\n                ]\n              }\n            },\n            {\n              \"type\": \"string\"\n            },\n            {\n              \"instanceof\": \"Buffer\"\n            }\n          ],\n          \"description\": \"Path to an SSL CA certificate or content of an SSL CA certificate.\"\n        },\n        \"cert\": {\n          \"anyOf\": [\n            {\n              \"type\": \"array\",\n              \"items\": {\n                \"anyOf\": [\n                  {\n                    \"type\": \"string\"\n                  },\n                  {\n                    \"instanceof\": \"Buffer\"\n                  }\n                ]\n              }\n            },\n            {\n              \"type\": \"string\"\n            },\n            {\n              \"instanceof\": \"Buffer\"\n            }\n          ],\n          \"description\": \"Path to an SSL certificate or content of an SSL certificate.\"\n        },\n        \"crl\": {\n          \"anyOf\": [\n            {\n              \"type\": \"array\",\n              \"items\": {\n                \"anyOf\": [\n                  {\n                    \"type\": \"string\"\n                  },\n                  {\n                    \"instanceof\": \"Buffer\"\n                  }\n                ]\n              }\n            },\n            {\n              \"type\": \"string\"\n            },\n            {\n              \"instanceof\": \"Buffer\"\n            }\n          ],\n          \"description\": \"Path to PEM formatted CRLs (Certificate Revocation Lists) or content of PEM formatted CRLs (Certificate Revocation Lists).\"\n        },\n        \"key\": {\n          \"anyOf\": [\n            {\n              \"type\": \"array\",\n              \"items\": {\n                \"anyOf\": [\n                  {\n                    \"type\": \"string\"\n                  },\n                  {\n                    \"instanceof\": \"Buffer\"\n                  },\n                  {\n                    \"type\": \"object\",\n                    \"additionalProperties\": true\n                  }\n                ]\n              }\n            },\n            {\n              \"type\": \"string\"\n            },\n            {\n              \"instanceof\": \"Buffer\"\n            }\n          ],\n          \"description\": \"Path to an SSL key or content of an SSL key.\"\n        },\n        \"pfx\": {\n          \"anyOf\": [\n            {\n              \"type\": \"array\",\n              \"items\": {\n                \"anyOf\": [\n                  {\n                    \"type\": \"string\"\n                  },\n                  {\n                    \"instanceof\": \"Buffer\"\n                  },\n                  {\n                    \"type\": \"object\",\n                    \"additionalProperties\": true\n                  }\n                ]\n              }\n            },\n            {\n              \"type\": \"string\"\n            },\n            {\n              \"instanceof\": \"Buffer\"\n            }\n          ],\n          \"description\": \"Path to an SSL pfx file or content of an SSL pfx file.\"\n        }\n      }\n    },\n    \"SetupExitSignals\": {\n      \"type\": \"boolean\",\n      \"description\": \"Allows to close dev server and exit the process on SIGINT and SIGTERM signals (enabled by default for CLI).\",\n      \"link\": \"https://webpack.js.org/configuration/dev-server/#devserversetupexitsignals\",\n      \"cli\": {\n        \"exclude\": true\n      }\n    },\n    \"SetupMiddlewares\": {\n      \"instanceof\": \"Function\",\n      \"description\": \"Provides the ability to execute a custom function and apply custom middleware(s).\",\n      \"link\": \"https://webpack.js.org/configuration/dev-server/#devserversetupmiddlewares\"\n    },\n    \"Static\": {\n      \"anyOf\": [\n        {\n          \"type\": \"array\",\n          \"items\": {\n            \"anyOf\": [\n              {\n                \"$ref\": \"#/definitions/StaticString\"\n              },\n              {\n                \"$ref\": \"#/definitions/StaticObject\"\n              }\n            ]\n          }\n        },\n        {\n          \"type\": \"boolean\",\n          \"cli\": {\n            \"negatedDescription\": \"Disallows to configure options for serving static files from directory.\"\n          }\n        },\n        {\n          \"$ref\": \"#/definitions/StaticString\"\n        },\n        {\n          \"$ref\": \"#/definitions/StaticObject\"\n        }\n      ],\n      \"description\": \"Allows to configure options for serving static files from directory (by default 'public' directory).\",\n      \"link\": \"https://webpack.js.org/configuration/dev-server/#devserverstatic\"\n    },\n    \"StaticObject\": {\n      \"type\": \"object\",\n      \"additionalProperties\": false,\n      \"properties\": {\n        \"directory\": {\n          \"type\": \"string\",\n          \"minLength\": 1,\n          \"description\": \"Directory for static contents.\",\n          \"link\": \"https://webpack.js.org/configuration/dev-server/#directory\"\n        },\n        \"staticOptions\": {\n          \"type\": \"object\",\n          \"link\": \"https://webpack.js.org/configuration/dev-server/#staticoptions\",\n          \"additionalProperties\": true\n        },\n        \"publicPath\": {\n          \"anyOf\": [\n            {\n              \"type\": \"array\",\n              \"items\": {\n                \"type\": \"string\"\n              },\n              \"minItems\": 1\n            },\n            {\n              \"type\": \"string\"\n            }\n          ],\n          \"description\": \"The static files will be available in the browser under this public path.\",\n          \"link\": \"https://webpack.js.org/configuration/dev-server/#publicpath\"\n        },\n        \"serveIndex\": {\n          \"anyOf\": [\n            {\n              \"type\": \"boolean\",\n              \"cli\": {\n                \"negatedDescription\": \"Does not tell dev server to use serveIndex middleware.\"\n              }\n            },\n            {\n              \"type\": \"object\",\n              \"additionalProperties\": true\n            }\n          ],\n          \"description\": \"Tells dev server to use serveIndex middleware when enabled.\",\n          \"link\": \"https://webpack.js.org/configuration/dev-server/#serveindex\"\n        },\n        \"watch\": {\n          \"anyOf\": [\n            {\n              \"type\": \"boolean\",\n              \"cli\": {\n                \"negatedDescription\": \"Does not watch for files in static content directory.\"\n              }\n            },\n            {\n              \"type\": \"object\",\n              \"description\": \"Options for watch.\",\n              \"link\": \"https://github.com/paulmillr/chokidar#api\"\n            }\n          ],\n          \"description\": \"Watches for files in static content directory.\",\n          \"link\": \"https://webpack.js.org/configuration/dev-server/#watch\"\n        }\n      }\n    },\n    \"StaticString\": {\n      \"type\": \"string\",\n      \"minLength\": 1\n    },\n    \"WatchFiles\": {\n      \"anyOf\": [\n        {\n          \"type\": \"array\",\n          \"items\": {\n            \"anyOf\": [\n              {\n                \"$ref\": \"#/definitions/WatchFilesString\"\n              },\n              {\n                \"$ref\": \"#/definitions/WatchFilesObject\"\n              }\n            ]\n          }\n        },\n        {\n          \"$ref\": \"#/definitions/WatchFilesString\"\n        },\n        {\n          \"$ref\": \"#/definitions/WatchFilesObject\"\n        }\n      ],\n      \"description\": \"Allows to configure list of globs/directories/files to watch for file changes.\",\n      \"link\": \"https://webpack.js.org/configuration/dev-server/#devserverwatchfiles\"\n    },\n    \"WatchFilesObject\": {\n      \"cli\": {\n        \"exclude\": true\n      },\n      \"type\": \"object\",\n      \"properties\": {\n        \"paths\": {\n          \"anyOf\": [\n            {\n              \"type\": \"array\",\n              \"items\": {\n                \"type\": \"string\",\n                \"minLength\": 1\n              }\n            },\n            {\n              \"type\": \"string\",\n              \"minLength\": 1\n            }\n          ],\n          \"description\": \"Path(s) of globs/directories/files to watch for file changes.\"\n        },\n        \"options\": {\n          \"type\": \"object\",\n          \"description\": \"Configure advanced options for watching. See the chokidar documentation for the possible options.\",\n          \"link\": \"https://github.com/paulmillr/chokidar#api\",\n          \"additionalProperties\": true\n        }\n      },\n      \"additionalProperties\": false\n    },\n    \"WatchFilesString\": {\n      \"type\": \"string\",\n      \"minLength\": 1\n    },\n    \"WebSocketServer\": {\n      \"anyOf\": [\n        {\n          \"$ref\": \"#/definitions/WebSocketServerEnum\"\n        },\n        {\n          \"$ref\": \"#/definitions/WebSocketServerString\"\n        },\n        {\n          \"$ref\": \"#/definitions/WebSocketServerFunction\"\n        },\n        {\n          \"$ref\": \"#/definitions/WebSocketServerObject\"\n        }\n      ],\n      \"description\": \"Allows to set web socket server and options (by default 'ws').\",\n      \"link\": \"https://webpack.js.org/configuration/dev-server/#devserverwebsocketserver\"\n    },\n    \"WebSocketServerType\": {\n      \"enum\": [\"sockjs\", \"ws\"]\n    },\n    \"WebSocketServerEnum\": {\n      \"anyOf\": [\n        {\n          \"enum\": [false],\n          \"cli\": {\n            \"negatedDescription\": \"Disallows to set web socket server and options.\"\n          }\n        },\n        {\n          \"enum\": [\"sockjs\", \"ws\"],\n          \"cli\": {\n            \"exclude\": true\n          }\n        }\n      ]\n    },\n    \"WebSocketServerFunction\": {\n      \"instanceof\": \"Function\"\n    },\n    \"WebSocketServerObject\": {\n      \"type\": \"object\",\n      \"properties\": {\n        \"type\": {\n          \"anyOf\": [\n            {\n              \"$ref\": \"#/definitions/WebSocketServerType\"\n            },\n            {\n              \"$ref\": \"#/definitions/WebSocketServerString\"\n            },\n            {\n              \"$ref\": \"#/definitions/WebSocketServerFunction\"\n            }\n          ]\n        },\n        \"options\": {\n          \"type\": \"object\",\n          \"additionalProperties\": true,\n          \"cli\": {\n            \"exclude\": true\n          }\n        }\n      },\n      \"additionalProperties\": false\n    },\n    \"WebSocketServerString\": {\n      \"type\": \"string\",\n      \"minLength\": 1,\n      \"cli\": {\n        \"exclude\": true\n      }\n    }\n  },\n  \"additionalProperties\": false,\n  \"properties\": {\n    \"allowedHosts\": {\n      \"$ref\": \"#/definitions/AllowedHosts\"\n    },\n    \"bonjour\": {\n      \"$ref\": \"#/definitions/Bonjour\"\n    },\n    \"client\": {\n      \"$ref\": \"#/definitions/Client\"\n    },\n    \"compress\": {\n      \"$ref\": \"#/definitions/Compress\"\n    },\n    \"devMiddleware\": {\n      \"$ref\": \"#/definitions/DevMiddleware\"\n    },\n    \"headers\": {\n      \"$ref\": \"#/definitions/Headers\"\n    },\n    \"historyApiFallback\": {\n      \"$ref\": \"#/definitions/HistoryApiFallback\"\n    },\n    \"host\": {\n      \"$ref\": \"#/definitions/Host\"\n    },\n    \"hot\": {\n      \"$ref\": \"#/definitions/Hot\"\n    },\n    \"ipc\": {\n      \"$ref\": \"#/definitions/IPC\"\n    },\n    \"liveReload\": {\n      \"$ref\": \"#/definitions/LiveReload\"\n    },\n    \"onListening\": {\n      \"$ref\": \"#/definitions/OnListening\"\n    },\n    \"open\": {\n      \"$ref\": \"#/definitions/Open\"\n    },\n    \"port\": {\n      \"$ref\": \"#/definitions/Port\"\n    },\n    \"proxy\": {\n      \"$ref\": \"#/definitions/Proxy\"\n    },\n    \"server\": {\n      \"$ref\": \"#/definitions/Server\"\n    },\n    \"app\": {\n      \"$ref\": \"#/definitions/App\"\n    },\n    \"setupExitSignals\": {\n      \"$ref\": \"#/definitions/SetupExitSignals\"\n    },\n    \"setupMiddlewares\": {\n      \"$ref\": \"#/definitions/SetupMiddlewares\"\n    },\n    \"static\": {\n      \"$ref\": \"#/definitions/Static\"\n    },\n    \"watchFiles\": {\n      \"$ref\": \"#/definitions/WatchFiles\"\n    },\n    \"webSocketServer\": {\n      \"$ref\": \"#/definitions/WebSocketServer\"\n    }\n  }\n}\n"
  },
  {
    "path": "lib/servers/BaseServer.js",
    "content": "\"use strict\";\n\n/** @typedef {import(\"../Server\").ClientConnection} ClientConnection */\n\n// base class that users should extend if they are making their own\n// server implementation\nmodule.exports = class BaseServer {\n  /**\n   * @param {import(\"../Server\")} server server\n   */\n  constructor(server) {\n    /** @type {import(\"../Server\")} */\n    this.server = server;\n\n    /** @type {ClientConnection[]} */\n    this.clients = [];\n  }\n};\n"
  },
  {
    "path": "lib/servers/SockJSServer.js",
    "content": "\"use strict\";\n\nconst sockjs = require(\"sockjs\");\nconst BaseServer = require(\"./BaseServer\");\n\n/** @typedef {import(\"../Server\").WebSocketServerConfiguration} WebSocketServerConfiguration */\n/** @typedef {import(\"../Server\").ClientConnection} ClientConnection */\n\n// Workaround for sockjs@~0.3.19\n// sockjs will remove Origin header, however Origin header is required for checking host.\n// See https://github.com/webpack/webpack-dev-server/issues/1604 for more information\n{\n  // @ts-expect-error\n  const SockjsSession = require(\"sockjs/lib/transport\").Session;\n\n  const { decorateConnection } = SockjsSession.prototype;\n\n  /**\n   * @param {import(\"http\").IncomingMessage} req request\n   */\n  // eslint-disable-next-line func-names\n  SockjsSession.prototype.decorateConnection = function (req) {\n    decorateConnection.call(this, req);\n\n    const { connection } = this;\n\n    if (\n      connection.headers &&\n      !(\"origin\" in connection.headers) &&\n      \"origin\" in req.headers\n    ) {\n      connection.headers.origin = req.headers.origin;\n    }\n  };\n}\n\nmodule.exports = class SockJSServer extends BaseServer {\n  // options has: error (function), debug (function), server (http/s server), path (string)\n  /**\n   * @param {import(\"../Server\")} server server\n   */\n  constructor(server) {\n    super(server);\n\n    const webSocketServerOptions =\n      /** @type {NonNullable<WebSocketServerConfiguration[\"options\"]>} */\n      (\n        /** @type {WebSocketServerConfiguration} */\n        (this.server.options.webSocketServer).options\n      );\n\n    /**\n     * @param {NonNullable<WebSocketServerConfiguration[\"options\"]>} options options\n     * @returns {string} sockjs URL\n     */\n    const getSockjsUrl = (options) => {\n      if (typeof options.sockjsUrl !== \"undefined\") {\n        return options.sockjsUrl;\n      }\n\n      return \"/__webpack_dev_server__/sockjs.bundle.js\";\n    };\n\n    this.implementation = sockjs.createServer({\n      // Use provided up-to-date sockjs-client\n      // eslint-disable-next-line camelcase\n      sockjs_url: getSockjsUrl(webSocketServerOptions),\n      // Default logger is very annoy. Limit useless logs.\n      /**\n       * @param {string} severity severity\n       * @param {string} line line\n       */\n      log: (severity, line) => {\n        if (severity === \"error\") {\n          this.server.logger.error(line);\n        } else if (severity === \"info\") {\n          this.server.logger.log(line);\n        } else {\n          this.server.logger.debug(line);\n        }\n      },\n    });\n\n    /**\n     * @param {import(\"sockjs\").ServerOptions & { path?: string }} options options\n     * @returns {string | undefined} prefix\n     */\n    const getPrefix = (options) => {\n      if (typeof options.prefix !== \"undefined\") {\n        return options.prefix;\n      }\n\n      return options.path;\n    };\n\n    const options = {\n      ...webSocketServerOptions,\n      prefix: getPrefix(webSocketServerOptions),\n    };\n\n    this.implementation.installHandlers(\n      /** @type {import(\"http\").Server} */ (this.server.server),\n      options,\n    );\n\n    this.implementation.on(\"connection\", (client) => {\n      // @ts-expect-error\n      // Implement the the same API as for `ws`\n      client.send = client.write;\n      // @ts-expect-error\n      client.terminate = client.close;\n\n      this.clients.push(/** @type {ClientConnection} */ (client));\n\n      client.on(\"close\", () => {\n        this.clients.splice(\n          this.clients.indexOf(/** @type {ClientConnection} */ (client)),\n          1,\n        );\n      });\n    });\n\n    // @ts-expect-error\n    this.implementation.close = (callback) => {\n      callback();\n    };\n  }\n};\n"
  },
  {
    "path": "lib/servers/WebsocketServer.js",
    "content": "\"use strict\";\n\nconst WebSocket = require(\"ws\");\nconst BaseServer = require(\"./BaseServer\");\n\n/** @typedef {import(\"../Server\").WebSocketServerConfiguration} WebSocketServerConfiguration */\n/** @typedef {import(\"../Server\").ClientConnection} ClientConnection */\n\nmodule.exports = class WebsocketServer extends BaseServer {\n  static heartbeatInterval = 1000;\n\n  /**\n   * @param {import(\"../Server\")} server server\n   */\n  constructor(server) {\n    super(server);\n\n    /** @type {import(\"ws\").ServerOptions} */\n    const options = {\n      .../** @type {WebSocketServerConfiguration} */\n      (this.server.options.webSocketServer).options,\n      clientTracking: false,\n    };\n    const isNoServerMode =\n      typeof options.port === \"undefined\" &&\n      typeof options.server === \"undefined\";\n\n    if (isNoServerMode) {\n      options.noServer = true;\n    }\n\n    this.implementation = new WebSocket.Server(options);\n\n    /** @type {import(\"http\").Server} */\n    (this.server.server).on(\n      \"upgrade\",\n      /**\n       * @param {import(\"http\").IncomingMessage} req request\n       * @param {import(\"stream\").Duplex} sock socket\n       * @param {Buffer} head head\n       */\n      (req, sock, head) => {\n        if (!this.implementation.shouldHandle(req)) {\n          return;\n        }\n\n        this.implementation.handleUpgrade(req, sock, head, (connection) => {\n          this.implementation.emit(\"connection\", connection, req);\n        });\n      },\n    );\n\n    this.implementation.on(\n      \"error\",\n      /**\n       * @param {Error} err error\n       */\n      (err) => {\n        this.server.logger.error(err.message);\n      },\n    );\n\n    const interval = setInterval(() => {\n      for (const client of this.clients) {\n        if (client.isAlive === false) {\n          client.terminate();\n\n          continue;\n        }\n\n        client.isAlive = false;\n        client.ping(() => {});\n      }\n    }, WebsocketServer.heartbeatInterval);\n\n    this.implementation.on(\n      \"connection\",\n      /**\n       * @param {ClientConnection} client client\n       */\n      (client) => {\n        this.clients.push(client);\n\n        client.isAlive = true;\n\n        client.on(\"pong\", () => {\n          client.isAlive = true;\n        });\n\n        client.on(\"close\", () => {\n          this.clients.splice(this.clients.indexOf(client), 1);\n        });\n\n        // TODO: add a test case for this - https://github.com/webpack/webpack-dev-server/issues/5018\n        client.on(\n          \"error\",\n          /**\n           * @param {Error} err err\n           */\n          (err) => {\n            this.server.logger.error(err.message);\n          },\n        );\n      },\n    );\n\n    this.implementation.on(\"close\", () => {\n      clearInterval(interval);\n    });\n  }\n};\n"
  },
  {
    "path": "lint-staged.config.js",
    "content": "\"use strict\";\n\nmodule.exports = {\n  \"*\": [\n    \"prettier --cache --write --ignore-unknown\",\n    \"cspell --cache --no-must-find-files\",\n  ],\n  \"*.js\": [\"eslint --cache --fix\"],\n};\n"
  },
  {
    "path": "migration-v4.md",
    "content": "# Migration guide\n\nThis document serves as a migration guide for `webpack-dev-server@4.0.0`.\n\n### Before updating\n\n- `webpack-dev-server` v3 and `webpack-dev-server` v4 automatically apply `HotModuleReplacementPlugin` plugin when you set `hot: true`, so please check you don't have `HotModuleReplacementPlugin` in your `plugins` if you have `hot: true`/`hot: \"only\"`\n- `webpack-dev-server` v3 and `webpack-dev-server` v4 automatically inject `webpack/hot/dev-server` in your `entry` option when you set `hot: true` (except when you use `injectHot` for webpack-dev-server v3), please check you don't have `webpack/hot/dev-server` in your `entry` option\n- `webpack-dev-server` v3 and `webpack-dev-server` v4 automatically inject `webpack-dev-server/client/index.js` in your `entry` option (except when you use `injectClient` for webpack-dev-server v3), please check you don't have `webpack-dev-server/client/index.js` in your `entry` option\n\n### ⚠ BREAKING CHANGES\n\n- Minimum supported `Node.js` version is `12.13.0`.\n- Minimum supported `webpack` version is `4.37.0` (**but we recommend using `webpack >= v5.0.0`**).\n- Minimum compatible `webpack-cli` version is `4.7.0`.\n- The `hotOnly` option was removed, if you need hot only mode, use `{ hot: 'only' }` value.\n\nv3:\n\n```js\nmodule.exports = {\n  devServer: {\n    hotOnly: true,\n  },\n};\n```\n\nv4:\n\n```js\nmodule.exports = {\n  devServer: {\n    hot: \"only\",\n  },\n};\n```\n\n- Default web socket server is [`ws`](https://github.com/websockets/ws) (IE9 does not support web socket, please use `{ webSocketServer: 'sockjs' }`).\n- The `setup` option was removed without replacement.\n- The `before` option was renamed to `onBeforeSetupMiddleware` and changed arguments.\n\nv3:\n\n```js\nmodule.exports = {\n  devServer: {\n    before(app, server, compiler) {\n      app.get(\"/some/path\", (req, res) => {\n        res.json({ custom: \"response\" });\n      });\n    },\n  },\n};\n```\n\nv4:\n\n```js\nmodule.exports = {\n  devServer: {\n    onBeforeSetupMiddleware(devServer) {\n      devServer.app.get(\"/some/path\", (req, res) => {\n        res.json({ custom: \"response\" });\n      });\n    },\n  },\n};\n```\n\n- The `after` option was renamed to `onAfterSetupMiddleware` and changed arguments.\n\nv3:\n\n```js\nmodule.exports = {\n  devServer: {\n    after(app, server, compiler) {\n      app.get(\"/some/path\", (req, res) => {\n        res.json({ custom: \"response\" });\n      });\n    },\n  },\n};\n```\n\nv4:\n\n```js\nmodule.exports = {\n  devServer: {\n    onAfterSetupMiddleware(devServer) {\n      devServer.app.get(\"/some/path\", (req, res) => {\n        res.json({ custom: \"response\" });\n      });\n    },\n  },\n};\n```\n\n- The `features` option was removed in favor `onBeforeSetupMiddleware` and `onAfterSetupMiddleware` options.\n- The `key`, `cert`, `pfx`, `pfx-passphrase`, `cacert`, `ca` and `requestCert` options were moved to `https` options, please use `https.{key|cert|pfx|passphrase|requestCert|ca}`.\n\nv3:\n\n```js\nmodule.exports = {\n  devServer: {\n    ca: \"./server.pem\",\n    pfx: \"./server.pfx\",\n    key: \"./server.key\",\n    cert: \"./server.crt\",\n    pfxPassphrase: \"webpack-dev-server\",\n    requestCert: true,\n  },\n};\n```\n\nv4:\n\n```js\nmodule.exports = {\n  devServer: {\n    https: {\n      ca: \"./server.pem\",\n      pfx: \"./server.pfx\",\n      key: \"./server.key\",\n      cert: \"./server.crt\",\n      passphrase: \"webpack-dev-server\",\n      requestCert: true,\n    },\n  },\n};\n```\n\n- The `compress` option is now `true` by default.\n- `filename` and `lazy` options were removed in favor [experiments.lazyCompilation](https://webpack.js.org/configuration/experiments/#experimentslazycompilation).\n- The `inline` (`iframe` live mode) option was removed without replacement.\n- `log`, `logLevel`, `logTime`, `quiet`, `noInfo`, and `reporter` options were removed without replacement, [now we use built-in logger](https://webpack.js.org/configuration/other-options/#infrastructurelogging).\n- The `useLocalIp` option was removed in favor of `host: 'local-ip'/'local-ipv4'/'local-ipv6'`.\n\nv3:\n\n```js\nmodule.exports = {\n  devServer: {\n    useLocalIp: true,\n  },\n};\n```\n\nv4:\n\n```js\nmodule.exports = {\n  devServer: {\n    host: \"local-ip\",\n  },\n};\n```\n\n- `host`/`port` options can't be `null` or empty string, please use `host: 'local-ip'` or `port: 'auto'`.\n- the `warn` option was removed in favor of [ignoreWarnings](https://webpack.js.org/configuration/other-options/#ignorewarnings)\n- `fs`, `index`, `mimeTypes`, `publicPath`, `serverSideRender`, `stats`, and `writeToDisk` (related to [`webpack-dev-middleware`](https://github.com/webpack/webpack-dev-middleware)) were moved to `devMiddleware` option.\n\nv3:\n\n```js\nmodule.exports = {\n  devServer: {\n    index: true,\n    mimeTypes: { \"text/html\": [\"phtml\"] },\n    publicPath: \"/publicPathForDevServe\",\n    serverSideRender: true,\n    writeToDisk: true,\n  },\n};\n```\n\nv4:\n\n```js\nmodule.exports = {\n  devServer: {\n    devMiddleware: {\n      index: true,\n      mimeTypes: { \"text/html\": [\"phtml\"] },\n      publicPath: \"/publicPathForDevServe\",\n      serverSideRender: true,\n      writeToDisk: true,\n    },\n  },\n};\n```\n\n- `progress`/`overlay`/`clientLogLevel` option were moved to the `client` option:\n\nv3:\n\n```js\nmodule.exports = {\n  devServer: {\n    clientLogLevel: \"info\",\n    overlay: true,\n    progress: true,\n  },\n};\n```\n\nv4:\n\n```js\nmodule.exports = {\n  devServer: {\n    client: {\n      logging: \"info\",\n      // Can be used only for `errors`/`warnings`\n      //\n      // overlay: {\n      //   errors: true,\n      //   warnings: true,\n      // }\n      overlay: true,\n      progress: true,\n    },\n  },\n};\n```\n\n- `public`, `sockHost`, `sockPath`, and `sockPort` options were removed in favor `client.webSocketURL` option:\n\nv3:\n\n```js\nmodule.exports = {\n  devServer: {\n    public: \"ws://localhost:8080\",\n  },\n};\n```\n\n```js\nmodule.exports = {\n  devServer: {\n    sockHost: \"0.0.0.0\",\n    sockPath: \"/ws\",\n    sockPort: 8080,\n  },\n};\n```\n\nv4:\n\n```js\nmodule.exports = {\n  devServer: {\n    client: {\n      // Can be `string`:\n      //\n      // To get protocol/hostname/port from browser\n      // webSocketURL: 'auto://0.0.0.0:0/ws'\n      webSocketURL: {\n        hostname: \"0.0.0.0\",\n        pathname: \"/ws\",\n        port: 8080,\n      },\n    },\n  },\n};\n```\n\nIf you need to set custom `path` to dev server web socket server, please use:\n\n```js\nmodule.exports = {\n  devServer: {\n    webSocketServer: {\n      options: {\n        path: \"/my/custom/path/to/web/socket/server\",\n      },\n    },\n  },\n};\n```\n\n- `client.overlay` (previously the `overlay` option ) is now `true` by default.\n- `contentBase`/`contentBasePublicPath`/`serveIndex`/`watchContentBase`/`watchOptions`/`staticOptions` options were moved to `static` option:\n\nv3:\n\n```js\nmodule.exports = {\n  devServer: {\n    contentBase: path.join(__dirname, \"public\"),\n    contentBasePublicPath: \"/serve-content-base-at-this-url\",\n    serveIndex: true,\n    watchContentBase: true,\n    watchOptions: {\n      poll: true,\n    },\n  },\n};\n```\n\nv4:\n\n```js\nmodule.exports = {\n  devServer: {\n    static: {\n      directory: path.resolve(__dirname, \"static\"),\n      staticOptions: {},\n      // Don't be confused with `devMiddleware.publicPath`, it is `publicPath` for static directory\n      // Can be:\n      // publicPath: ['/static-public-path-one/', '/static-public-path-two/'],\n      publicPath: \"/static-public-path/\",\n      // Can be:\n      // serveIndex: {} (options for the `serveIndex` option you can find https://github.com/expressjs/serve-index)\n      serveIndex: true,\n      // Can be:\n      // watch: {} (options for the `watch` option you can find https://github.com/paulmillr/chokidar)\n      watch: true,\n    },\n  },\n};\n```\n\nProvide an array of objects in case you have multiple static folders:\n\n```js\nmodule.exports = {\n  // ...\n  devServer: {\n    static: [\n      {\n        directory: path.join(__dirname, \"assets\"),\n        publicPath: \"/serve-public-path-url\",\n      },\n      {\n        directory: path.join(__dirname, \"css\"),\n        publicPath: \"/other-serve-public-path-url\",\n      },\n    ],\n  },\n};\n```\n\n- Default value of the `static` option is `path.resolve(process.cwd(), 'public')` directory and enabled by default.\n- `static.watch` is enabled by default.\n- The `socket` option was renamed to `ipc` (also supports `string` type, i.e. path to unix socket):\n\nv3:\n\n```js\nmodule.exports = {\n  devServer: {\n    socket: true,\n  },\n};\n```\n\nv4:\n\n```js\nmodule.exports = {\n  devServer: {\n    ipc: true,\n  },\n};\n```\n\n- The `disableHostCheck` option was removed in favor `allowedHosts: 'all'`:\n\nv3:\n\n```js\nmodule.exports = {\n  devServer: {\n    disableHostCheck: true,\n  },\n};\n```\n\nv4:\n\n```js\nmodule.exports = {\n  devServer: {\n    allowedHosts: \"all\",\n  },\n};\n```\n\n- `open` and `openPage` options were unionized in favor of the `open` option:\n\nv3:\n\n```js\nmodule.exports = {\n  devServer: {\n    // openPage: '/my-page',\n    openPage: true,\n  },\n};\n```\n\nv4:\n\n```js\nmodule.exports = {\n  devServer: {\n    // open: ['/my-page'],\n    open: true,\n  },\n};\n```\n\n```js\nmodule.exports = {\n  devServer: {\n    open: {\n      target: [\"first.html\", \"http://localhost:8080/second.html\"],\n      app: {\n        name: \"google-chrome\",\n        arguments: [\"--incognito\", \"--new-window\"],\n      },\n    },\n  },\n};\n```\n\n- `transportMode` (i.e. `transportMode.client`/`transportMode.server` options) were removed in favor of `client.webSocketTransport` and `webSocketServer`:\n\nv3:\n\n```js\nmodule.exports = {\n  transportMode: \"ws\",\n};\n```\n\n```js\nmodule.exports = {\n  transportMode: {\n    client: require.resolve(\"./CustomClient\"),\n    server: require.resolve(\"./CustomServer\"),\n  },\n};\n```\n\nv4:\n\n```js\nmodule.exports = {\n  devServer: {\n    // webSocketServer: 'sockjs',\n    webSocketServer: \"ws\",\n  },\n};\n```\n\n```js\nmodule.exports = {\n  devServer: {\n    client: {\n      webSocketTransport: require.resolve(\"./CustomClient\"),\n    },\n    webSocketServer: require.resolve(\"./CustomServer\"),\n  },\n};\n```\n\n- (`webpack-dev-middleware`)[https://github.com/webpack/webpack-dev-middleware] was update to v5.\n- All options can be set via CLI, don't forget if you need to override option from configuration(s) you should use `reset` flag, i.e. `--static-reset --static my-directory`\n- Many CLI options were renamed in favor of the above change, please use `webpack serve --help` to get a list of them.\n- The `stdin` option was removed in favor of `--watch-options-stdin`.\n- `injectClient` and `injectHot` were removed in favor of manual setup entries.\n- `injectClient: false` was replaced with `client: false`:\n\n  v3:\n\n  ```js\n  module.exports = {\n    devServer: {\n      injectClient: false,\n    },\n  };\n  ```\n\n  v4:\n\n  ```js\n  module.exports = {\n    devServer: {\n      client: false,\n    },\n  };\n  ```\n\n  - `injectHot: false` is now assumed when `hot: false` is used:\n\n  v3:\n\n  ```js\n  module.exports = {\n    devServer: {\n      injectHot: false,\n    },\n  };\n  ```\n\n  v4:\n\n  ```js\n  module.exports = {\n    devServer: {\n      hot: false,\n    },\n  };\n  ```\n\n- The `sockWrite` public method was renamed to `sendMessage`.\n- The `profile` option was removed in favor [`ProfilingPlugin`](https://webpack.js.org/plugins/profiling-plugin/).\n- The `addDevServerEntrypoints` method was removed in favor of manual configuration.\n\n  v4:\n\n  ```js\n  const webpack = require(\"webpack\");\n  const DevServer = require(\"webpack-dev-server\");\n\n  const config = {\n    entry: [\n      // Runtime code for hot module replacement\n      \"webpack/hot/dev-server.js\",\n      // Dev server client for web socket transport, hot and live reload logic\n      \"webpack-dev-server/client/index.js?hot=true&live-reload=true\",\n      // Your entry\n      \"./src/entry.js\",\n    ],\n    plugin: [\n      // Plugin for hot module replacement\n      new webpack.HotModuleReplacementPlugin(),\n    ],\n  };\n  const compiler = webpack(config);\n  // `hot` and `client` options are disabled because we added them manually\n  const server = new DevServer({ hot: false, client: false }, compiler);\n\n  await server.start();\n\n  console.log(\"Running\");\n  ```\n\n### Deprecations\n\n- `constructor` arguments were changed, the first argument is dev server options, the second is compiler\n\n  v3:\n\n  ```js\n  const devServerOptions = { host: \"127.0.0.1\", port: 8080 };\n  const devServer = new Server(compiler, devServerOptions);\n  ```\n\n  v4:\n\n  ```js\n  const devServerOptions = { host: \"127.0.0.1\", port: 8080 };\n  const devServer = new Server(devServerOptions, compiler);\n  ```\n\n- `listen` method is deprecated in favor async `start` or `startCallback` methods\n\n  v3:\n\n  ```js\n  const devServerOptions = { host: \"127.0.0.1\", port: 8080 };\n  const devServer = new Server(compiler, devServerOptions);\n\n  devServer.listen(devServerOptions.host, devServerOptions.port, () => {\n    console.log(\"Running\");\n  });\n  ```\n\n  v4:\n\n  ```js\n  const devServerOptions = { host: \"127.0.0.1\", port: 8080 };\n  const devServer = new Server(devServerOptions, compiler);\n\n  await devServer.start();\n\n  console.log(\"Running\");\n  ```\n\n  ```js\n  const devServerOptions = { host: \"127.0.0.1\", port: 8080 };\n  const devServer = new Server(devServerOptions, compiler);\n\n  devServer.startCallback(() => {\n    console.log(\"Running\");\n  });\n  ```\n\n- `close` method is deprecated in favor async `stop` or `stopCallback` methods\n\n  v3:\n\n  ```js\n  const devServerOptions = { host: \"127.0.0.1\", port: 8080 };\n  const devServer = new Server(compiler, devServerOptions);\n\n  devServer.listen(devServerOptions.host, devServerOptions.port, () => {\n    console.log(\"Running\");\n\n    devServer.close(() => {\n      console.log(\"Closed\");\n    });\n  });\n  ```\n\n  v4:\n\n  ```js\n  const devServerOptions = { host: \"127.0.0.1\", port: 8080 };\n  const devServer = new Server(devServerOptions, compiler);\n\n  await devServer.start();\n\n  console.log(\"Running\");\n\n  await devServer.stop();\n\n  console.log(\"Closed\");\n  ```\n\n  ```js\n  const devServerOptions = { host: \"127.0.0.1\", port: 8080 };\n  const devServer = new Server(devServerOptions, compiler);\n\n  devServer.startCallback(() => {\n    console.log(\"Running\");\n\n    devServer.stopCallback(() => {\n      console.log(\"Closed\");\n    });\n  });\n  ```\n\n### Features\n\n- Added the `setupExitSignals` option, it takes a boolean and if `true` (default on CLI), the server will close and exit the process on `SIGINT` and `SIGTERM`.\n- Print a warning if the `host`/`port` option and the `host`/`port` argument passed to `server.listen()` are different.\n- Allowed to disable web socket server using `webSocketServer: false`.\n- Added the `watchFiles` option, now you can reload server on file changes, for example `{ watchFiles: [\"src/**/*.php\", \"public/**/*\"] }`.\n- You can specify multiple targets and browsers for the open option, i.e. `{ open: { target: ['/my-page', '/my-other-page'], app: ['google-chrome', '--incognito'] } }`, also you can use `{ open: { target: '<url>', app: ['google-chrome', '--incognito'] } }` to open default URL in multiple browsers.\n- Support [`bonjour`](https://www.npmjs.com/package/bonjour#publishing) options.\n- The `headers` option can be `Function` type.\n- Overlay can be closed in browser.\n- The `allowedHosts` option can be `auto` or custom string with your domain (i.e. default value).\n- The `static` option can be disabled using `static: false`.\n- Added async `start` and `stop` methods to API\n- Added `startCallback` and `stopCallback` methods to API\n- Migrate on built-in `webpack` logger.\n\n### Bug Fixes\n\n- Compatibility with the `target` option (you can use `target: ['web', 'es5']`).\n- `publicPath: auto` is now working out of box.\n- No problems with the `target` option anymore, you can remove workaround (i.e. `target: 'web'` for webpack v5).\n- Fix `webpack-dev-server` binary, i.e. `webpack server` and `webpack-dev-server` will work identically.\n- Empty and multiple entries support.\n- IPv6 supported.\n- `chokidar` was updated.\n- Respect the `client.logging` option for HMR logging.\n- Show plugin name in progress log.\n- Use value of the `infrastructureLogging.level` option by default for `client.logging`.\n- Allow to pass options without the `target` option for the `proxy` options.\n- Support lazy compilation.\n\nThere are a lot of other bug fixes.\n\n### Notes\n\n- Compatibility with `IE11`/`IE10`/`IE9`:\n  - For `IE11`/`IE10` you need polyfill `fetch()` and `Promise`, example:\n\n  ```js\n  module.exports = {\n    entry: {\n      entry: [\"whatwg-fetch\", \"core-js/features/promise\", \"./entry.js\"],\n    },\n  };\n  ```\n\n  - For `IE9` you need polyfill `fetch()` and `Promise` and use `sockjs` for communications (because `WebSocket` is not supported), example:\n\n  ```js\n  module.exports = {\n    entry: {\n      entry: [\"whatwg-fetch\", \"core-js/features/promise\", \"./entry.js\"],\n    },\n    devServer: {\n      webSocketServer: \"sockjs\",\n    },\n  };\n  ```\n\n  IE8 is not supported, sorry\n\n- Change in **Node.js API**:\n  - If you're using dev-server through the Node.js API, the options in devServer will be ignored. Pass the options as a first parameter instead:\n\n  v3:\n\n  ```js\n  new WebpackDevServer(compiler, {\n    /* Options */\n  });\n  ```\n\n  v4:\n\n  ```js\n  new WebpackDevServer(\n    {\n      /* Options */\n    },\n    compiler,\n  );\n  ```\n\n  - [See here](https://github.com/webpack/webpack-dev-server/tree/main/examples/api/simple) for an example of how to use `webpack-dev-server` through the Node.js API.\n"
  },
  {
    "path": "migration-v5.md",
    "content": "# Migration guide\n\nThis document serves as a migration guide for `webpack-dev-server@5.0.0`.\n\n## ⚠ BREAKING CHANGES\n\n- Minimum supported `Node.js` version is `18.12.0`.\n- Minimum supported `webpack` version is `5.0.0`.\n- Minimum compatible `webpack-cli` version is `5.0.0` but we recommend using the latest version.\n- The `http2` and `https` options were removed in favor of [the `server` option](https://webpack.js.org/configuration/dev-server/#devserverserver).\n\n  v4:\n\n  ```js\n  module.exports = {\n    devServer: {\n      http2: true,\n      https: {\n        ca: \"./path/to/server.pem\",\n        pfx: \"./path/to/server.pfx\",\n        key: \"./path/to/server.key\",\n        cert: \"./path/to/server.crt\",\n        passphrase: \"webpack-dev-server\",\n        requestCert: true,\n      },\n    },\n  };\n  ```\n\n  v5:\n\n  ```js\n  module.exports = {\n    // ...\n    devServer: {\n      server: {\n        type: \"spdy\", // or use 'https'\n        options: {\n          ca: \"./path/to/server.pem\",\n          pfx: \"./path/to/server.pfx\",\n          key: \"./path/to/server.key\",\n          cert: \"./path/to/server.crt\",\n          passphrase: \"webpack-dev-server\",\n          requestCert: true,\n        },\n      },\n    },\n  };\n  ```\n\n- The `server.options.cacert` option was removed in favor of the `server.options.ca` option.\n\n  v4:\n\n  ```js\n  module.exports = {\n    // ...\n    devServer: {\n      server: {\n        type: \"https\", // or use 'https'\n        options: {\n          cacert: \"./path/to/server.pem\",\n        },\n      },\n    },\n  };\n  ```\n\n  v5:\n\n  ```js\n  module.exports = {\n    // ...\n    devServer: {\n      server: {\n        type: \"https\",\n        options: {\n          ca: \"./path/to/server.pem\",\n        },\n      },\n    },\n  };\n  ```\n\n- The `onAfterSetupMiddleware` and `onBeforeSetupMiddleware` options were removed in favor of [the `setupMiddlewares` option](https://webpack.js.org/configuration/dev-server/#devserversetupmiddlewares).\n\n  v4:\n\n  ```js\n  module.exports = {\n    // ...\n    devServer: {\n      onAfterSetupMiddleware(devServer) {\n        if (!devServer) {\n          throw new Error(\"webpack-dev-server is not defined\");\n        }\n\n        devServer.app.get(\"/some/after-path\", (req, res) => {\n          res.json({ custom: \"response\" });\n        });\n      },\n      onBeforeSetupMiddleware(devServer) {\n        if (!devServer) {\n          throw new Error(\"webpack-dev-server is not defined\");\n        }\n\n        devServer.app.get(\"/some/before-path\", (req, res) => {\n          res.json({ custom: \"response\" });\n        });\n      },\n    },\n  };\n  ```\n\n  v5:\n\n  ```js\n  module.exports = {\n    // ...\n    devServer: {\n      setupMiddlewares: (middlewares, devServer) => {\n        if (!devServer) {\n          throw new Error(\"webpack-dev-server is not defined\");\n        }\n\n        devServer.app.get(\"/setup-middleware/some/path\", (_, response) => {\n          response.send(\"setup-middlewares option GET\");\n        });\n\n        // Use the `unshift` method if you want to run a middleware before all other middlewares\n        // or when you are migrating from the `onBeforeSetupMiddleware` option\n        middlewares.unshift({\n          name: \"first-in-array\",\n          // `path` is optional\n          path: \"/some/before-path\",\n          middleware: (req, res) => {\n            res.send(\"Foo!\");\n          },\n        });\n\n        // Use the `push` method if you want to run a middleware after all other middlewares\n        // or when you are migrating from the `onAfterSetupMiddleware` option\n        middlewares.push({\n          name: \"hello-world-test-one\",\n          // `path` is optional\n          path: \"/some/after-bar\",\n          middleware: (req, res) => {\n            res.send(\"Foo Bar!\");\n          },\n        });\n\n        middlewares.push((req, res) => {\n          res.send(\"Hello World!\");\n        });\n\n        return middlewares;\n      },\n    },\n  };\n  ```\n\n- The `proxy` option's schema was updated to accept only an array.\n\nv4:\n\n```js\nmodule.exports = {\n  // ...\n  devServer: {\n    proxy: {\n      \"/api\": {\n        target: \"http://localhost:3000\",\n        changeOrigin: true,\n      },\n    },\n  },\n};\n```\n\nv5:\n\n```js\nmodule.exports = {\n  // ...\n  devServer: {\n    proxy: [\n      {\n        context: [\"/api\"],\n        target: \"http://localhost:3000\",\n        changeOrigin: true,\n      },\n    ],\n  },\n};\n```\n\n- The `--open-app` cli option was removed in favor of the `--open-app-name` option.\n- The `--web-socket-server` cli option was removed in favor of the `--web-socket-server-type` option.\n- The `magicHtml` option was removed without replacement.\n- The value of the `WEBPACK_SERVE` environment variable was changed from `true`(boolean) to `'true'` (string).\n- [`webpack-dev-middleware`](https://github.com/webpack/webpack-dev-middleware) was update to v7.\n- The `constructor` arguments were changed, now the first argument is dev server options, the second is compiler.\n\n  v4:\n\n  ```js\n  const devServerOptions = { host: \"127.0.0.1\", port: 8080 };\n  const devServer = new Server(compiler, devServerOptions);\n  ```\n\n  v5:\n\n  ```js\n  const devServerOptions = { host: \"127.0.0.1\", port: 8080 };\n  const devServer = new Server(devServerOptions, compiler);\n  ```\n\n- The `listen` method was removed in favor the [async `start`](https://webpack.js.org/api/webpack-dev-server/#start) or the [`startCallback`](https://webpack.js.org/api/webpack-dev-server/#startcallbackcallback) methods\n\n  v4:\n\n  ```js\n  const devServerOptions = { host: \"127.0.0.1\", port: 8080 };\n  const devServer = new Server(compiler, devServerOptions);\n\n  devServer.listen(devServerOptions.host, devServerOptions.port, () => {\n    console.log(\"Running\");\n  });\n  ```\n\n  v5:\n\n  ```js\n  const devServerOptions = { host: \"127.0.0.1\", port: 8080 };\n  const devServer = new Server(devServerOptions, compiler);\n\n  await devServer.start();\n\n  console.log(\"Running\");\n  ```\n\n  ```js\n  const devServerOptions = { host: \"127.0.0.1\", port: 8080 };\n  const devServer = new Server(devServerOptions, compiler);\n\n  devServer.startCallback(() => {\n    console.log(\"Running\");\n  });\n  ```\n\n- The `close` method was removed in favor the [async `stop`](https://webpack.js.org/api/webpack-dev-server/#stop) or the [`stopCallback`](https://webpack.js.org/api/webpack-dev-server/#stopcallbackcallback) methods.\n\n  v4:\n\n  ```js\n  const devServerOptions = { host: \"127.0.0.1\", port: 8080 };\n  const devServer = new Server(compiler, devServerOptions);\n\n  devServer.listen(devServerOptions.host, devServerOptions.port, () => {\n    console.log(\"Running\");\n\n    devServer.close(() => {\n      console.log(\"Closed\");\n    });\n  });\n  ```\n\n  v5:\n\n  ```js\n  const devServerOptions = { host: \"127.0.0.1\", port: 8080 };\n  const devServer = new Server(devServerOptions, compiler);\n\n  await devServer.start();\n\n  console.log(\"Running\");\n\n  await devServer.stop();\n\n  console.log(\"Closed\");\n  ```\n\n  ```js\n  const devServerOptions = { host: \"127.0.0.1\", port: 8080 };\n  const devServer = new Server(devServerOptions, compiler);\n\n  devServer.startCallback(() => {\n    console.log(\"Running\");\n\n    devServer.stopCallback(() => {\n      console.log(\"Closed\");\n    });\n  });\n  ```\n\n- The `content-changed` method was removed in favor of the `static-changed` method from `onSocketMessage`.\n\n  v4:\n\n  ```js\n  onSocketMessage[\"content-changed\"]();\n  ```\n\n  v5:\n\n  ```js\n  onSocketMessage[\"static-changed\"]();\n  ```\n\n### Bug Fixes\n\n- Clean `close` event listeners on socket server after generating new proxy config.\n- Improve error handling for WebsocketServer.\n- Set `WEBPACK_SERVE` to string value `'true'`.\n- Show warning using custom hostname and port with sockjs.\n\n## Deprecations\n\n- The `bypass` option is deprecated for proxy in favor of the `router` and the `context` options. [Read more here](https://github.com/chimurai/http-proxy-middleware/tree/v2.0.6#http-proxy-middleware-options).\n"
  },
  {
    "path": "package.json",
    "content": "{\n  \"name\": \"webpack-dev-server\",\n  \"version\": \"5.2.3\",\n  \"description\": \"Serves a webpack app. Updates the browser on changes.\",\n  \"homepage\": \"https://github.com/webpack/webpack-dev-server#readme\",\n  \"bugs\": \"https://github.com/webpack/webpack-dev-server/issues\",\n  \"repository\": \"https://github.com/webpack/webpack-dev-server\",\n  \"funding\": {\n    \"type\": \"opencollective\",\n    \"url\": \"https://opencollective.com/webpack\"\n  },\n  \"license\": \"MIT\",\n  \"author\": \"Tobias Koppers @sokra\",\n  \"main\": \"lib/Server.js\",\n  \"types\": \"types/lib/Server.d.ts\",\n  \"bin\": \"bin/webpack-dev-server.js\",\n  \"files\": [\n    \"bin\",\n    \"lib\",\n    \"client\",\n    \"types\"\n  ],\n  \"scripts\": {\n    \"fmt:check\": \"prettier \\\"{**/*,*}.{js,json,md,yml,css,ts}\\\" --list-different\",\n    \"lint:prettier\": \"prettier --cache --list-different .\",\n    \"lint:code\": \"eslint --cache .\",\n    \"lint:types\": \"tsc --pretty --noEmit\",\n    \"lint:types-client\": \"tsc -p tsconfig.client.json\",\n    \"lint:spelling\": \"cspell --cache --no-must-find-files --quiet \\\"**/*.*\\\"\",\n    \"lint\": \"npm-run-all -l -p \\\"lint:**\\\"\",\n    \"fix:code\": \"npm run lint:code -- --fix\",\n    \"fix:prettier\": \"npm run lint:prettier -- --write\",\n    \"fix\": \"npm-run-all -l fix:code fix:prettier\",\n    \"commitlint\": \"commitlint --from=main\",\n    \"build:client\": \"rimraf -g ./client/* && babel client-src/ --out-dir client/ --ignore \\\"client-src/webpack.config.js\\\" --ignore \\\"client-src/modules\\\" && webpack --config client-src/webpack.config.js\",\n    \"build:types\": \"rimraf -g ./types/* && tsc --declaration --emitDeclarationOnly --outDir types && node ./scripts/extend-webpack-types.js && prettier \\\"types/**/*.ts\\\" --write && prettier \\\"types/**/*.ts\\\" --write\",\n    \"build\": \"npm-run-all -p \\\"build:**\\\"\",\n    \"test:only\": \"node --experimental-vm-modules node_modules/jest/bin/jest.js\",\n    \"test:coverage\": \"npm run test:only -- --coverage\",\n    \"test:watch\": \"npm run test:coverage --watch\",\n    \"test\": \"npm run test:coverage\",\n    \"pretest\": \"npm run lint\",\n    \"prepare\": \"husky && npm run build\",\n    \"release\": \"standard-version\"\n  },\n  \"dependencies\": {\n    \"@types/bonjour\": \"^3.5.13\",\n    \"@types/connect-history-api-fallback\": \"^1.5.4\",\n    \"@types/express\": \"^4.17.25\",\n    \"@types/express-serve-static-core\": \"^4.17.21\",\n    \"@types/serve-index\": \"^1.9.4\",\n    \"@types/serve-static\": \"^1.15.5\",\n    \"@types/sockjs\": \"^0.3.36\",\n    \"@types/ws\": \"^8.5.10\",\n    \"ansi-html-community\": \"^0.0.8\",\n    \"bonjour-service\": \"^1.2.1\",\n    \"chokidar\": \"^3.6.0\",\n    \"colorette\": \"^2.0.10\",\n    \"compression\": \"^1.8.1\",\n    \"connect-history-api-fallback\": \"^2.0.0\",\n    \"express\": \"^4.22.1\",\n    \"graceful-fs\": \"^4.2.6\",\n    \"http-proxy-middleware\": \"^2.0.9\",\n    \"ipaddr.js\": \"^2.1.0\",\n    \"launch-editor\": \"^2.6.1\",\n    \"open\": \"^10.0.3\",\n    \"p-retry\": \"^6.2.0\",\n    \"schema-utils\": \"^4.2.0\",\n    \"selfsigned\": \"^5.5.0\",\n    \"serve-index\": \"^1.9.1\",\n    \"sockjs\": \"^0.3.24\",\n    \"spdy\": \"^4.0.2\",\n    \"webpack-dev-middleware\": \"^7.4.2\",\n    \"ws\": \"^8.18.0\"\n  },\n  \"devDependencies\": {\n    \"@babel/cli\": \"^7.25.9\",\n    \"@babel/core\": \"^7.25.9\",\n    \"@babel/eslint-parser\": \"^7.25.9\",\n    \"@babel/plugin-transform-object-assign\": \"^7.25.9\",\n    \"@babel/plugin-transform-runtime\": \"^7.25.9\",\n    \"@babel/preset-env\": \"^7.25.9\",\n    \"@babel/runtime\": \"^7.25.9\",\n    \"@commitlint/cli\": \"^19.5.0\",\n    \"@commitlint/config-conventional\": \"^19.5.0\",\n    \"@eslint/markdown\": \"^7.0.0\",\n    \"@hono/node-server\": \"^1.13.3\",\n    \"@types/compression\": \"^1.7.2\",\n    \"@types/graceful-fs\": \"^4.1.9\",\n    \"@types/node\": \"^24.0.14\",\n    \"@types/node-forge\": \"^1.3.1\",\n    \"@types/sockjs-client\": \"^1.5.1\",\n    \"@types/trusted-types\": \"^2.0.7\",\n    \"acorn\": \"^8.14.0\",\n    \"babel-jest\": \"^30.0.4\",\n    \"babel-loader\": \"^10.0.0\",\n    \"connect\": \"^3.7.0\",\n    \"core-js\": \"^3.38.1\",\n    \"cspell\": \"^8.15.5\",\n    \"css-loader\": \"^7.1.1\",\n    \"eslint\": \"^9.30.1\",\n    \"eslint-config-prettier\": \"^10.1.5\",\n    \"eslint-config-webpack\": \"^4.4.0\",\n    \"eslint-plugin-import\": \"^2.32.0\",\n    \"eslint-plugin-jest\": \"^29.0.1\",\n    \"eslint-plugin-jsdoc\": \"^51.3.4\",\n    \"eslint-plugin-n\": \"^17.21.0\",\n    \"execa\": \"^5.1.1\",\n    \"hono\": \"^4.6.8\",\n    \"html-webpack-plugin\": \"^5.6.3\",\n    \"http-proxy\": \"^1.18.1\",\n    \"husky\": \"^9.1.6\",\n    \"jest\": \"^30.0.4\",\n    \"jest-environment-jsdom\": \"^29.7.0\",\n    \"klona\": \"^2.0.4\",\n    \"less\": \"^4.1.1\",\n    \"less-loader\": \"^12.1.0\",\n    \"lint-staged\": \"^15.2.10\",\n    \"marked\": \"^12.0.0\",\n    \"memfs\": \"^4.14.0\",\n    \"npm-run-all\": \"^4.1.5\",\n    \"prettier\": \"^3.2.4\",\n    \"puppeteer\": \"^24.10.0\",\n    \"readable-stream\": \"^4.5.2\",\n    \"require-from-string\": \"^2.0.2\",\n    \"rimraf\": \"^5.0.5\",\n    \"sockjs-client\": \"^1.6.1\",\n    \"standard-version\": \"^9.3.0\",\n    \"style-loader\": \"^4.0.0\",\n    \"supertest\": \"^7.2.2\",\n    \"tcp-port-used\": \"^1.0.2\",\n    \"typescript\": \"^5.7.2\",\n    \"typescript-eslint\": \"^8.36.0\",\n    \"wait-for-expect\": \"^3.0.2\",\n    \"webpack\": \"^5.94.0\",\n    \"webpack-cli\": \"^6.0.1\",\n    \"webpack-merge\": \"^6.0.1\"\n  },\n  \"peerDependencies\": {\n    \"webpack\": \"^5.0.0\"\n  },\n  \"peerDependenciesMeta\": {\n    \"webpack-cli\": {\n      \"optional\": true\n    },\n    \"webpack\": {\n      \"optional\": true\n    }\n  },\n  \"engines\": {\n    \"node\": \">= 18.12.0\"\n  }\n}\n"
  },
  {
    "path": "scripts/extend-webpack-types.js",
    "content": "\"use strict\";\n\nconst path = require(\"node:path\");\nconst fs = require(\"graceful-fs\");\n\n/**\n * @returns {Promise<void>}\n */\nasync function extendTypes() {\n  const typesPath = path.resolve(__dirname, \"../types/lib/Server.d.ts\");\n  const content = await fs.promises.readFile(typesPath, \"utf8\");\n  const newContent = `${content}\n// DO NOT REMOVE THIS!\ntype DevServerConfiguration = Configuration;\ndeclare module \"webpack\" {\n  interface Configuration {\n    /**\n     * Can be used to configure the behaviour of webpack-dev-server when\n     * the webpack config is passed to webpack-dev-server CLI.\n     */\n    devServer?: DevServerConfiguration | undefined;\n  }\n}\n`;\n\n  await fs.promises.writeFile(typesPath, newContent);\n}\n\n// eslint-disable-next-line unicorn/prefer-top-level-await\nPromise.resolve().then(\n  () => extendTypes(),\n  (error) => {\n    throw error;\n  },\n);\n"
  },
  {
    "path": "scripts/globalSetupTest.js",
    "content": "\"use strict\";\n\nconst tcpPortUsed = require(\"tcp-port-used\");\nconst { version } = require(\"webpack\");\nconst ports = require(\"../test/ports-map\");\n\n// eslint-disable-next-line no-console\nconsole.log(`\\n Running tests for webpack @${version} \\n`);\n\n/**\n * @returns {Promise<void>}\n */\nasync function validatePorts() {\n  const samples = [];\n\n  for (const key of Object.keys(ports)) {\n    const value = ports[key];\n    const arr = Array.isArray(value) ? value : [value];\n\n    for (const port of arr) {\n      const check = tcpPortUsed.check(port, \"localhost\").then((inUse) => {\n        if (inUse) {\n          throw new Error(`${port} has already used. [${key}]`);\n        }\n      });\n\n      samples.push(check);\n    }\n  }\n\n  try {\n    await Promise.all(samples);\n  } catch (err) {\n    // eslint-disable-next-line no-console\n    console.error(err);\n    // eslint-disable-next-line n/no-process-exit\n    process.exit(1);\n  }\n}\n\nmodule.exports = validatePorts;\n"
  },
  {
    "path": "scripts/prepare-test-for-old-node.js",
    "content": "\"use strict\";\n\nconst fs = require(\"node:fs\");\nconst path = require(\"node:path\");\n\n/**\n * @returns {Promise<void>}\n */\nasync function setup() {\n  const serverCodePath = path.resolve(__dirname, \"../lib/Server.js\");\n  let serverCode = await fs.promises.readFile(serverCodePath, \"utf8\");\n\n  serverCode = serverCode.replaceAll(\n    /\\(await import\\((\".+\")\\)\\)\\.default/g,\n    \"require($1)\",\n  );\n\n  await fs.promises.writeFile(serverCodePath, serverCode);\n}\n\nPromise.resolve()\n  .then(() => setup())\n  // eslint-disable-next-line unicorn/prefer-top-level-await\n  .then(\n    () => {\n      // eslint-disable-next-line no-console\n      console.log(\"The setup was successful\");\n    },\n    (error) => {\n      throw error;\n    },\n  );\n"
  },
  {
    "path": "scripts/setupTest.js",
    "content": "\"use strict\";\n\n/* global jest */\n\nprocess.env.CHOKIDAR_USEPOLLING = true;\n\njest.setTimeout(400000);\n"
  },
  {
    "path": "test/__snapshots__/normalize-options.test.js.snap.webpack5",
    "content": "// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing\n\nexports[`normalize options allowedHosts is array 1`] = `\n{\n  \"allowedHosts\": \"all\",\n  \"bonjour\": false,\n  \"client\": {\n    \"logging\": \"info\",\n    \"overlay\": true,\n    \"reconnect\": 10,\n    \"webSocketURL\": {},\n  },\n  \"compress\": true,\n  \"devMiddleware\": {},\n  \"historyApiFallback\": false,\n  \"host\": undefined,\n  \"hot\": true,\n  \"liveReload\": true,\n  \"open\": [],\n  \"port\": \"<auto>\",\n  \"server\": {\n    \"options\": {},\n    \"type\": \"http\",\n  },\n  \"setupExitSignals\": true,\n  \"static\": [\n    {\n      \"directory\": \"<cwd>/public\",\n      \"publicPath\": [\n        \"/\",\n      ],\n      \"serveIndex\": {\n        \"icons\": true,\n      },\n      \"staticOptions\": {},\n      \"watch\": {\n        \"alwaysStat\": true,\n        \"atomic\": false,\n        \"followSymlinks\": false,\n        \"ignoreInitial\": true,\n        \"ignorePermissionErrors\": true,\n        \"ignored\": undefined,\n        \"interval\": undefined,\n        \"persistent\": true,\n        \"usePolling\": false,\n      },\n    },\n  ],\n  \"watchFiles\": [],\n  \"webSocketServer\": {\n    \"options\": {\n      \"path\": \"/ws\",\n    },\n    \"type\": \"ws\",\n  },\n}\n`;\n\nexports[`normalize options allowedHosts is string 1`] = `\n{\n  \"allowedHosts\": \"all\",\n  \"bonjour\": false,\n  \"client\": {\n    \"logging\": \"info\",\n    \"overlay\": true,\n    \"reconnect\": 10,\n    \"webSocketURL\": {},\n  },\n  \"compress\": true,\n  \"devMiddleware\": {},\n  \"historyApiFallback\": false,\n  \"host\": undefined,\n  \"hot\": true,\n  \"liveReload\": true,\n  \"open\": [],\n  \"port\": \"<auto>\",\n  \"server\": {\n    \"options\": {},\n    \"type\": \"http\",\n  },\n  \"setupExitSignals\": true,\n  \"static\": [\n    {\n      \"directory\": \"<cwd>/public\",\n      \"publicPath\": [\n        \"/\",\n      ],\n      \"serveIndex\": {\n        \"icons\": true,\n      },\n      \"staticOptions\": {},\n      \"watch\": {\n        \"alwaysStat\": true,\n        \"atomic\": false,\n        \"followSymlinks\": false,\n        \"ignoreInitial\": true,\n        \"ignorePermissionErrors\": true,\n        \"ignored\": undefined,\n        \"interval\": undefined,\n        \"persistent\": true,\n        \"usePolling\": false,\n      },\n    },\n  ],\n  \"watchFiles\": [],\n  \"webSocketServer\": {\n    \"options\": {\n      \"path\": \"/ws\",\n    },\n    \"type\": \"ws\",\n  },\n}\n`;\n\nexports[`normalize options client custom webSocketTransport path 1`] = `\n{\n  \"allowedHosts\": \"auto\",\n  \"bonjour\": false,\n  \"client\": {\n    \"logging\": \"info\",\n    \"overlay\": true,\n    \"reconnect\": 10,\n    \"webSocketTransport\": \"/path/to/custom/client/\",\n    \"webSocketURL\": {},\n  },\n  \"compress\": true,\n  \"devMiddleware\": {},\n  \"historyApiFallback\": false,\n  \"host\": undefined,\n  \"hot\": true,\n  \"liveReload\": true,\n  \"open\": [],\n  \"port\": \"<auto>\",\n  \"server\": {\n    \"options\": {},\n    \"type\": \"http\",\n  },\n  \"setupExitSignals\": true,\n  \"static\": [\n    {\n      \"directory\": \"<cwd>/public\",\n      \"publicPath\": [\n        \"/\",\n      ],\n      \"serveIndex\": {\n        \"icons\": true,\n      },\n      \"staticOptions\": {},\n      \"watch\": {\n        \"alwaysStat\": true,\n        \"atomic\": false,\n        \"followSymlinks\": false,\n        \"ignoreInitial\": true,\n        \"ignorePermissionErrors\": true,\n        \"ignored\": undefined,\n        \"interval\": undefined,\n        \"persistent\": true,\n        \"usePolling\": false,\n      },\n    },\n  ],\n  \"watchFiles\": [],\n  \"webSocketServer\": {\n    \"options\": {\n      \"path\": \"/ws\",\n    },\n    \"type\": \"ws\",\n  },\n}\n`;\n\nexports[`normalize options client host and port 1`] = `\n{\n  \"allowedHosts\": \"auto\",\n  \"bonjour\": false,\n  \"client\": {\n    \"logging\": \"info\",\n    \"overlay\": true,\n    \"reconnect\": 10,\n    \"webSocketURL\": {\n      \"hostname\": \"my.host\",\n      \"port\": 9000,\n    },\n  },\n  \"compress\": true,\n  \"devMiddleware\": {},\n  \"historyApiFallback\": false,\n  \"host\": undefined,\n  \"hot\": true,\n  \"liveReload\": true,\n  \"open\": [],\n  \"port\": \"<auto>\",\n  \"server\": {\n    \"options\": {},\n    \"type\": \"http\",\n  },\n  \"setupExitSignals\": true,\n  \"static\": [\n    {\n      \"directory\": \"<cwd>/public\",\n      \"publicPath\": [\n        \"/\",\n      ],\n      \"serveIndex\": {\n        \"icons\": true,\n      },\n      \"staticOptions\": {},\n      \"watch\": {\n        \"alwaysStat\": true,\n        \"atomic\": false,\n        \"followSymlinks\": false,\n        \"ignoreInitial\": true,\n        \"ignorePermissionErrors\": true,\n        \"ignored\": undefined,\n        \"interval\": undefined,\n        \"persistent\": true,\n        \"usePolling\": false,\n      },\n    },\n  ],\n  \"watchFiles\": [],\n  \"webSocketServer\": {\n    \"options\": {\n      \"path\": \"/ws\",\n    },\n    \"type\": \"ws\",\n  },\n}\n`;\n\nexports[`normalize options client host and string port 1`] = `\n{\n  \"allowedHosts\": \"auto\",\n  \"bonjour\": false,\n  \"client\": {\n    \"logging\": \"info\",\n    \"overlay\": true,\n    \"reconnect\": 10,\n    \"webSocketURL\": {\n      \"hostname\": \"my.host\",\n      \"port\": 9000,\n    },\n  },\n  \"compress\": true,\n  \"devMiddleware\": {},\n  \"historyApiFallback\": false,\n  \"host\": undefined,\n  \"hot\": true,\n  \"liveReload\": true,\n  \"open\": [],\n  \"port\": \"<auto>\",\n  \"server\": {\n    \"options\": {},\n    \"type\": \"http\",\n  },\n  \"setupExitSignals\": true,\n  \"static\": [\n    {\n      \"directory\": \"<cwd>/public\",\n      \"publicPath\": [\n        \"/\",\n      ],\n      \"serveIndex\": {\n        \"icons\": true,\n      },\n      \"staticOptions\": {},\n      \"watch\": {\n        \"alwaysStat\": true,\n        \"atomic\": false,\n        \"followSymlinks\": false,\n        \"ignoreInitial\": true,\n        \"ignorePermissionErrors\": true,\n        \"ignored\": undefined,\n        \"interval\": undefined,\n        \"persistent\": true,\n        \"usePolling\": false,\n      },\n    },\n  ],\n  \"watchFiles\": [],\n  \"webSocketServer\": {\n    \"options\": {\n      \"path\": \"/ws\",\n    },\n    \"type\": \"ws\",\n  },\n}\n`;\n\nexports[`normalize options client path 1`] = `\n{\n  \"allowedHosts\": \"auto\",\n  \"bonjour\": false,\n  \"client\": {\n    \"logging\": \"info\",\n    \"overlay\": true,\n    \"reconnect\": 10,\n    \"webSocketURL\": {\n      \"pathname\": \"/custom/path/\",\n    },\n  },\n  \"compress\": true,\n  \"devMiddleware\": {},\n  \"historyApiFallback\": false,\n  \"host\": undefined,\n  \"hot\": true,\n  \"liveReload\": true,\n  \"open\": [],\n  \"port\": \"<auto>\",\n  \"server\": {\n    \"options\": {},\n    \"type\": \"http\",\n  },\n  \"setupExitSignals\": true,\n  \"static\": [\n    {\n      \"directory\": \"<cwd>/public\",\n      \"publicPath\": [\n        \"/\",\n      ],\n      \"serveIndex\": {\n        \"icons\": true,\n      },\n      \"staticOptions\": {},\n      \"watch\": {\n        \"alwaysStat\": true,\n        \"atomic\": false,\n        \"followSymlinks\": false,\n        \"ignoreInitial\": true,\n        \"ignorePermissionErrors\": true,\n        \"ignored\": undefined,\n        \"interval\": undefined,\n        \"persistent\": true,\n        \"usePolling\": false,\n      },\n    },\n  ],\n  \"watchFiles\": [],\n  \"webSocketServer\": {\n    \"options\": {\n      \"path\": \"/ws\",\n    },\n    \"type\": \"ws\",\n  },\n}\n`;\n\nexports[`normalize options client path without leading/ending slashes 1`] = `\n{\n  \"allowedHosts\": \"auto\",\n  \"bonjour\": false,\n  \"client\": {\n    \"logging\": \"info\",\n    \"overlay\": true,\n    \"reconnect\": 10,\n    \"webSocketURL\": {\n      \"pathname\": \"custom/path\",\n    },\n  },\n  \"compress\": true,\n  \"devMiddleware\": {},\n  \"historyApiFallback\": false,\n  \"host\": undefined,\n  \"hot\": true,\n  \"liveReload\": true,\n  \"open\": [],\n  \"port\": \"<auto>\",\n  \"server\": {\n    \"options\": {},\n    \"type\": \"http\",\n  },\n  \"setupExitSignals\": true,\n  \"static\": [\n    {\n      \"directory\": \"<cwd>/public\",\n      \"publicPath\": [\n        \"/\",\n      ],\n      \"serveIndex\": {\n        \"icons\": true,\n      },\n      \"staticOptions\": {},\n      \"watch\": {\n        \"alwaysStat\": true,\n        \"atomic\": false,\n        \"followSymlinks\": false,\n        \"ignoreInitial\": true,\n        \"ignorePermissionErrors\": true,\n        \"ignored\": undefined,\n        \"interval\": undefined,\n        \"persistent\": true,\n        \"usePolling\": false,\n      },\n    },\n  ],\n  \"watchFiles\": [],\n  \"webSocketServer\": {\n    \"options\": {\n      \"path\": \"/ws\",\n    },\n    \"type\": \"ws\",\n  },\n}\n`;\n\nexports[`normalize options client.webSocketTransport sockjs string 1`] = `\n{\n  \"allowedHosts\": \"auto\",\n  \"bonjour\": false,\n  \"client\": {\n    \"logging\": \"info\",\n    \"overlay\": true,\n    \"reconnect\": 10,\n    \"webSocketTransport\": \"sockjs\",\n    \"webSocketURL\": {},\n  },\n  \"compress\": true,\n  \"devMiddleware\": {},\n  \"historyApiFallback\": false,\n  \"host\": undefined,\n  \"hot\": true,\n  \"liveReload\": true,\n  \"open\": [],\n  \"port\": \"<auto>\",\n  \"server\": {\n    \"options\": {},\n    \"type\": \"http\",\n  },\n  \"setupExitSignals\": true,\n  \"static\": [\n    {\n      \"directory\": \"<cwd>/public\",\n      \"publicPath\": [\n        \"/\",\n      ],\n      \"serveIndex\": {\n        \"icons\": true,\n      },\n      \"staticOptions\": {},\n      \"watch\": {\n        \"alwaysStat\": true,\n        \"atomic\": false,\n        \"followSymlinks\": false,\n        \"ignoreInitial\": true,\n        \"ignorePermissionErrors\": true,\n        \"ignored\": undefined,\n        \"interval\": undefined,\n        \"persistent\": true,\n        \"usePolling\": false,\n      },\n    },\n  ],\n  \"watchFiles\": [],\n  \"webSocketServer\": {\n    \"options\": {\n      \"path\": \"/ws\",\n    },\n    \"type\": \"ws\",\n  },\n}\n`;\n\nexports[`normalize options client.webSocketTransport ws string 1`] = `\n{\n  \"allowedHosts\": \"auto\",\n  \"bonjour\": false,\n  \"client\": {\n    \"logging\": \"info\",\n    \"overlay\": true,\n    \"reconnect\": 10,\n    \"webSocketTransport\": \"ws\",\n    \"webSocketURL\": {},\n  },\n  \"compress\": true,\n  \"devMiddleware\": {},\n  \"historyApiFallback\": false,\n  \"host\": undefined,\n  \"hot\": true,\n  \"liveReload\": true,\n  \"open\": [],\n  \"port\": \"<auto>\",\n  \"server\": {\n    \"options\": {},\n    \"type\": \"http\",\n  },\n  \"setupExitSignals\": true,\n  \"static\": [\n    {\n      \"directory\": \"<cwd>/public\",\n      \"publicPath\": [\n        \"/\",\n      ],\n      \"serveIndex\": {\n        \"icons\": true,\n      },\n      \"staticOptions\": {},\n      \"watch\": {\n        \"alwaysStat\": true,\n        \"atomic\": false,\n        \"followSymlinks\": false,\n        \"ignoreInitial\": true,\n        \"ignorePermissionErrors\": true,\n        \"ignored\": undefined,\n        \"interval\": undefined,\n        \"persistent\": true,\n        \"usePolling\": false,\n      },\n    },\n  ],\n  \"watchFiles\": [],\n  \"webSocketServer\": {\n    \"options\": {\n      \"path\": \"/ws\",\n    },\n    \"type\": \"ws\",\n  },\n}\n`;\n\nexports[`normalize options client.webSocketTransport ws string and webSocketServer object 1`] = `\n{\n  \"allowedHosts\": \"auto\",\n  \"bonjour\": false,\n  \"client\": {\n    \"logging\": \"info\",\n    \"overlay\": true,\n    \"reconnect\": 10,\n    \"webSocketTransport\": \"ws\",\n    \"webSocketURL\": {},\n  },\n  \"compress\": true,\n  \"devMiddleware\": {},\n  \"historyApiFallback\": false,\n  \"host\": undefined,\n  \"hot\": true,\n  \"liveReload\": true,\n  \"open\": [],\n  \"port\": \"<auto>\",\n  \"server\": {\n    \"options\": {},\n    \"type\": \"http\",\n  },\n  \"setupExitSignals\": true,\n  \"static\": [\n    {\n      \"directory\": \"<cwd>/public\",\n      \"publicPath\": [\n        \"/\",\n      ],\n      \"serveIndex\": {\n        \"icons\": true,\n      },\n      \"staticOptions\": {},\n      \"watch\": {\n        \"alwaysStat\": true,\n        \"atomic\": false,\n        \"followSymlinks\": false,\n        \"ignoreInitial\": true,\n        \"ignorePermissionErrors\": true,\n        \"ignored\": undefined,\n        \"interval\": undefined,\n        \"persistent\": true,\n        \"usePolling\": false,\n      },\n    },\n  ],\n  \"watchFiles\": [],\n  \"webSocketServer\": {\n    \"options\": {\n      \"host\": \"127.0.0.1\",\n      \"path\": \"/ws\",\n      \"pathname\": \"/ws\",\n    },\n    \"type\": \"ws\",\n  },\n}\n`;\n\nexports[`normalize options client.webSocketTransport ws string and webSocketServer object with port as string 1`] = `\n{\n  \"allowedHosts\": \"auto\",\n  \"bonjour\": false,\n  \"client\": {\n    \"logging\": \"info\",\n    \"overlay\": true,\n    \"reconnect\": 10,\n    \"webSocketTransport\": \"ws\",\n    \"webSocketURL\": {},\n  },\n  \"compress\": true,\n  \"devMiddleware\": {},\n  \"historyApiFallback\": false,\n  \"host\": undefined,\n  \"hot\": true,\n  \"liveReload\": true,\n  \"open\": [],\n  \"port\": \"<auto>\",\n  \"server\": {\n    \"options\": {},\n    \"type\": \"http\",\n  },\n  \"setupExitSignals\": true,\n  \"static\": [\n    {\n      \"directory\": \"<cwd>/public\",\n      \"publicPath\": [\n        \"/\",\n      ],\n      \"serveIndex\": {\n        \"icons\": true,\n      },\n      \"staticOptions\": {},\n      \"watch\": {\n        \"alwaysStat\": true,\n        \"atomic\": false,\n        \"followSymlinks\": false,\n        \"ignoreInitial\": true,\n        \"ignorePermissionErrors\": true,\n        \"ignored\": undefined,\n        \"interval\": undefined,\n        \"persistent\": true,\n        \"usePolling\": false,\n      },\n    },\n  ],\n  \"watchFiles\": [],\n  \"webSocketServer\": {\n    \"options\": {\n      \"host\": \"127.0.0.1\",\n      \"path\": \"/ws\",\n      \"pathname\": \"/ws\",\n    },\n    \"type\": \"ws\",\n  },\n}\n`;\n\nexports[`normalize options client.webSocketTransport ws string and webSocketServer ws string 1`] = `\n{\n  \"allowedHosts\": \"auto\",\n  \"bonjour\": false,\n  \"client\": {\n    \"logging\": \"info\",\n    \"overlay\": true,\n    \"reconnect\": 10,\n    \"webSocketTransport\": \"ws\",\n    \"webSocketURL\": {},\n  },\n  \"compress\": true,\n  \"devMiddleware\": {},\n  \"historyApiFallback\": false,\n  \"host\": undefined,\n  \"hot\": true,\n  \"liveReload\": true,\n  \"open\": [],\n  \"port\": \"<auto>\",\n  \"server\": {\n    \"options\": {},\n    \"type\": \"http\",\n  },\n  \"setupExitSignals\": true,\n  \"static\": [\n    {\n      \"directory\": \"<cwd>/public\",\n      \"publicPath\": [\n        \"/\",\n      ],\n      \"serveIndex\": {\n        \"icons\": true,\n      },\n      \"staticOptions\": {},\n      \"watch\": {\n        \"alwaysStat\": true,\n        \"atomic\": false,\n        \"followSymlinks\": false,\n        \"ignoreInitial\": true,\n        \"ignorePermissionErrors\": true,\n        \"ignored\": undefined,\n        \"interval\": undefined,\n        \"persistent\": true,\n        \"usePolling\": false,\n      },\n    },\n  ],\n  \"watchFiles\": [],\n  \"webSocketServer\": {\n    \"options\": {\n      \"path\": \"/ws\",\n    },\n    \"type\": \"ws\",\n  },\n}\n`;\n\nexports[`normalize options dev is set 1`] = `\n{\n  \"allowedHosts\": \"auto\",\n  \"bonjour\": false,\n  \"client\": {\n    \"logging\": \"info\",\n    \"overlay\": true,\n    \"reconnect\": 10,\n    \"webSocketURL\": {},\n  },\n  \"compress\": true,\n  \"devMiddleware\": {\n    \"serverSideRender\": true,\n  },\n  \"historyApiFallback\": false,\n  \"host\": undefined,\n  \"hot\": true,\n  \"liveReload\": true,\n  \"open\": [],\n  \"port\": \"<auto>\",\n  \"server\": {\n    \"options\": {},\n    \"type\": \"http\",\n  },\n  \"setupExitSignals\": true,\n  \"static\": [\n    {\n      \"directory\": \"<cwd>/public\",\n      \"publicPath\": [\n        \"/\",\n      ],\n      \"serveIndex\": {\n        \"icons\": true,\n      },\n      \"staticOptions\": {},\n      \"watch\": {\n        \"alwaysStat\": true,\n        \"atomic\": false,\n        \"followSymlinks\": false,\n        \"ignoreInitial\": true,\n        \"ignorePermissionErrors\": true,\n        \"ignored\": undefined,\n        \"interval\": undefined,\n        \"persistent\": true,\n        \"usePolling\": false,\n      },\n    },\n  ],\n  \"watchFiles\": [],\n  \"webSocketServer\": {\n    \"options\": {\n      \"path\": \"/ws\",\n    },\n    \"type\": \"ws\",\n  },\n}\n`;\n\nexports[`normalize options hot is false 1`] = `\n{\n  \"allowedHosts\": \"auto\",\n  \"bonjour\": false,\n  \"client\": {\n    \"logging\": \"info\",\n    \"overlay\": true,\n    \"reconnect\": 10,\n    \"webSocketURL\": {},\n  },\n  \"compress\": true,\n  \"devMiddleware\": {},\n  \"historyApiFallback\": false,\n  \"host\": undefined,\n  \"hot\": false,\n  \"liveReload\": true,\n  \"open\": [],\n  \"port\": \"<auto>\",\n  \"server\": {\n    \"options\": {},\n    \"type\": \"http\",\n  },\n  \"setupExitSignals\": true,\n  \"static\": [\n    {\n      \"directory\": \"<cwd>/public\",\n      \"publicPath\": [\n        \"/\",\n      ],\n      \"serveIndex\": {\n        \"icons\": true,\n      },\n      \"staticOptions\": {},\n      \"watch\": {\n        \"alwaysStat\": true,\n        \"atomic\": false,\n        \"followSymlinks\": false,\n        \"ignoreInitial\": true,\n        \"ignorePermissionErrors\": true,\n        \"ignored\": undefined,\n        \"interval\": undefined,\n        \"persistent\": true,\n        \"usePolling\": false,\n      },\n    },\n  ],\n  \"watchFiles\": [],\n  \"webSocketServer\": {\n    \"options\": {\n      \"path\": \"/ws\",\n    },\n    \"type\": \"ws\",\n  },\n}\n`;\n\nexports[`normalize options hot is only 1`] = `\n{\n  \"allowedHosts\": \"auto\",\n  \"bonjour\": false,\n  \"client\": {\n    \"logging\": \"info\",\n    \"overlay\": true,\n    \"reconnect\": 10,\n    \"webSocketURL\": {},\n  },\n  \"compress\": true,\n  \"devMiddleware\": {},\n  \"historyApiFallback\": false,\n  \"host\": undefined,\n  \"hot\": \"only\",\n  \"liveReload\": true,\n  \"open\": [],\n  \"port\": \"<auto>\",\n  \"server\": {\n    \"options\": {},\n    \"type\": \"http\",\n  },\n  \"setupExitSignals\": true,\n  \"static\": [\n    {\n      \"directory\": \"<cwd>/public\",\n      \"publicPath\": [\n        \"/\",\n      ],\n      \"serveIndex\": {\n        \"icons\": true,\n      },\n      \"staticOptions\": {},\n      \"watch\": {\n        \"alwaysStat\": true,\n        \"atomic\": false,\n        \"followSymlinks\": false,\n        \"ignoreInitial\": true,\n        \"ignorePermissionErrors\": true,\n        \"ignored\": undefined,\n        \"interval\": undefined,\n        \"persistent\": true,\n        \"usePolling\": false,\n      },\n    },\n  ],\n  \"watchFiles\": [],\n  \"webSocketServer\": {\n    \"options\": {\n      \"path\": \"/ws\",\n    },\n    \"type\": \"ws\",\n  },\n}\n`;\n\nexports[`normalize options hot is true 1`] = `\n{\n  \"allowedHosts\": \"auto\",\n  \"bonjour\": false,\n  \"client\": {\n    \"logging\": \"info\",\n    \"overlay\": true,\n    \"reconnect\": 10,\n    \"webSocketURL\": {},\n  },\n  \"compress\": true,\n  \"devMiddleware\": {},\n  \"historyApiFallback\": false,\n  \"host\": undefined,\n  \"hot\": true,\n  \"liveReload\": true,\n  \"open\": [],\n  \"port\": \"<auto>\",\n  \"server\": {\n    \"options\": {},\n    \"type\": \"http\",\n  },\n  \"setupExitSignals\": true,\n  \"static\": [\n    {\n      \"directory\": \"<cwd>/public\",\n      \"publicPath\": [\n        \"/\",\n      ],\n      \"serveIndex\": {\n        \"icons\": true,\n      },\n      \"staticOptions\": {},\n      \"watch\": {\n        \"alwaysStat\": true,\n        \"atomic\": false,\n        \"followSymlinks\": false,\n        \"ignoreInitial\": true,\n        \"ignorePermissionErrors\": true,\n        \"ignored\": undefined,\n        \"interval\": undefined,\n        \"persistent\": true,\n        \"usePolling\": false,\n      },\n    },\n  ],\n  \"watchFiles\": [],\n  \"webSocketServer\": {\n    \"options\": {\n      \"path\": \"/ws\",\n    },\n    \"type\": \"ws\",\n  },\n}\n`;\n\nexports[`normalize options liveReload is false 1`] = `\n{\n  \"allowedHosts\": \"auto\",\n  \"bonjour\": false,\n  \"client\": {\n    \"logging\": \"info\",\n    \"overlay\": true,\n    \"reconnect\": 10,\n    \"webSocketURL\": {},\n  },\n  \"compress\": true,\n  \"devMiddleware\": {},\n  \"historyApiFallback\": false,\n  \"host\": undefined,\n  \"hot\": true,\n  \"liveReload\": false,\n  \"open\": [],\n  \"port\": \"<auto>\",\n  \"server\": {\n    \"options\": {},\n    \"type\": \"http\",\n  },\n  \"setupExitSignals\": true,\n  \"static\": [\n    {\n      \"directory\": \"<cwd>/public\",\n      \"publicPath\": [\n        \"/\",\n      ],\n      \"serveIndex\": {\n        \"icons\": true,\n      },\n      \"staticOptions\": {},\n      \"watch\": {\n        \"alwaysStat\": true,\n        \"atomic\": false,\n        \"followSymlinks\": false,\n        \"ignoreInitial\": true,\n        \"ignorePermissionErrors\": true,\n        \"ignored\": undefined,\n        \"interval\": undefined,\n        \"persistent\": true,\n        \"usePolling\": false,\n      },\n    },\n  ],\n  \"watchFiles\": [],\n  \"webSocketServer\": {\n    \"options\": {\n      \"path\": \"/ws\",\n    },\n    \"type\": \"ws\",\n  },\n}\n`;\n\nexports[`normalize options liveReload is true 1`] = `\n{\n  \"allowedHosts\": \"auto\",\n  \"bonjour\": false,\n  \"client\": {\n    \"logging\": \"info\",\n    \"overlay\": true,\n    \"reconnect\": 10,\n    \"webSocketURL\": {},\n  },\n  \"compress\": true,\n  \"devMiddleware\": {},\n  \"historyApiFallback\": false,\n  \"host\": undefined,\n  \"hot\": true,\n  \"liveReload\": true,\n  \"open\": [],\n  \"port\": \"<auto>\",\n  \"server\": {\n    \"options\": {},\n    \"type\": \"http\",\n  },\n  \"setupExitSignals\": true,\n  \"static\": [\n    {\n      \"directory\": \"<cwd>/public\",\n      \"publicPath\": [\n        \"/\",\n      ],\n      \"serveIndex\": {\n        \"icons\": true,\n      },\n      \"staticOptions\": {},\n      \"watch\": {\n        \"alwaysStat\": true,\n        \"atomic\": false,\n        \"followSymlinks\": false,\n        \"ignoreInitial\": true,\n        \"ignorePermissionErrors\": true,\n        \"ignored\": undefined,\n        \"interval\": undefined,\n        \"persistent\": true,\n        \"usePolling\": false,\n      },\n    },\n  ],\n  \"watchFiles\": [],\n  \"webSocketServer\": {\n    \"options\": {\n      \"path\": \"/ws\",\n    },\n    \"type\": \"ws\",\n  },\n}\n`;\n\nexports[`normalize options multi compiler client.logging should override infrastructureLogging.level 1`] = `\n{\n  \"allowedHosts\": \"auto\",\n  \"bonjour\": false,\n  \"client\": {\n    \"logging\": \"none\",\n    \"overlay\": true,\n    \"reconnect\": 10,\n    \"webSocketURL\": {},\n  },\n  \"compress\": true,\n  \"devMiddleware\": {},\n  \"historyApiFallback\": false,\n  \"host\": undefined,\n  \"hot\": true,\n  \"liveReload\": true,\n  \"open\": [],\n  \"port\": \"<auto>\",\n  \"server\": {\n    \"options\": {},\n    \"type\": \"http\",\n  },\n  \"setupExitSignals\": true,\n  \"static\": [\n    {\n      \"directory\": \"<cwd>/public\",\n      \"publicPath\": [\n        \"/\",\n      ],\n      \"serveIndex\": {\n        \"icons\": true,\n      },\n      \"staticOptions\": {},\n      \"watch\": {\n        \"alwaysStat\": true,\n        \"atomic\": false,\n        \"followSymlinks\": false,\n        \"ignoreInitial\": true,\n        \"ignorePermissionErrors\": true,\n        \"ignored\": undefined,\n        \"interval\": undefined,\n        \"persistent\": true,\n        \"usePolling\": false,\n      },\n    },\n  ],\n  \"watchFiles\": [],\n  \"webSocketServer\": {\n    \"options\": {\n      \"path\": \"/ws\",\n    },\n    \"type\": \"ws\",\n  },\n}\n`;\n\nexports[`normalize options multi compiler client.logging should respect infrastructureLogging.level 1`] = `\n{\n  \"allowedHosts\": \"auto\",\n  \"bonjour\": false,\n  \"client\": {\n    \"logging\": \"warn\",\n    \"overlay\": true,\n    \"reconnect\": 10,\n    \"webSocketURL\": {},\n  },\n  \"compress\": true,\n  \"devMiddleware\": {},\n  \"historyApiFallback\": false,\n  \"host\": undefined,\n  \"hot\": true,\n  \"liveReload\": true,\n  \"open\": [],\n  \"port\": \"<auto>\",\n  \"server\": {\n    \"options\": {},\n    \"type\": \"http\",\n  },\n  \"setupExitSignals\": true,\n  \"static\": [\n    {\n      \"directory\": \"<cwd>/public\",\n      \"publicPath\": [\n        \"/\",\n      ],\n      \"serveIndex\": {\n        \"icons\": true,\n      },\n      \"staticOptions\": {},\n      \"watch\": {\n        \"alwaysStat\": true,\n        \"atomic\": false,\n        \"followSymlinks\": false,\n        \"ignoreInitial\": true,\n        \"ignorePermissionErrors\": true,\n        \"ignored\": undefined,\n        \"interval\": undefined,\n        \"persistent\": true,\n        \"usePolling\": false,\n      },\n    },\n  ],\n  \"watchFiles\": [],\n  \"webSocketServer\": {\n    \"options\": {\n      \"path\": \"/ws\",\n    },\n    \"type\": \"ws\",\n  },\n}\n`;\n\nexports[`normalize options multi compiler client.logging should respect infrastructureLogging.level 2`] = `\n{\n  \"allowedHosts\": \"auto\",\n  \"bonjour\": false,\n  \"client\": {\n    \"logging\": \"warn\",\n    \"overlay\": true,\n    \"reconnect\": 10,\n    \"webSocketURL\": {},\n  },\n  \"compress\": true,\n  \"devMiddleware\": {},\n  \"historyApiFallback\": false,\n  \"host\": undefined,\n  \"hot\": true,\n  \"liveReload\": true,\n  \"open\": [],\n  \"port\": \"<auto>\",\n  \"server\": {\n    \"options\": {},\n    \"type\": \"http\",\n  },\n  \"setupExitSignals\": true,\n  \"static\": [\n    {\n      \"directory\": \"<cwd>/public\",\n      \"publicPath\": [\n        \"/\",\n      ],\n      \"serveIndex\": {\n        \"icons\": true,\n      },\n      \"staticOptions\": {},\n      \"watch\": {\n        \"alwaysStat\": true,\n        \"atomic\": false,\n        \"followSymlinks\": false,\n        \"ignoreInitial\": true,\n        \"ignorePermissionErrors\": true,\n        \"ignored\": undefined,\n        \"interval\": undefined,\n        \"persistent\": true,\n        \"usePolling\": false,\n      },\n    },\n  ],\n  \"watchFiles\": [],\n  \"webSocketServer\": {\n    \"options\": {\n      \"path\": \"/ws\",\n    },\n    \"type\": \"ws\",\n  },\n}\n`;\n\nexports[`normalize options multi compiler client.logging should respect infrastructureLogging.level 3`] = `\n{\n  \"allowedHosts\": \"auto\",\n  \"bonjour\": false,\n  \"client\": {\n    \"logging\": \"warn\",\n    \"overlay\": true,\n    \"reconnect\": 10,\n    \"webSocketURL\": {},\n  },\n  \"compress\": true,\n  \"devMiddleware\": {},\n  \"historyApiFallback\": false,\n  \"host\": undefined,\n  \"hot\": true,\n  \"liveReload\": true,\n  \"open\": [],\n  \"port\": \"<auto>\",\n  \"server\": {\n    \"options\": {},\n    \"type\": \"http\",\n  },\n  \"setupExitSignals\": true,\n  \"static\": [\n    {\n      \"directory\": \"<cwd>/public\",\n      \"publicPath\": [\n        \"/\",\n      ],\n      \"serveIndex\": {\n        \"icons\": true,\n      },\n      \"staticOptions\": {},\n      \"watch\": {\n        \"alwaysStat\": true,\n        \"atomic\": false,\n        \"followSymlinks\": false,\n        \"ignoreInitial\": true,\n        \"ignorePermissionErrors\": true,\n        \"ignored\": undefined,\n        \"interval\": undefined,\n        \"persistent\": true,\n        \"usePolling\": false,\n      },\n    },\n  ],\n  \"watchFiles\": [],\n  \"webSocketServer\": {\n    \"options\": {\n      \"path\": \"/ws\",\n    },\n    \"type\": \"ws\",\n  },\n}\n`;\n\nexports[`normalize options multi compiler watchOptions is set 1`] = `\n{\n  \"allowedHosts\": \"auto\",\n  \"bonjour\": false,\n  \"client\": {\n    \"logging\": \"info\",\n    \"overlay\": true,\n    \"reconnect\": 10,\n    \"webSocketURL\": {},\n  },\n  \"compress\": true,\n  \"devMiddleware\": {},\n  \"historyApiFallback\": false,\n  \"host\": undefined,\n  \"hot\": true,\n  \"liveReload\": true,\n  \"open\": [],\n  \"port\": \"<auto>\",\n  \"server\": {\n    \"options\": {},\n    \"type\": \"http\",\n  },\n  \"setupExitSignals\": true,\n  \"static\": [\n    {\n      \"directory\": \"<cwd>/public\",\n      \"publicPath\": [\n        \"/\",\n      ],\n      \"serveIndex\": {\n        \"icons\": true,\n      },\n      \"staticOptions\": {},\n      \"watch\": {\n        \"alwaysStat\": true,\n        \"atomic\": false,\n        \"followSymlinks\": false,\n        \"ignoreInitial\": true,\n        \"ignorePermissionErrors\": true,\n        \"ignored\": undefined,\n        \"interval\": undefined,\n        \"persistent\": true,\n        \"usePolling\": false,\n      },\n    },\n  ],\n  \"watchFiles\": [],\n  \"webSocketServer\": {\n    \"options\": {\n      \"path\": \"/ws\",\n    },\n    \"type\": \"ws\",\n  },\n}\n`;\n\nexports[`normalize options no options 1`] = `\n{\n  \"allowedHosts\": \"auto\",\n  \"bonjour\": false,\n  \"client\": {\n    \"logging\": \"info\",\n    \"overlay\": true,\n    \"reconnect\": 10,\n    \"webSocketURL\": {},\n  },\n  \"compress\": true,\n  \"devMiddleware\": {},\n  \"historyApiFallback\": false,\n  \"host\": undefined,\n  \"hot\": true,\n  \"liveReload\": true,\n  \"open\": [],\n  \"port\": \"<auto>\",\n  \"server\": {\n    \"options\": {},\n    \"type\": \"http\",\n  },\n  \"setupExitSignals\": true,\n  \"static\": [\n    {\n      \"directory\": \"<cwd>/public\",\n      \"publicPath\": [\n        \"/\",\n      ],\n      \"serveIndex\": {\n        \"icons\": true,\n      },\n      \"staticOptions\": {},\n      \"watch\": {\n        \"alwaysStat\": true,\n        \"atomic\": false,\n        \"followSymlinks\": false,\n        \"ignoreInitial\": true,\n        \"ignorePermissionErrors\": true,\n        \"ignored\": undefined,\n        \"interval\": undefined,\n        \"persistent\": true,\n        \"usePolling\": false,\n      },\n    },\n  ],\n  \"watchFiles\": [],\n  \"webSocketServer\": {\n    \"options\": {\n      \"path\": \"/ws\",\n    },\n    \"type\": \"ws\",\n  },\n}\n`;\n\nexports[`normalize options port string 1`] = `\n{\n  \"allowedHosts\": \"auto\",\n  \"bonjour\": false,\n  \"client\": {\n    \"logging\": \"info\",\n    \"overlay\": true,\n    \"reconnect\": 10,\n    \"webSocketURL\": {},\n  },\n  \"compress\": true,\n  \"devMiddleware\": {},\n  \"historyApiFallback\": false,\n  \"host\": undefined,\n  \"hot\": true,\n  \"liveReload\": true,\n  \"open\": [],\n  \"port\": \"<auto>\",\n  \"server\": {\n    \"options\": {},\n    \"type\": \"http\",\n  },\n  \"setupExitSignals\": true,\n  \"static\": [\n    {\n      \"directory\": \"<cwd>/public\",\n      \"publicPath\": [\n        \"/\",\n      ],\n      \"serveIndex\": {\n        \"icons\": true,\n      },\n      \"staticOptions\": {},\n      \"watch\": {\n        \"alwaysStat\": true,\n        \"atomic\": false,\n        \"followSymlinks\": false,\n        \"ignoreInitial\": true,\n        \"ignorePermissionErrors\": true,\n        \"ignored\": undefined,\n        \"interval\": undefined,\n        \"persistent\": true,\n        \"usePolling\": false,\n      },\n    },\n  ],\n  \"watchFiles\": [],\n  \"webSocketServer\": {\n    \"options\": {\n      \"path\": \"/ws\",\n    },\n    \"type\": \"ws\",\n  },\n}\n`;\n\nexports[`normalize options single compiler client.logging should default to infrastructureLogging.level 1`] = `\n{\n  \"allowedHosts\": \"auto\",\n  \"bonjour\": false,\n  \"client\": {\n    \"logging\": \"verbose\",\n    \"overlay\": true,\n    \"reconnect\": 10,\n    \"webSocketURL\": {},\n  },\n  \"compress\": true,\n  \"devMiddleware\": {},\n  \"historyApiFallback\": false,\n  \"host\": undefined,\n  \"hot\": true,\n  \"liveReload\": true,\n  \"open\": [],\n  \"port\": \"<auto>\",\n  \"server\": {\n    \"options\": {},\n    \"type\": \"http\",\n  },\n  \"setupExitSignals\": true,\n  \"static\": [\n    {\n      \"directory\": \"<cwd>/public\",\n      \"publicPath\": [\n        \"/\",\n      ],\n      \"serveIndex\": {\n        \"icons\": true,\n      },\n      \"staticOptions\": {},\n      \"watch\": {\n        \"alwaysStat\": true,\n        \"atomic\": false,\n        \"followSymlinks\": false,\n        \"ignoreInitial\": true,\n        \"ignorePermissionErrors\": true,\n        \"ignored\": undefined,\n        \"interval\": undefined,\n        \"persistent\": true,\n        \"usePolling\": false,\n      },\n    },\n  ],\n  \"watchFiles\": [],\n  \"webSocketServer\": {\n    \"options\": {\n      \"path\": \"/ws\",\n    },\n    \"type\": \"ws\",\n  },\n}\n`;\n\nexports[`normalize options single compiler client.logging should override to infrastructureLogging.level 1`] = `\n{\n  \"allowedHosts\": \"auto\",\n  \"bonjour\": false,\n  \"client\": {\n    \"logging\": \"none\",\n    \"overlay\": true,\n    \"reconnect\": 10,\n    \"webSocketURL\": {},\n  },\n  \"compress\": true,\n  \"devMiddleware\": {},\n  \"historyApiFallback\": false,\n  \"host\": undefined,\n  \"hot\": true,\n  \"liveReload\": true,\n  \"open\": [],\n  \"port\": \"<auto>\",\n  \"server\": {\n    \"options\": {},\n    \"type\": \"http\",\n  },\n  \"setupExitSignals\": true,\n  \"static\": [\n    {\n      \"directory\": \"<cwd>/public\",\n      \"publicPath\": [\n        \"/\",\n      ],\n      \"serveIndex\": {\n        \"icons\": true,\n      },\n      \"staticOptions\": {},\n      \"watch\": {\n        \"alwaysStat\": true,\n        \"atomic\": false,\n        \"followSymlinks\": false,\n        \"ignoreInitial\": true,\n        \"ignorePermissionErrors\": true,\n        \"ignored\": undefined,\n        \"interval\": undefined,\n        \"persistent\": true,\n        \"usePolling\": false,\n      },\n    },\n  ],\n  \"watchFiles\": [],\n  \"webSocketServer\": {\n    \"options\": {\n      \"path\": \"/ws\",\n    },\n    \"type\": \"ws\",\n  },\n}\n`;\n\nexports[`normalize options single compiler watchOptions is object 1`] = `\n{\n  \"allowedHosts\": \"auto\",\n  \"bonjour\": false,\n  \"client\": {\n    \"logging\": \"info\",\n    \"overlay\": true,\n    \"reconnect\": 10,\n    \"webSocketURL\": {},\n  },\n  \"compress\": true,\n  \"devMiddleware\": {},\n  \"historyApiFallback\": false,\n  \"host\": undefined,\n  \"hot\": true,\n  \"liveReload\": true,\n  \"open\": [],\n  \"port\": \"<auto>\",\n  \"server\": {\n    \"options\": {},\n    \"type\": \"http\",\n  },\n  \"setupExitSignals\": true,\n  \"static\": [\n    {\n      \"directory\": \"<cwd>/public\",\n      \"publicPath\": [\n        \"/\",\n      ],\n      \"serveIndex\": {\n        \"icons\": true,\n      },\n      \"staticOptions\": {},\n      \"watch\": {\n        \"alwaysStat\": true,\n        \"atomic\": false,\n        \"followSymlinks\": false,\n        \"ignoreInitial\": true,\n        \"ignorePermissionErrors\": true,\n        \"ignored\": undefined,\n        \"interval\": undefined,\n        \"persistent\": true,\n        \"usePolling\": false,\n      },\n    },\n  ],\n  \"watchFiles\": [],\n  \"webSocketServer\": {\n    \"options\": {\n      \"path\": \"/ws\",\n    },\n    \"type\": \"ws\",\n  },\n}\n`;\n\nexports[`normalize options single compiler watchOptions is object with static watch overriding it 1`] = `\n{\n  \"allowedHosts\": \"auto\",\n  \"bonjour\": false,\n  \"client\": {\n    \"logging\": \"info\",\n    \"overlay\": true,\n    \"reconnect\": 10,\n    \"webSocketURL\": {},\n  },\n  \"compress\": true,\n  \"devMiddleware\": {},\n  \"historyApiFallback\": false,\n  \"host\": undefined,\n  \"hot\": true,\n  \"liveReload\": true,\n  \"open\": [],\n  \"port\": \"<auto>\",\n  \"server\": {\n    \"options\": {},\n    \"type\": \"http\",\n  },\n  \"setupExitSignals\": true,\n  \"static\": [\n    {\n      \"directory\": \"<cwd>/public\",\n      \"publicPath\": [\n        \"/\",\n      ],\n      \"serveIndex\": {\n        \"icons\": true,\n      },\n      \"staticOptions\": {},\n      \"watch\": {\n        \"alwaysStat\": true,\n        \"atomic\": false,\n        \"followSymlinks\": false,\n        \"ignoreInitial\": true,\n        \"ignorePermissionErrors\": true,\n        \"ignored\": undefined,\n        \"interval\": 500,\n        \"persistent\": true,\n        \"usePolling\": true,\n      },\n    },\n  ],\n  \"watchFiles\": [],\n  \"webSocketServer\": {\n    \"options\": {\n      \"path\": \"/ws\",\n    },\n    \"type\": \"ws\",\n  },\n}\n`;\n\nexports[`normalize options single compiler watchOptions is object with static watch true 1`] = `\n{\n  \"allowedHosts\": \"auto\",\n  \"bonjour\": false,\n  \"client\": {\n    \"logging\": \"info\",\n    \"overlay\": true,\n    \"reconnect\": 10,\n    \"webSocketURL\": {},\n  },\n  \"compress\": true,\n  \"devMiddleware\": {},\n  \"historyApiFallback\": false,\n  \"host\": undefined,\n  \"hot\": true,\n  \"liveReload\": true,\n  \"open\": [],\n  \"port\": \"<auto>\",\n  \"server\": {\n    \"options\": {},\n    \"type\": \"http\",\n  },\n  \"setupExitSignals\": true,\n  \"static\": [\n    {\n      \"directory\": \"<cwd>/public\",\n      \"publicPath\": [\n        \"/\",\n      ],\n      \"serveIndex\": {\n        \"icons\": true,\n      },\n      \"staticOptions\": {},\n      \"watch\": {\n        \"alwaysStat\": true,\n        \"atomic\": false,\n        \"followSymlinks\": false,\n        \"ignoreInitial\": true,\n        \"ignorePermissionErrors\": true,\n        \"ignored\": undefined,\n        \"interval\": undefined,\n        \"persistent\": true,\n        \"usePolling\": false,\n      },\n    },\n  ],\n  \"watchFiles\": [],\n  \"webSocketServer\": {\n    \"options\": {\n      \"path\": \"/ws\",\n    },\n    \"type\": \"ws\",\n  },\n}\n`;\n\nexports[`normalize options single compiler watchOptions is object with watch false 1`] = `\n{\n  \"allowedHosts\": \"auto\",\n  \"bonjour\": false,\n  \"client\": {\n    \"logging\": \"info\",\n    \"overlay\": true,\n    \"reconnect\": 10,\n    \"webSocketURL\": {},\n  },\n  \"compress\": true,\n  \"devMiddleware\": {},\n  \"historyApiFallback\": false,\n  \"host\": undefined,\n  \"hot\": true,\n  \"liveReload\": true,\n  \"open\": [],\n  \"port\": \"<auto>\",\n  \"server\": {\n    \"options\": {},\n    \"type\": \"http\",\n  },\n  \"setupExitSignals\": true,\n  \"static\": [\n    {\n      \"directory\": \"<cwd>/public\",\n      \"publicPath\": [\n        \"/\",\n      ],\n      \"serveIndex\": {\n        \"icons\": true,\n      },\n      \"staticOptions\": {},\n      \"watch\": {\n        \"alwaysStat\": true,\n        \"atomic\": false,\n        \"followSymlinks\": false,\n        \"ignoreInitial\": true,\n        \"ignorePermissionErrors\": true,\n        \"ignored\": undefined,\n        \"interval\": undefined,\n        \"persistent\": true,\n        \"usePolling\": false,\n      },\n    },\n  ],\n  \"watchFiles\": [],\n  \"webSocketServer\": {\n    \"options\": {\n      \"path\": \"/ws\",\n    },\n    \"type\": \"ws\",\n  },\n}\n`;\n\nexports[`normalize options static is an array of static objects 1`] = `\n{\n  \"allowedHosts\": \"auto\",\n  \"bonjour\": false,\n  \"client\": {\n    \"logging\": \"info\",\n    \"overlay\": true,\n    \"reconnect\": 10,\n    \"webSocketURL\": {},\n  },\n  \"compress\": true,\n  \"devMiddleware\": {},\n  \"historyApiFallback\": false,\n  \"host\": undefined,\n  \"hot\": true,\n  \"liveReload\": true,\n  \"open\": [],\n  \"port\": \"<auto>\",\n  \"server\": {\n    \"options\": {},\n    \"type\": \"http\",\n  },\n  \"setupExitSignals\": true,\n  \"static\": [\n    {\n      \"directory\": \"/static/path1\",\n      \"publicPath\": [\n        \"/\",\n      ],\n      \"serveIndex\": {\n        \"icons\": true,\n      },\n      \"staticOptions\": {},\n      \"watch\": {\n        \"alwaysStat\": true,\n        \"atomic\": false,\n        \"followSymlinks\": false,\n        \"ignoreInitial\": true,\n        \"ignorePermissionErrors\": true,\n        \"ignored\": undefined,\n        \"interval\": undefined,\n        \"persistent\": true,\n        \"usePolling\": false,\n      },\n    },\n    {\n      \"directory\": \"<cwd>/public\",\n      \"publicPath\": [\n        \"/static/public/path\",\n      ],\n      \"serveIndex\": {\n        \"icons\": true,\n      },\n      \"staticOptions\": {},\n      \"watch\": {\n        \"alwaysStat\": true,\n        \"atomic\": false,\n        \"followSymlinks\": false,\n        \"ignoreInitial\": true,\n        \"ignorePermissionErrors\": true,\n        \"ignored\": undefined,\n        \"interval\": undefined,\n        \"persistent\": true,\n        \"usePolling\": false,\n      },\n    },\n  ],\n  \"watchFiles\": [],\n  \"webSocketServer\": {\n    \"options\": {\n      \"path\": \"/ws\",\n    },\n    \"type\": \"ws\",\n  },\n}\n`;\n\nexports[`normalize options static is an array of strings 1`] = `\n{\n  \"allowedHosts\": \"auto\",\n  \"bonjour\": false,\n  \"client\": {\n    \"logging\": \"info\",\n    \"overlay\": true,\n    \"reconnect\": 10,\n    \"webSocketURL\": {},\n  },\n  \"compress\": true,\n  \"devMiddleware\": {},\n  \"historyApiFallback\": false,\n  \"host\": undefined,\n  \"hot\": true,\n  \"liveReload\": true,\n  \"open\": [],\n  \"port\": \"<auto>\",\n  \"server\": {\n    \"options\": {},\n    \"type\": \"http\",\n  },\n  \"setupExitSignals\": true,\n  \"static\": [\n    {\n      \"directory\": \"/static/path1\",\n      \"publicPath\": [\n        \"/\",\n      ],\n      \"serveIndex\": {\n        \"icons\": true,\n      },\n      \"staticOptions\": {},\n      \"watch\": {\n        \"alwaysStat\": true,\n        \"atomic\": false,\n        \"followSymlinks\": false,\n        \"ignoreInitial\": true,\n        \"ignorePermissionErrors\": true,\n        \"ignored\": undefined,\n        \"interval\": undefined,\n        \"persistent\": true,\n        \"usePolling\": false,\n      },\n    },\n    {\n      \"directory\": \"/static/path2\",\n      \"publicPath\": [\n        \"/\",\n      ],\n      \"serveIndex\": {\n        \"icons\": true,\n      },\n      \"staticOptions\": {},\n      \"watch\": {\n        \"alwaysStat\": true,\n        \"atomic\": false,\n        \"followSymlinks\": false,\n        \"ignoreInitial\": true,\n        \"ignorePermissionErrors\": true,\n        \"ignored\": undefined,\n        \"interval\": undefined,\n        \"persistent\": true,\n        \"usePolling\": false,\n      },\n    },\n  ],\n  \"watchFiles\": [],\n  \"webSocketServer\": {\n    \"options\": {\n      \"path\": \"/ws\",\n    },\n    \"type\": \"ws\",\n  },\n}\n`;\n\nexports[`normalize options static is an array of strings and static objects 1`] = `\n{\n  \"allowedHosts\": \"auto\",\n  \"bonjour\": false,\n  \"client\": {\n    \"logging\": \"info\",\n    \"overlay\": true,\n    \"reconnect\": 10,\n    \"webSocketURL\": {},\n  },\n  \"compress\": true,\n  \"devMiddleware\": {},\n  \"historyApiFallback\": false,\n  \"host\": undefined,\n  \"hot\": true,\n  \"liveReload\": true,\n  \"open\": [],\n  \"port\": \"<auto>\",\n  \"server\": {\n    \"options\": {},\n    \"type\": \"http\",\n  },\n  \"setupExitSignals\": true,\n  \"static\": [\n    {\n      \"directory\": \"/static/path1\",\n      \"publicPath\": [\n        \"/\",\n      ],\n      \"serveIndex\": {\n        \"icons\": true,\n      },\n      \"staticOptions\": {},\n      \"watch\": {\n        \"alwaysStat\": true,\n        \"atomic\": false,\n        \"followSymlinks\": false,\n        \"ignoreInitial\": true,\n        \"ignorePermissionErrors\": true,\n        \"ignored\": undefined,\n        \"interval\": undefined,\n        \"persistent\": true,\n        \"usePolling\": false,\n      },\n    },\n    {\n      \"directory\": \"<cwd>/public\",\n      \"publicPath\": [\n        \"/static/public/path/\",\n      ],\n      \"serveIndex\": {\n        \"icons\": true,\n      },\n      \"staticOptions\": {},\n      \"watch\": {\n        \"alwaysStat\": true,\n        \"atomic\": false,\n        \"followSymlinks\": false,\n        \"ignoreInitial\": true,\n        \"ignorePermissionErrors\": true,\n        \"ignored\": undefined,\n        \"interval\": undefined,\n        \"persistent\": true,\n        \"usePolling\": false,\n      },\n    },\n  ],\n  \"watchFiles\": [],\n  \"webSocketServer\": {\n    \"options\": {\n      \"path\": \"/ws\",\n    },\n    \"type\": \"ws\",\n  },\n}\n`;\n\nexports[`normalize options static is an object 1`] = `\n{\n  \"allowedHosts\": \"auto\",\n  \"bonjour\": false,\n  \"client\": {\n    \"logging\": \"info\",\n    \"overlay\": true,\n    \"reconnect\": 10,\n    \"webSocketURL\": {},\n  },\n  \"compress\": true,\n  \"devMiddleware\": {},\n  \"historyApiFallback\": false,\n  \"host\": undefined,\n  \"hot\": true,\n  \"liveReload\": true,\n  \"open\": [],\n  \"port\": \"<auto>\",\n  \"server\": {\n    \"options\": {},\n    \"type\": \"http\",\n  },\n  \"setupExitSignals\": true,\n  \"static\": [\n    {\n      \"directory\": \"/static/path\",\n      \"publicPath\": [\n        \"/\",\n      ],\n      \"serveIndex\": {\n        \"icons\": true,\n      },\n      \"staticOptions\": {},\n      \"watch\": {\n        \"alwaysStat\": true,\n        \"atomic\": false,\n        \"followSymlinks\": false,\n        \"ignoreInitial\": true,\n        \"ignorePermissionErrors\": true,\n        \"ignored\": undefined,\n        \"interval\": undefined,\n        \"persistent\": true,\n        \"usePolling\": false,\n      },\n    },\n  ],\n  \"watchFiles\": [],\n  \"webSocketServer\": {\n    \"options\": {\n      \"path\": \"/ws\",\n    },\n    \"type\": \"ws\",\n  },\n}\n`;\n\nexports[`normalize options static is an object with staticOptions 1`] = `\n{\n  \"allowedHosts\": \"auto\",\n  \"bonjour\": false,\n  \"client\": {\n    \"logging\": \"info\",\n    \"overlay\": true,\n    \"reconnect\": 10,\n    \"webSocketURL\": {},\n  },\n  \"compress\": true,\n  \"devMiddleware\": {},\n  \"historyApiFallback\": false,\n  \"host\": undefined,\n  \"hot\": true,\n  \"liveReload\": true,\n  \"open\": [],\n  \"port\": \"<auto>\",\n  \"server\": {\n    \"options\": {},\n    \"type\": \"http\",\n  },\n  \"setupExitSignals\": true,\n  \"static\": [\n    {\n      \"directory\": \"/static/path\",\n      \"publicPath\": [\n        \"/\",\n      ],\n      \"serveIndex\": {\n        \"icons\": true,\n      },\n      \"staticOptions\": {\n        \"immutable\": true,\n        \"redirect\": true,\n      },\n      \"watch\": {\n        \"alwaysStat\": true,\n        \"atomic\": false,\n        \"followSymlinks\": false,\n        \"ignoreInitial\": true,\n        \"ignorePermissionErrors\": true,\n        \"ignored\": undefined,\n        \"interval\": undefined,\n        \"persistent\": true,\n        \"usePolling\": false,\n      },\n    },\n  ],\n  \"watchFiles\": [],\n  \"webSocketServer\": {\n    \"options\": {\n      \"path\": \"/ws\",\n    },\n    \"type\": \"ws\",\n  },\n}\n`;\n\nexports[`normalize options static is false 1`] = `\n{\n  \"allowedHosts\": \"auto\",\n  \"bonjour\": false,\n  \"client\": {\n    \"logging\": \"info\",\n    \"overlay\": true,\n    \"reconnect\": 10,\n    \"webSocketURL\": {},\n  },\n  \"compress\": true,\n  \"devMiddleware\": {},\n  \"historyApiFallback\": false,\n  \"host\": undefined,\n  \"hot\": true,\n  \"liveReload\": true,\n  \"open\": [],\n  \"port\": \"<auto>\",\n  \"server\": {\n    \"options\": {},\n    \"type\": \"http\",\n  },\n  \"setupExitSignals\": true,\n  \"static\": false,\n  \"watchFiles\": [],\n  \"webSocketServer\": {\n    \"options\": {\n      \"path\": \"/ws\",\n    },\n    \"type\": \"ws\",\n  },\n}\n`;\n\nexports[`normalize options static is string 1`] = `\n{\n  \"allowedHosts\": \"auto\",\n  \"bonjour\": false,\n  \"client\": {\n    \"logging\": \"info\",\n    \"overlay\": true,\n    \"reconnect\": 10,\n    \"webSocketURL\": {},\n  },\n  \"compress\": true,\n  \"devMiddleware\": {},\n  \"historyApiFallback\": false,\n  \"host\": undefined,\n  \"hot\": true,\n  \"liveReload\": true,\n  \"open\": [],\n  \"port\": \"<auto>\",\n  \"server\": {\n    \"options\": {},\n    \"type\": \"http\",\n  },\n  \"setupExitSignals\": true,\n  \"static\": [\n    {\n      \"directory\": \"/static/path\",\n      \"publicPath\": [\n        \"/\",\n      ],\n      \"serveIndex\": {\n        \"icons\": true,\n      },\n      \"staticOptions\": {},\n      \"watch\": {\n        \"alwaysStat\": true,\n        \"atomic\": false,\n        \"followSymlinks\": false,\n        \"ignoreInitial\": true,\n        \"ignorePermissionErrors\": true,\n        \"ignored\": undefined,\n        \"interval\": undefined,\n        \"persistent\": true,\n        \"usePolling\": false,\n      },\n    },\n  ],\n  \"watchFiles\": [],\n  \"webSocketServer\": {\n    \"options\": {\n      \"path\": \"/ws\",\n    },\n    \"type\": \"ws\",\n  },\n}\n`;\n\nexports[`normalize options static is true 1`] = `\n{\n  \"allowedHosts\": \"auto\",\n  \"bonjour\": false,\n  \"client\": {\n    \"logging\": \"info\",\n    \"overlay\": true,\n    \"reconnect\": 10,\n    \"webSocketURL\": {},\n  },\n  \"compress\": true,\n  \"devMiddleware\": {},\n  \"historyApiFallback\": false,\n  \"host\": undefined,\n  \"hot\": true,\n  \"liveReload\": true,\n  \"open\": [],\n  \"port\": \"<auto>\",\n  \"server\": {\n    \"options\": {},\n    \"type\": \"http\",\n  },\n  \"setupExitSignals\": true,\n  \"static\": [\n    {\n      \"directory\": \"<cwd>/public\",\n      \"publicPath\": [\n        \"/\",\n      ],\n      \"serveIndex\": {\n        \"icons\": true,\n      },\n      \"staticOptions\": {},\n      \"watch\": {\n        \"alwaysStat\": true,\n        \"atomic\": false,\n        \"followSymlinks\": false,\n        \"ignoreInitial\": true,\n        \"ignorePermissionErrors\": true,\n        \"ignored\": undefined,\n        \"interval\": undefined,\n        \"persistent\": true,\n        \"usePolling\": false,\n      },\n    },\n  ],\n  \"watchFiles\": [],\n  \"webSocketServer\": {\n    \"options\": {\n      \"path\": \"/ws\",\n    },\n    \"type\": \"ws\",\n  },\n}\n`;\n\nexports[`normalize options static publicPath is a string 1`] = `\n{\n  \"allowedHosts\": \"auto\",\n  \"bonjour\": false,\n  \"client\": {\n    \"logging\": \"info\",\n    \"overlay\": true,\n    \"reconnect\": 10,\n    \"webSocketURL\": {},\n  },\n  \"compress\": true,\n  \"devMiddleware\": {},\n  \"historyApiFallback\": false,\n  \"host\": undefined,\n  \"hot\": true,\n  \"liveReload\": true,\n  \"open\": [],\n  \"port\": \"<auto>\",\n  \"server\": {\n    \"options\": {},\n    \"type\": \"http\",\n  },\n  \"setupExitSignals\": true,\n  \"static\": [\n    {\n      \"directory\": \"<cwd>/public\",\n      \"publicPath\": [\n        \"/static/public/path/\",\n      ],\n      \"serveIndex\": {\n        \"icons\": true,\n      },\n      \"staticOptions\": {},\n      \"watch\": {\n        \"alwaysStat\": true,\n        \"atomic\": false,\n        \"followSymlinks\": false,\n        \"ignoreInitial\": true,\n        \"ignorePermissionErrors\": true,\n        \"ignored\": undefined,\n        \"interval\": undefined,\n        \"persistent\": true,\n        \"usePolling\": false,\n      },\n    },\n  ],\n  \"watchFiles\": [],\n  \"webSocketServer\": {\n    \"options\": {\n      \"path\": \"/ws\",\n    },\n    \"type\": \"ws\",\n  },\n}\n`;\n\nexports[`normalize options static publicPath is an array 1`] = `\n{\n  \"allowedHosts\": \"auto\",\n  \"bonjour\": false,\n  \"client\": {\n    \"logging\": \"info\",\n    \"overlay\": true,\n    \"reconnect\": 10,\n    \"webSocketURL\": {},\n  },\n  \"compress\": true,\n  \"devMiddleware\": {},\n  \"historyApiFallback\": false,\n  \"host\": undefined,\n  \"hot\": true,\n  \"liveReload\": true,\n  \"open\": [],\n  \"port\": \"<auto>\",\n  \"server\": {\n    \"options\": {},\n    \"type\": \"http\",\n  },\n  \"setupExitSignals\": true,\n  \"static\": [\n    {\n      \"directory\": \"<cwd>/public\",\n      \"publicPath\": [\n        \"/static/public/path1/\",\n        \"/static/public/path2/\",\n      ],\n      \"serveIndex\": {\n        \"icons\": true,\n      },\n      \"staticOptions\": {},\n      \"watch\": {\n        \"alwaysStat\": true,\n        \"atomic\": false,\n        \"followSymlinks\": false,\n        \"ignoreInitial\": true,\n        \"ignorePermissionErrors\": true,\n        \"ignored\": undefined,\n        \"interval\": undefined,\n        \"persistent\": true,\n        \"usePolling\": false,\n      },\n    },\n  ],\n  \"watchFiles\": [],\n  \"webSocketServer\": {\n    \"options\": {\n      \"path\": \"/ws\",\n    },\n    \"type\": \"ws\",\n  },\n}\n`;\n\nexports[`normalize options static serveIndex is an object more options 1`] = `\n{\n  \"allowedHosts\": \"auto\",\n  \"bonjour\": false,\n  \"client\": {\n    \"logging\": \"info\",\n    \"overlay\": true,\n    \"reconnect\": 10,\n    \"webSocketURL\": {},\n  },\n  \"compress\": true,\n  \"devMiddleware\": {},\n  \"historyApiFallback\": false,\n  \"host\": undefined,\n  \"hot\": true,\n  \"liveReload\": true,\n  \"open\": [],\n  \"port\": \"<auto>\",\n  \"server\": {\n    \"options\": {},\n    \"type\": \"http\",\n  },\n  \"setupExitSignals\": true,\n  \"static\": [\n    {\n      \"directory\": \"<cwd>/public\",\n      \"publicPath\": [\n        \"/\",\n      ],\n      \"serveIndex\": {\n        \"hidden\": true,\n        \"icons\": true,\n        \"stylesheet\": \"https://example.com/style.css\",\n        \"view\": \"details\",\n      },\n      \"staticOptions\": {},\n      \"watch\": {\n        \"alwaysStat\": true,\n        \"atomic\": false,\n        \"followSymlinks\": false,\n        \"ignoreInitial\": true,\n        \"ignorePermissionErrors\": true,\n        \"ignored\": undefined,\n        \"interval\": undefined,\n        \"persistent\": true,\n        \"usePolling\": false,\n      },\n    },\n  ],\n  \"watchFiles\": [],\n  \"webSocketServer\": {\n    \"options\": {\n      \"path\": \"/ws\",\n    },\n    \"type\": \"ws\",\n  },\n}\n`;\n\nexports[`normalize options static serveIndex is an object with icons false 1`] = `\n{\n  \"allowedHosts\": \"auto\",\n  \"bonjour\": false,\n  \"client\": {\n    \"logging\": \"info\",\n    \"overlay\": true,\n    \"reconnect\": 10,\n    \"webSocketURL\": {},\n  },\n  \"compress\": true,\n  \"devMiddleware\": {},\n  \"historyApiFallback\": false,\n  \"host\": undefined,\n  \"hot\": true,\n  \"liveReload\": true,\n  \"open\": [],\n  \"port\": \"<auto>\",\n  \"server\": {\n    \"options\": {},\n    \"type\": \"http\",\n  },\n  \"setupExitSignals\": true,\n  \"static\": [\n    {\n      \"directory\": \"<cwd>/public\",\n      \"publicPath\": [\n        \"/\",\n      ],\n      \"serveIndex\": {\n        \"icons\": false,\n      },\n      \"staticOptions\": {},\n      \"watch\": {\n        \"alwaysStat\": true,\n        \"atomic\": false,\n        \"followSymlinks\": false,\n        \"ignoreInitial\": true,\n        \"ignorePermissionErrors\": true,\n        \"ignored\": undefined,\n        \"interval\": undefined,\n        \"persistent\": true,\n        \"usePolling\": false,\n      },\n    },\n  ],\n  \"watchFiles\": [],\n  \"webSocketServer\": {\n    \"options\": {\n      \"path\": \"/ws\",\n    },\n    \"type\": \"ws\",\n  },\n}\n`;\n\nexports[`normalize options static serveIndex is false 1`] = `\n{\n  \"allowedHosts\": \"auto\",\n  \"bonjour\": false,\n  \"client\": {\n    \"logging\": \"info\",\n    \"overlay\": true,\n    \"reconnect\": 10,\n    \"webSocketURL\": {},\n  },\n  \"compress\": true,\n  \"devMiddleware\": {},\n  \"historyApiFallback\": false,\n  \"host\": undefined,\n  \"hot\": true,\n  \"liveReload\": true,\n  \"open\": [],\n  \"port\": \"<auto>\",\n  \"server\": {\n    \"options\": {},\n    \"type\": \"http\",\n  },\n  \"setupExitSignals\": true,\n  \"static\": [\n    {\n      \"directory\": \"<cwd>/public\",\n      \"publicPath\": [\n        \"/\",\n      ],\n      \"serveIndex\": false,\n      \"staticOptions\": {},\n      \"watch\": {\n        \"alwaysStat\": true,\n        \"atomic\": false,\n        \"followSymlinks\": false,\n        \"ignoreInitial\": true,\n        \"ignorePermissionErrors\": true,\n        \"ignored\": undefined,\n        \"interval\": undefined,\n        \"persistent\": true,\n        \"usePolling\": false,\n      },\n    },\n  ],\n  \"watchFiles\": [],\n  \"webSocketServer\": {\n    \"options\": {\n      \"path\": \"/ws\",\n    },\n    \"type\": \"ws\",\n  },\n}\n`;\n\nexports[`normalize options static serveIndex is true 1`] = `\n{\n  \"allowedHosts\": \"auto\",\n  \"bonjour\": false,\n  \"client\": {\n    \"logging\": \"info\",\n    \"overlay\": true,\n    \"reconnect\": 10,\n    \"webSocketURL\": {},\n  },\n  \"compress\": true,\n  \"devMiddleware\": {},\n  \"historyApiFallback\": false,\n  \"host\": undefined,\n  \"hot\": true,\n  \"liveReload\": true,\n  \"open\": [],\n  \"port\": \"<auto>\",\n  \"server\": {\n    \"options\": {},\n    \"type\": \"http\",\n  },\n  \"setupExitSignals\": true,\n  \"static\": [\n    {\n      \"directory\": \"<cwd>/public\",\n      \"publicPath\": [\n        \"/\",\n      ],\n      \"serveIndex\": {\n        \"icons\": true,\n      },\n      \"staticOptions\": {},\n      \"watch\": {\n        \"alwaysStat\": true,\n        \"atomic\": false,\n        \"followSymlinks\": false,\n        \"ignoreInitial\": true,\n        \"ignorePermissionErrors\": true,\n        \"ignored\": undefined,\n        \"interval\": undefined,\n        \"persistent\": true,\n        \"usePolling\": false,\n      },\n    },\n  ],\n  \"watchFiles\": [],\n  \"webSocketServer\": {\n    \"options\": {\n      \"path\": \"/ws\",\n    },\n    \"type\": \"ws\",\n  },\n}\n`;\n\nexports[`normalize options static watch is an object 1`] = `\n{\n  \"allowedHosts\": \"auto\",\n  \"bonjour\": false,\n  \"client\": {\n    \"logging\": \"info\",\n    \"overlay\": true,\n    \"reconnect\": 10,\n    \"webSocketURL\": {},\n  },\n  \"compress\": true,\n  \"devMiddleware\": {},\n  \"historyApiFallback\": false,\n  \"host\": undefined,\n  \"hot\": true,\n  \"liveReload\": true,\n  \"open\": [],\n  \"port\": \"<auto>\",\n  \"server\": {\n    \"options\": {},\n    \"type\": \"http\",\n  },\n  \"setupExitSignals\": true,\n  \"static\": [\n    {\n      \"directory\": \"<cwd>/public\",\n      \"publicPath\": [\n        \"/\",\n      ],\n      \"serveIndex\": {\n        \"icons\": true,\n      },\n      \"staticOptions\": {},\n      \"watch\": {\n        \"alwaysStat\": true,\n        \"atomic\": false,\n        \"followSymlinks\": false,\n        \"ignoreInitial\": true,\n        \"ignorePermissionErrors\": true,\n        \"ignored\": undefined,\n        \"interval\": 500,\n        \"persistent\": true,\n        \"usePolling\": true,\n      },\n    },\n  ],\n  \"watchFiles\": [],\n  \"webSocketServer\": {\n    \"options\": {\n      \"path\": \"/ws\",\n    },\n    \"type\": \"ws\",\n  },\n}\n`;\n\nexports[`normalize options static watch is false 1`] = `\n{\n  \"allowedHosts\": \"auto\",\n  \"bonjour\": false,\n  \"client\": {\n    \"logging\": \"info\",\n    \"overlay\": true,\n    \"reconnect\": 10,\n    \"webSocketURL\": {},\n  },\n  \"compress\": true,\n  \"devMiddleware\": {},\n  \"historyApiFallback\": false,\n  \"host\": undefined,\n  \"hot\": true,\n  \"liveReload\": true,\n  \"open\": [],\n  \"port\": \"<auto>\",\n  \"server\": {\n    \"options\": {},\n    \"type\": \"http\",\n  },\n  \"setupExitSignals\": true,\n  \"static\": [\n    {\n      \"directory\": \"<cwd>/public\",\n      \"publicPath\": [\n        \"/\",\n      ],\n      \"serveIndex\": {\n        \"icons\": true,\n      },\n      \"staticOptions\": {},\n      \"watch\": false,\n    },\n  ],\n  \"watchFiles\": [],\n  \"webSocketServer\": {\n    \"options\": {\n      \"path\": \"/ws\",\n    },\n    \"type\": \"ws\",\n  },\n}\n`;\n\nexports[`normalize options static watch is true 1`] = `\n{\n  \"allowedHosts\": \"auto\",\n  \"bonjour\": false,\n  \"client\": {\n    \"logging\": \"info\",\n    \"overlay\": true,\n    \"reconnect\": 10,\n    \"webSocketURL\": {},\n  },\n  \"compress\": true,\n  \"devMiddleware\": {},\n  \"historyApiFallback\": false,\n  \"host\": undefined,\n  \"hot\": true,\n  \"liveReload\": true,\n  \"open\": [],\n  \"port\": \"<auto>\",\n  \"server\": {\n    \"options\": {},\n    \"type\": \"http\",\n  },\n  \"setupExitSignals\": true,\n  \"static\": [\n    {\n      \"directory\": \"<cwd>/public\",\n      \"publicPath\": [\n        \"/\",\n      ],\n      \"serveIndex\": {\n        \"icons\": true,\n      },\n      \"staticOptions\": {},\n      \"watch\": {\n        \"alwaysStat\": true,\n        \"atomic\": false,\n        \"followSymlinks\": false,\n        \"ignoreInitial\": true,\n        \"ignorePermissionErrors\": true,\n        \"ignored\": undefined,\n        \"interval\": undefined,\n        \"persistent\": true,\n        \"usePolling\": false,\n      },\n    },\n  ],\n  \"watchFiles\": [],\n  \"webSocketServer\": {\n    \"options\": {\n      \"path\": \"/ws\",\n    },\n    \"type\": \"ws\",\n  },\n}\n`;\n\nexports[`normalize options username and password 1`] = `\n{\n  \"allowedHosts\": \"auto\",\n  \"bonjour\": false,\n  \"client\": {\n    \"logging\": \"info\",\n    \"overlay\": true,\n    \"reconnect\": 10,\n    \"webSocketURL\": {\n      \"password\": \"chuntaro\",\n      \"username\": \"zenitsu\",\n    },\n  },\n  \"compress\": true,\n  \"devMiddleware\": {},\n  \"historyApiFallback\": false,\n  \"host\": undefined,\n  \"hot\": true,\n  \"liveReload\": true,\n  \"open\": [],\n  \"port\": \"<auto>\",\n  \"server\": {\n    \"options\": {},\n    \"type\": \"http\",\n  },\n  \"setupExitSignals\": true,\n  \"static\": [\n    {\n      \"directory\": \"<cwd>/public\",\n      \"publicPath\": [\n        \"/\",\n      ],\n      \"serveIndex\": {\n        \"icons\": true,\n      },\n      \"staticOptions\": {},\n      \"watch\": {\n        \"alwaysStat\": true,\n        \"atomic\": false,\n        \"followSymlinks\": false,\n        \"ignoreInitial\": true,\n        \"ignorePermissionErrors\": true,\n        \"ignored\": undefined,\n        \"interval\": undefined,\n        \"persistent\": true,\n        \"usePolling\": false,\n      },\n    },\n  ],\n  \"watchFiles\": [],\n  \"webSocketServer\": {\n    \"options\": {\n      \"path\": \"/ws\",\n    },\n    \"type\": \"ws\",\n  },\n}\n`;\n\nexports[`normalize options webSocketServer custom server class 1`] = `\n{\n  \"allowedHosts\": \"auto\",\n  \"bonjour\": false,\n  \"client\": {\n    \"logging\": \"info\",\n    \"overlay\": true,\n    \"reconnect\": 10,\n    \"webSocketURL\": {},\n  },\n  \"compress\": true,\n  \"devMiddleware\": {},\n  \"historyApiFallback\": false,\n  \"host\": undefined,\n  \"hot\": true,\n  \"liveReload\": true,\n  \"open\": [],\n  \"port\": \"<auto>\",\n  \"server\": {\n    \"options\": {},\n    \"type\": \"http\",\n  },\n  \"setupExitSignals\": true,\n  \"static\": [\n    {\n      \"directory\": \"<cwd>/public\",\n      \"publicPath\": [\n        \"/\",\n      ],\n      \"serveIndex\": {\n        \"icons\": true,\n      },\n      \"staticOptions\": {},\n      \"watch\": {\n        \"alwaysStat\": true,\n        \"atomic\": false,\n        \"followSymlinks\": false,\n        \"ignoreInitial\": true,\n        \"ignorePermissionErrors\": true,\n        \"ignored\": undefined,\n        \"interval\": undefined,\n        \"persistent\": true,\n        \"usePolling\": false,\n      },\n    },\n  ],\n  \"watchFiles\": [],\n  \"webSocketServer\": {\n    \"options\": {\n      \"path\": \"/ws\",\n    },\n    \"type\": [Function],\n  },\n}\n`;\n\nexports[`normalize options webSocketServer custom server path 1`] = `\n{\n  \"allowedHosts\": \"auto\",\n  \"bonjour\": false,\n  \"client\": {\n    \"logging\": \"info\",\n    \"overlay\": true,\n    \"reconnect\": 10,\n    \"webSocketURL\": {},\n  },\n  \"compress\": true,\n  \"devMiddleware\": {},\n  \"historyApiFallback\": false,\n  \"host\": undefined,\n  \"hot\": true,\n  \"liveReload\": true,\n  \"open\": [],\n  \"port\": \"<auto>\",\n  \"server\": {\n    \"options\": {},\n    \"type\": \"http\",\n  },\n  \"setupExitSignals\": true,\n  \"static\": [\n    {\n      \"directory\": \"<cwd>/public\",\n      \"publicPath\": [\n        \"/\",\n      ],\n      \"serveIndex\": {\n        \"icons\": true,\n      },\n      \"staticOptions\": {},\n      \"watch\": {\n        \"alwaysStat\": true,\n        \"atomic\": false,\n        \"followSymlinks\": false,\n        \"ignoreInitial\": true,\n        \"ignorePermissionErrors\": true,\n        \"ignored\": undefined,\n        \"interval\": undefined,\n        \"persistent\": true,\n        \"usePolling\": false,\n      },\n    },\n  ],\n  \"watchFiles\": [],\n  \"webSocketServer\": {\n    \"options\": {\n      \"path\": \"/ws\",\n    },\n    \"type\": \"/path/to/custom/server/\",\n  },\n}\n`;\n"
  },
  {
    "path": "test/__snapshots__/validate-options.test.js.snap.webpack5",
    "content": "// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing\n\nexports[`options validate should throw an error on the \"allowedHosts\" option with '[\"\"]' value 1`] = `\n\"ValidationError: Invalid options object. Dev Server has been initialized using an options object that does not match the API schema.\n - options.allowedHosts[0] should be a non-empty string.\"\n`;\n\nexports[`options validate should throw an error on the \"allowedHosts\" option with '[]' value 1`] = `\n\"ValidationError: Invalid options object. Dev Server has been initialized using an options object that does not match the API schema.\n - options.allowedHosts should be a non-empty array.\"\n`;\n\nexports[`options validate should throw an error on the \"allowedHosts\" option with '123' value 1`] = `\n\"ValidationError: Invalid options object. Dev Server has been initialized using an options object that does not match the API schema.\n - options.allowedHosts should be one of these:\n   [non-empty string, ...] (should not have fewer than 1 item) | \"auto\" | \"all\" | non-empty string\n   -> Allows to enumerate the hosts from which access to the dev server are allowed (useful when you are proxying dev server, by default is 'auto').\n   -> Read more at https://webpack.js.org/configuration/dev-server/#devserverallowedhosts\n   Details:\n    * options.allowedHosts should be an array:\n      [non-empty string, ...] (should not have fewer than 1 item)\n    * options.allowedHosts should be one of these:\n      \"auto\" | \"all\"\n    * options.allowedHosts should be a non-empty string.\"\n`;\n\nexports[`options validate should throw an error on the \"allowedHosts\" option with 'false' value 1`] = `\n\"ValidationError: Invalid options object. Dev Server has been initialized using an options object that does not match the API schema.\n - options.allowedHosts should be one of these:\n   [non-empty string, ...] (should not have fewer than 1 item) | \"auto\" | \"all\" | non-empty string\n   -> Allows to enumerate the hosts from which access to the dev server are allowed (useful when you are proxying dev server, by default is 'auto').\n   -> Read more at https://webpack.js.org/configuration/dev-server/#devserverallowedhosts\n   Details:\n    * options.allowedHosts should be an array:\n      [non-empty string, ...] (should not have fewer than 1 item)\n    * options.allowedHosts should be one of these:\n      \"auto\" | \"all\"\n    * options.allowedHosts should be a non-empty string.\"\n`;\n\nexports[`options validate should throw an error on the \"allowedHosts\" option with 'true' value 1`] = `\n\"ValidationError: Invalid options object. Dev Server has been initialized using an options object that does not match the API schema.\n - options.allowedHosts should be one of these:\n   [non-empty string, ...] (should not have fewer than 1 item) | \"auto\" | \"all\" | non-empty string\n   -> Allows to enumerate the hosts from which access to the dev server are allowed (useful when you are proxying dev server, by default is 'auto').\n   -> Read more at https://webpack.js.org/configuration/dev-server/#devserverallowedhosts\n   Details:\n    * options.allowedHosts should be an array:\n      [non-empty string, ...] (should not have fewer than 1 item)\n    * options.allowedHosts should be one of these:\n      \"auto\" | \"all\"\n    * options.allowedHosts should be a non-empty string.\"\n`;\n\nexports[`options validate should throw an error on the \"app\" option with 'false' value 1`] = `\n\"ValidationError: Invalid options object. Dev Server has been initialized using an options object that does not match the API schema.\n - options.app should be an instance of function.\n   -> Allows to use custom applications, such as 'connect', 'fastify', etc.\n   -> Read more at https://webpack.js.org/configuration/dev-server/#devserverapp\"\n`;\n\nexports[`options validate should throw an error on the \"app\" option with 'test' value 1`] = `\n\"ValidationError: Invalid options object. Dev Server has been initialized using an options object that does not match the API schema.\n - options.app should be an instance of function.\n   -> Allows to use custom applications, such as 'connect', 'fastify', etc.\n   -> Read more at https://webpack.js.org/configuration/dev-server/#devserverapp\"\n`;\n\nexports[`options validate should throw an error on the \"bonjour\" option with '' value 1`] = `\n\"ValidationError: Invalid options object. Dev Server has been initialized using an options object that does not match the API schema.\n - options.bonjour should be one of these:\n   boolean | object { … }\n   -> Allows to broadcasts dev server via ZeroConf networking on start.\n   -> Read more at  https://webpack.js.org/configuration/dev-server/#devserverbonjour\n   Details:\n    * options.bonjour should be a boolean.\n    * options.bonjour should be an object:\n      object { … }\n      -> Options for bonjour.\n      -> Read more at https://github.com/watson/bonjour#initializing\"\n`;\n\nexports[`options validate should throw an error on the \"client\" option with '{\"logging\":\"silent\"}' value 1`] = `\n\"ValidationError: Invalid options object. Dev Server has been initialized using an options object that does not match the API schema.\n - options.client.logging should be one of these:\n   \"none\" | \"error\" | \"warn\" | \"info\" | \"log\" | \"verbose\"\n   -> Allows to set log level in the browser.\n   -> Read more at https://webpack.js.org/configuration/dev-server/#logging\"\n`;\n\nexports[`options validate should throw an error on the \"client\" option with '{\"logging\":\"whoops!\"}' value 1`] = `\n\"ValidationError: Invalid options object. Dev Server has been initialized using an options object that does not match the API schema.\n - options.client.logging should be one of these:\n   \"none\" | \"error\" | \"warn\" | \"info\" | \"log\" | \"verbose\"\n   -> Allows to set log level in the browser.\n   -> Read more at https://webpack.js.org/configuration/dev-server/#logging\"\n`;\n\nexports[`options validate should throw an error on the \"client\" option with '{\"overlay\":\"\"}' value 1`] = `\n\"ValidationError: Invalid options object. Dev Server has been initialized using an options object that does not match the API schema.\n - options.client should be one of these:\n   false | object { logging?, overlay?, progress?, reconnect?, webSocketTransport?, webSocketURL? }\n   -> Allows to specify options for client script in the browser or disable client script.\n   -> Read more at https://webpack.js.org/configuration/dev-server/#devserverclient\n   Details:\n    * options.client.overlay should be one of these:\n      boolean | object { errors?, warnings?, runtimeErrors?, trustedTypesPolicyName? }\n      Details:\n       * options.client.overlay should be a boolean.\n         -> Enables a full-screen overlay in the browser when there are compiler errors or warnings.\n         -> Read more at https://webpack.js.org/configuration/dev-server/#overlay\n       * options.client.overlay should be an object:\n         object { errors?, warnings?, runtimeErrors?, trustedTypesPolicyName? }\"\n`;\n\nexports[`options validate should throw an error on the \"client\" option with '{\"overlay\":{\"arbitrary\":\"\"}}' value 1`] = `\n\"ValidationError: Invalid options object. Dev Server has been initialized using an options object that does not match the API schema.\n - options.client.overlay has an unknown property 'arbitrary'. These properties are valid:\n   object { errors?, warnings?, runtimeErrors?, trustedTypesPolicyName? }\"\n`;\n\nexports[`options validate should throw an error on the \"client\" option with '{\"overlay\":{\"errors\":\"\"}}' value 1`] = `\n\"ValidationError: Invalid options object. Dev Server has been initialized using an options object that does not match the API schema.\n - options.client should be one of these:\n   false | object { logging?, overlay?, progress?, reconnect?, webSocketTransport?, webSocketURL? }\n   -> Allows to specify options for client script in the browser or disable client script.\n   -> Read more at https://webpack.js.org/configuration/dev-server/#devserverclient\n   Details:\n    * options.client.overlay.errors should be one of these:\n      boolean | function\n      Details:\n       * options.client.overlay.errors should be a boolean.\n         -> Enables a full-screen overlay in the browser when there are compiler errors.\n       * options.client.overlay.errors should be an instance of function.\n         -> Filter compiler errors. Return true to include and return false to exclude.\"\n`;\n\nexports[`options validate should throw an error on the \"client\" option with '{\"overlay\":{\"warnings\":\"\"}}' value 1`] = `\n\"ValidationError: Invalid options object. Dev Server has been initialized using an options object that does not match the API schema.\n - options.client should be one of these:\n   false | object { logging?, overlay?, progress?, reconnect?, webSocketTransport?, webSocketURL? }\n   -> Allows to specify options for client script in the browser or disable client script.\n   -> Read more at https://webpack.js.org/configuration/dev-server/#devserverclient\n   Details:\n    * options.client.overlay.warnings should be one of these:\n      boolean | function\n      Details:\n       * options.client.overlay.warnings should be a boolean.\n         -> Enables a full-screen overlay in the browser when there are compiler warnings.\n       * options.client.overlay.warnings should be an instance of function.\n         -> Filter compiler warnings. Return true to include and return false to exclude.\"\n`;\n\nexports[`options validate should throw an error on the \"client\" option with '{\"progress\":\"\"}' value 1`] = `\n\"ValidationError: Invalid options object. Dev Server has been initialized using an options object that does not match the API schema.\n - options.client.progress should be one of these:\n   true | false | \"linear\" | \"circular\"\n   -> Displays compilation progress in the browser. Options include 'linear' and 'circular' for visual indicators.\n   -> Read more at https://webpack.js.org/configuration/dev-server/#progress\"\n`;\n\nexports[`options validate should throw an error on the \"client\" option with '{\"reconnect\":\"\"}' value 1`] = `\n\"ValidationError: Invalid options object. Dev Server has been initialized using an options object that does not match the API schema.\n - options.client should be one of these:\n   false | object { logging?, overlay?, progress?, reconnect?, webSocketTransport?, webSocketURL? }\n   -> Allows to specify options for client script in the browser or disable client script.\n   -> Read more at https://webpack.js.org/configuration/dev-server/#devserverclient\n   Details:\n    * options.client.reconnect should be one of these:\n      boolean | number (should be >= 0)\n      -> Tells dev-server the number of times it should try to reconnect the client.\n      -> Read more at https://webpack.js.org/configuration/dev-server/#reconnect\n      Details:\n       * options.client.reconnect should be a boolean.\n       * options.client.reconnect should be a number (should be >= 0).\"\n`;\n\nexports[`options validate should throw an error on the \"client\" option with '{\"unknownOption\":true}' value 1`] = `\n\"ValidationError: Invalid options object. Dev Server has been initialized using an options object that does not match the API schema.\n - options.client has an unknown property 'unknownOption'. These properties are valid:\n   object { logging?, overlay?, progress?, reconnect?, webSocketTransport?, webSocketURL? }\"\n`;\n\nexports[`options validate should throw an error on the \"client\" option with '{\"webSocketTransport\":true}' value 1`] = `\n\"ValidationError: Invalid options object. Dev Server has been initialized using an options object that does not match the API schema.\n - options.client should be one of these:\n   false | object { logging?, overlay?, progress?, reconnect?, webSocketTransport?, webSocketURL? }\n   -> Allows to specify options for client script in the browser or disable client script.\n   -> Read more at https://webpack.js.org/configuration/dev-server/#devserverclient\n   Details:\n    * options.client.webSocketTransport should be one of these:\n      \"sockjs\" | \"ws\" | non-empty string\n      -> Allows to set custom web socket transport to communicate with dev server.\n      -> Read more at https://webpack.js.org/configuration/dev-server/#websockettransport\n      Details:\n       * options.client.webSocketTransport should be one of these:\n         \"sockjs\" | \"ws\"\n       * options.client.webSocketTransport should be a non-empty string.\"\n`;\n\nexports[`options validate should throw an error on the \"client\" option with '{\"webSocketURL\":{\"hostname\":\"\"}}' value 1`] = `\n\"ValidationError: Invalid options object. Dev Server has been initialized using an options object that does not match the API schema.\n - options.client.webSocketURL.hostname should be a non-empty string.\n   -> Tells clients connected to devServer to use the provided hostname.\"\n`;\n\nexports[`options validate should throw an error on the \"client\" option with '{\"webSocketURL\":{\"hostname\":true,\"pathname\":\"\",\"port\":8080}}' value 1`] = `\n\"ValidationError: Invalid options object. Dev Server has been initialized using an options object that does not match the API schema.\n - options.client.webSocketURL.hostname should be a non-empty string.\n   -> Tells clients connected to devServer to use the provided hostname.\"\n`;\n\nexports[`options validate should throw an error on the \"client\" option with '{\"webSocketURL\":{\"pathname\":true}}' value 1`] = `\n\"ValidationError: Invalid options object. Dev Server has been initialized using an options object that does not match the API schema.\n - options.client.webSocketURL.pathname should be a string.\n   -> Tells clients connected to devServer to use the provided path to connect.\"\n`;\n\nexports[`options validate should throw an error on the \"client\" option with '{\"webSocketURL\":{\"port\":\"\"}}' value 1`] = `\n\"ValidationError: Invalid options object. Dev Server has been initialized using an options object that does not match the API schema.\n - options.client.webSocketURL.port should be a non-empty string.\"\n`;\n\nexports[`options validate should throw an error on the \"client\" option with '{\"webSocketURL\":{\"port\":true}}' value 1`] = `\n\"ValidationError: Invalid options object. Dev Server has been initialized using an options object that does not match the API schema.\n - options.client should be one of these:\n   false | object { logging?, overlay?, progress?, reconnect?, webSocketTransport?, webSocketURL? }\n   -> Allows to specify options for client script in the browser or disable client script.\n   -> Read more at https://webpack.js.org/configuration/dev-server/#devserverclient\n   Details:\n    * options.client.webSocketURL.port should be one of these:\n      number | non-empty string\n      -> Tells clients connected to devServer to use the provided port.\n      Details:\n       * options.client.webSocketURL.port should be a number.\n       * options.client.webSocketURL.port should be a non-empty string.\"\n`;\n\nexports[`options validate should throw an error on the \"client\" option with '{\"webSocketURL\":{\"username\":123,\"password\":976}}' value 1`] = `\n\"ValidationError: Invalid options object. Dev Server has been initialized using an options object that does not match the API schema.\n - options.client should be one of these:\n   false | object { logging?, overlay?, progress?, reconnect?, webSocketTransport?, webSocketURL? }\n   -> Allows to specify options for client script in the browser or disable client script.\n   -> Read more at https://webpack.js.org/configuration/dev-server/#devserverclient\n   Details:\n    * options.client.webSocketURL.password should be a string.\n      -> Tells clients connected to devServer to use the provided password to authenticate.\n    * options.client.webSocketURL.username should be a string.\n      -> Tells clients connected to devServer to use the provided username to authenticate.\"\n`;\n\nexports[`options validate should throw an error on the \"client\" option with 'whoops!' value 1`] = `\n\"ValidationError: Invalid options object. Dev Server has been initialized using an options object that does not match the API schema.\n - options.client should be one of these:\n   false | object { logging?, overlay?, progress?, reconnect?, webSocketTransport?, webSocketURL? }\n   -> Allows to specify options for client script in the browser or disable client script.\n   -> Read more at https://webpack.js.org/configuration/dev-server/#devserverclient\n   Details:\n    * options.client should be false.\n    * options.client should be an object:\n      object { logging?, overlay?, progress?, reconnect?, webSocketTransport?, webSocketURL? }\"\n`;\n\nexports[`options validate should throw an error on the \"compress\" option with '' value 1`] = `\n\"ValidationError: Invalid options object. Dev Server has been initialized using an options object that does not match the API schema.\n - options.compress should be a boolean.\n   -> Enables gzip compression for everything served.\n   -> Read more at https://webpack.js.org/configuration/dev-server/#devservercompress\"\n`;\n\nexports[`options validate should throw an error on the \"devMiddleware\" option with '' value 1`] = `\n\"ValidationError: Invalid options object. Dev Server has been initialized using an options object that does not match the API schema.\n - options.devMiddleware should be an object:\n   object { … }\n   -> Provide options to 'webpack-dev-middleware' which handles webpack assets.\n   -> Read more at https://webpack.js.org/configuration/dev-server/#devserverdevmiddleware\"\n`;\n\nexports[`options validate should throw an error on the \"headers\" option with '[]' value 1`] = `\n\"ValidationError: Invalid options object. Dev Server has been initialized using an options object that does not match the API schema.\n - options.headers should be a non-empty array.\"\n`;\n\nexports[`options validate should throw an error on the \"headers\" option with '[{\"foo\":\"bar\"}]' value 1`] = `\n\"ValidationError: Invalid options object. Dev Server has been initialized using an options object that does not match the API schema.\n - options.headers[0] has an unknown property 'foo'. These properties are valid:\n   object { key?, value? }\"\n`;\n\nexports[`options validate should throw an error on the \"headers\" option with '1' value 1`] = `\n\"ValidationError: Invalid options object. Dev Server has been initialized using an options object that does not match the API schema.\n - options.headers should be one of these:\n   [object { key?, value? }, ...] (should not have fewer than 1 item) | object { … } | function\n   -> Allows to set custom headers on response.\n   -> Read more at https://webpack.js.org/configuration/dev-server/#devserverheaders\n   Details:\n    * options.headers should be an array:\n      [object { key?, value? }, ...] (should not have fewer than 1 item)\n    * options.headers should be an object:\n      object { … }\n    * options.headers should be an instance of function.\"\n`;\n\nexports[`options validate should throw an error on the \"headers\" option with 'false' value 1`] = `\n\"ValidationError: Invalid options object. Dev Server has been initialized using an options object that does not match the API schema.\n - options.headers should be one of these:\n   [object { key?, value? }, ...] (should not have fewer than 1 item) | object { … } | function\n   -> Allows to set custom headers on response.\n   -> Read more at https://webpack.js.org/configuration/dev-server/#devserverheaders\n   Details:\n    * options.headers should be an array:\n      [object { key?, value? }, ...] (should not have fewer than 1 item)\n    * options.headers should be an object:\n      object { … }\n    * options.headers should be an instance of function.\"\n`;\n\nexports[`options validate should throw an error on the \"historyApiFallback\" option with '' value 1`] = `\n\"ValidationError: Invalid options object. Dev Server has been initialized using an options object that does not match the API schema.\n - options.historyApiFallback should be one of these:\n   boolean | object { … }\n   -> Allows to proxy requests through a specified index page (by default 'index.html'), useful for Single Page Applications that utilise the HTML5 History API.\n   -> Read more at https://webpack.js.org/configuration/dev-server/#devserverhistoryapifallback\n   Details:\n    * options.historyApiFallback should be a boolean.\n    * options.historyApiFallback should be an object:\n      object { … }\n      -> Options for \\`historyApiFallback\\`.\n      -> Read more at https://github.com/bripkens/connect-history-api-fallback#options\"\n`;\n\nexports[`options validate should throw an error on the \"host\" option with '' value 1`] = `\n\"ValidationError: Invalid options object. Dev Server has been initialized using an options object that does not match the API schema.\n - options.host should be a non-empty string.\"\n`;\n\nexports[`options validate should throw an error on the \"host\" option with 'false' value 1`] = `\n\"ValidationError: Invalid options object. Dev Server has been initialized using an options object that does not match the API schema.\n - options.host should be one of these:\n   \"local-ip\" | \"local-ipv4\" | \"local-ipv6\" | non-empty string\n   -> Allows to specify a hostname to use.\n   -> Read more at https://webpack.js.org/configuration/dev-server/#devserverhost\n   Details:\n    * options.host should be one of these:\n      \"local-ip\" | \"local-ipv4\" | \"local-ipv6\"\n    * options.host should be a non-empty string.\"\n`;\n\nexports[`options validate should throw an error on the \"host\" option with 'null' value 1`] = `\n\"ValidationError: Invalid options object. Dev Server has been initialized using an options object that does not match the API schema.\n - options.host should be one of these:\n   \"local-ip\" | \"local-ipv4\" | \"local-ipv6\" | non-empty string\n   -> Allows to specify a hostname to use.\n   -> Read more at https://webpack.js.org/configuration/dev-server/#devserverhost\n   Details:\n    * options.host should be one of these:\n      \"local-ip\" | \"local-ipv4\" | \"local-ipv6\"\n    * options.host should be a non-empty string.\"\n`;\n\nexports[`options validate should throw an error on the \"hot\" option with '' value 1`] = `\n\"ValidationError: Invalid options object. Dev Server has been initialized using an options object that does not match the API schema.\n - options.hot should be one of these:\n   boolean | \"only\"\n   -> Enables Hot Module Replacement.\n   -> Read more at https://webpack.js.org/configuration/dev-server/#devserverhot\n   Details:\n    * options.hot should be a boolean.\n    * options.hot should be \"only\".\"\n`;\n\nexports[`options validate should throw an error on the \"hot\" option with 'foo' value 1`] = `\n\"ValidationError: Invalid options object. Dev Server has been initialized using an options object that does not match the API schema.\n - options.hot should be one of these:\n   boolean | \"only\"\n   -> Enables Hot Module Replacement.\n   -> Read more at https://webpack.js.org/configuration/dev-server/#devserverhot\n   Details:\n    * options.hot should be a boolean.\n    * options.hot should be \"only\".\"\n`;\n\nexports[`options validate should throw an error on the \"ipc\" option with '{}' value 1`] = `\n\"ValidationError: Invalid options object. Dev Server has been initialized using an options object that does not match the API schema.\n - options.ipc should be one of these:\n   non-empty string | true\n   -> Listen to a unix socket.\n   -> Read more at https://webpack.js.org/configuration/dev-server/#devserveripc\n   Details:\n    * options.ipc should be a non-empty string.\n    * options.ipc should be a true.\n    * options.ipc should be true.\"\n`;\n\nexports[`options validate should throw an error on the \"ipc\" option with 'false' value 1`] = `\n\"ValidationError: Invalid options object. Dev Server has been initialized using an options object that does not match the API schema.\n - options.ipc should be one of these:\n   non-empty string | true\n   -> Listen to a unix socket.\n   -> Read more at https://webpack.js.org/configuration/dev-server/#devserveripc\n   Details:\n    * options.ipc should be a non-empty string.\n    * options.ipc should be true.\"\n`;\n\nexports[`options validate should throw an error on the \"liveReload\" option with 'invalid' value 1`] = `\n\"ValidationError: Invalid options object. Dev Server has been initialized using an options object that does not match the API schema.\n - options.liveReload should be a boolean.\n   -> Enables reload/refresh the page(s) when file changes are detected (enabled by default).\n   -> Read more at https://webpack.js.org/configuration/dev-server/#devserverlivereload\"\n`;\n\nexports[`options validate should throw an error on the \"onListening\" option with '' value 1`] = `\n\"ValidationError: Invalid options object. Dev Server has been initialized using an options object that does not match the API schema.\n - options.onListening should be an instance of function.\n   -> Provides the ability to execute a custom function when dev server starts listening.\n   -> Read more at https://webpack.js.org/configuration/dev-server/#devserveronlistening\"\n`;\n\nexports[`options validate should throw an error on the \"open\" option with '' value 1`] = `\n\"ValidationError: Invalid options object. Dev Server has been initialized using an options object that does not match the API schema.\n - options.open should be a non-empty string.\"\n`;\n\nexports[`options validate should throw an error on the \"open\" option with '{\"app\":true}' value 1`] = `\n\"ValidationError: Invalid options object. Dev Server has been initialized using an options object that does not match the API schema.\n - options.open should be one of these:\n   [non-empty string | object { target?, app? }, ...] | boolean | non-empty string | object { target?, app? }\n   -> Allows to configure dev server to open the browser(s) and page(s) after server had been started (set it to true to open your default browser).\n   -> Read more at https://webpack.js.org/configuration/dev-server/#devserveropen\n   Details:\n    * options.open.app should be one of these:\n      object { name?, arguments? } | non-empty string\n      -> Open specified browser.\n      Details:\n       * options.open.app should be an object:\n         object { name?, arguments? }\n       * options.open.app should be a non-empty string.\n         -> Open specified browser.\"\n`;\n\nexports[`options validate should throw an error on the \"open\" option with '{\"foo\":\"bar\"}' value 1`] = `\n\"ValidationError: Invalid options object. Dev Server has been initialized using an options object that does not match the API schema.\n - options.open has an unknown property 'foo'. These properties are valid:\n   object { target?, app? }\"\n`;\n\nexports[`options validate should throw an error on the \"open\" option with '{\"target\":90}' value 1`] = `\n\"ValidationError: Invalid options object. Dev Server has been initialized using an options object that does not match the API schema.\n - options.open should be one of these:\n   [non-empty string | object { target?, app? }, ...] | boolean | non-empty string | object { target?, app? }\n   -> Allows to configure dev server to open the browser(s) and page(s) after server had been started (set it to true to open your default browser).\n   -> Read more at https://webpack.js.org/configuration/dev-server/#devserveropen\n   Details:\n    * options.open.target should be one of these:\n      [string, ...] | string\n      -> Opens specified page in browser.\n      Details:\n       * options.open.target should be an array:\n         [string, ...]\n       * options.open.target should be a string.\"\n`;\n\nexports[`options validate should throw an error on the \"port\" option with '' value 1`] = `\n\"ValidationError: Invalid options object. Dev Server has been initialized using an options object that does not match the API schema.\n - options.port should be a non-empty string.\"\n`;\n\nexports[`options validate should throw an error on the \"port\" option with '-1' value 1`] = `\n\"ValidationError: Invalid options object. Dev Server has been initialized using an options object that does not match the API schema.\n - options.port should be >= 0 and <= 65535.\"\n`;\n\nexports[`options validate should throw an error on the \"port\" option with '65536' value 1`] = `\n\"ValidationError: Invalid options object. Dev Server has been initialized using an options object that does not match the API schema.\n - options.port should be >= 0 and <= 65535.\"\n`;\n\nexports[`options validate should throw an error on the \"port\" option with 'false' value 1`] = `\n\"ValidationError: Invalid options object. Dev Server has been initialized using an options object that does not match the API schema.\n - options.port should be one of these:\n   number (should be >= 0 and <= 65535) | non-empty string | \"auto\"\n   -> Allows to specify a port to use.\n   -> Read more at https://webpack.js.org/configuration/dev-server/#devserverport\n   Details:\n    * options.port should be a number (should be >= 0 and <= 65535).\n    * options.port should be a non-empty string.\n    * options.port should be \"auto\".\"\n`;\n\nexports[`options validate should throw an error on the \"port\" option with 'null' value 1`] = `\n\"ValidationError: Invalid options object. Dev Server has been initialized using an options object that does not match the API schema.\n - options.port should be one of these:\n   number (should be >= 0 and <= 65535) | non-empty string | \"auto\"\n   -> Allows to specify a port to use.\n   -> Read more at https://webpack.js.org/configuration/dev-server/#devserverport\n   Details:\n    * options.port should be a number (should be >= 0 and <= 65535).\n    * options.port should be a non-empty string.\n    * options.port should be \"auto\".\"\n`;\n\nexports[`options validate should throw an error on the \"proxy\" option with '() => {}' value 1`] = `\n\"ValidationError: Invalid options object. Dev Server has been initialized using an options object that does not match the API schema.\n - options.proxy should be an array:\n   [object { … } | function, ...]\n   -> Allows to proxy requests, can be useful when you have a separate API backend development server and you want to send API requests on the same domain.\n   -> Read more at https://webpack.js.org/configuration/dev-server/#devserverproxy\"\n`;\n\nexports[`options validate should throw an error on the \"proxy\" option with '{\"/api\":\"http://localhost:3000\"}' value 1`] = `\n\"ValidationError: Invalid options object. Dev Server has been initialized using an options object that does not match the API schema.\n - options.proxy should be an array:\n   [object { … } | function, ...]\n   -> Allows to proxy requests, can be useful when you have a separate API backend development server and you want to send API requests on the same domain.\n   -> Read more at https://webpack.js.org/configuration/dev-server/#devserverproxy\"\n`;\n\nexports[`options validate should throw an error on the \"proxy\" option with 'false' value 1`] = `\n\"ValidationError: Invalid options object. Dev Server has been initialized using an options object that does not match the API schema.\n - options.proxy should be an array:\n   [object { … } | function, ...]\n   -> Allows to proxy requests, can be useful when you have a separate API backend development server and you want to send API requests on the same domain.\n   -> Read more at https://webpack.js.org/configuration/dev-server/#devserverproxy\"\n`;\n\nexports[`options validate should throw an error on the \"server\" option with '{\"type\":\"https\",\"additional\":\"test\"}' value 1`] = `\n\"ValidationError: Invalid options object. Dev Server has been initialized using an options object that does not match the API schema.\n - options.server has an unknown property 'additional'. These properties are valid:\n   object { type?, options? }\"\n`;\n\nexports[`options validate should throw an error on the \"server\" option with '{\"type\":\"https\",\"options\":{\"ca\":true}}' value 1`] = `\n\"ValidationError: Invalid options object. Dev Server has been initialized using an options object that does not match the API schema.\n - options.server should be one of these:\n   \"http\" | \"https\" | \"spdy\" | \"http2\" | function | non-empty string | object { type?, options? }\n   -> Allows to set server and options (by default 'http').\n   -> Read more at https://webpack.js.org/configuration/dev-server/#devserverserver\n   Details:\n    * options.server.options.ca should be one of these:\n      [string | Buffer, ...] | string | Buffer\n      -> Path to an SSL CA certificate or content of an SSL CA certificate.\n      Details:\n       * options.server.options.ca should be an array:\n         [string | Buffer, ...]\n       * options.server.options.ca should be a string.\n       * options.server.options.ca should be an instance of Buffer.\"\n`;\n\nexports[`options validate should throw an error on the \"server\" option with '{\"type\":\"https\",\"options\":{\"cert\":true}}' value 1`] = `\n\"ValidationError: Invalid options object. Dev Server has been initialized using an options object that does not match the API schema.\n - options.server should be one of these:\n   \"http\" | \"https\" | \"spdy\" | \"http2\" | function | non-empty string | object { type?, options? }\n   -> Allows to set server and options (by default 'http').\n   -> Read more at https://webpack.js.org/configuration/dev-server/#devserverserver\n   Details:\n    * options.server.options.cert should be one of these:\n      [string | Buffer, ...] | string | Buffer\n      -> Path to an SSL certificate or content of an SSL certificate.\n      Details:\n       * options.server.options.cert should be an array:\n         [string | Buffer, ...]\n       * options.server.options.cert should be a string.\n       * options.server.options.cert should be an instance of Buffer.\"\n`;\n\nexports[`options validate should throw an error on the \"server\" option with '{\"type\":\"https\",\"options\":{\"key\":10}}' value 1`] = `\n\"ValidationError: Invalid options object. Dev Server has been initialized using an options object that does not match the API schema.\n - options.server should be one of these:\n   \"http\" | \"https\" | \"spdy\" | \"http2\" | function | non-empty string | object { type?, options? }\n   -> Allows to set server and options (by default 'http').\n   -> Read more at https://webpack.js.org/configuration/dev-server/#devserverserver\n   Details:\n    * options.server.options.key should be one of these:\n      [string | Buffer | object { … }, ...] | string | Buffer\n      -> Path to an SSL key or content of an SSL key.\n      Details:\n       * options.server.options.key should be an array:\n         [string | Buffer | object { … }, ...]\n       * options.server.options.key should be a string.\n       * options.server.options.key should be an instance of Buffer.\"\n`;\n\nexports[`options validate should throw an error on the \"server\" option with '{\"type\":\"https\",\"options\":{\"passphrase\":false}}' value 1`] = `\n\"ValidationError: Invalid options object. Dev Server has been initialized using an options object that does not match the API schema.\n - options.server.options.passphrase should be a string.\n   -> Passphrase for a pfx file.\"\n`;\n\nexports[`options validate should throw an error on the \"server\" option with '{\"type\":\"https\",\"options\":{\"pfx\":10}}' value 1`] = `\n\"ValidationError: Invalid options object. Dev Server has been initialized using an options object that does not match the API schema.\n - options.server should be one of these:\n   \"http\" | \"https\" | \"spdy\" | \"http2\" | function | non-empty string | object { type?, options? }\n   -> Allows to set server and options (by default 'http').\n   -> Read more at https://webpack.js.org/configuration/dev-server/#devserverserver\n   Details:\n    * options.server.options.pfx should be one of these:\n      [string | Buffer | object { … }, ...] | string | Buffer\n      -> Path to an SSL pfx file or content of an SSL pfx file.\n      Details:\n       * options.server.options.pfx should be an array:\n         [string | Buffer | object { … }, ...]\n       * options.server.options.pfx should be a string.\n       * options.server.options.pfx should be an instance of Buffer.\"\n`;\n\nexports[`options validate should throw an error on the \"server\" option with '{\"type\":\"https\",\"options\":{\"requestCert\":\"false\"}}' value 1`] = `\n\"ValidationError: Invalid options object. Dev Server has been initialized using an options object that does not match the API schema.\n - options.server.options.requestCert should be a boolean.\n   -> Request for an SSL certificate.\"\n`;\n\nexports[`options validate should throw an error on the \"setupMiddlewares\" option with '10' value 1`] = `\n\"ValidationError: Invalid options object. Dev Server has been initialized using an options object that does not match the API schema.\n - options.setupMiddlewares should be an instance of function.\n   -> Provides the ability to execute a custom function and apply custom middleware(s).\n   -> Read more at https://webpack.js.org/configuration/dev-server/#devserversetupmiddlewares\"\n`;\n\nexports[`options validate should throw an error on the \"setupMiddlewares\" option with 'false' value 1`] = `\n\"ValidationError: Invalid options object. Dev Server has been initialized using an options object that does not match the API schema.\n - options.setupMiddlewares should be an instance of function.\n   -> Provides the ability to execute a custom function and apply custom middleware(s).\n   -> Read more at https://webpack.js.org/configuration/dev-server/#devserversetupmiddlewares\"\n`;\n\nexports[`options validate should throw an error on the \"setupMiddlewares\" option with 'true' value 1`] = `\n\"ValidationError: Invalid options object. Dev Server has been initialized using an options object that does not match the API schema.\n - options.setupMiddlewares should be an instance of function.\n   -> Provides the ability to execute a custom function and apply custom middleware(s).\n   -> Read more at https://webpack.js.org/configuration/dev-server/#devserversetupmiddlewares\"\n`;\n\nexports[`options validate should throw an error on the \"static\" option with '' value 1`] = `\n\"ValidationError: Invalid options object. Dev Server has been initialized using an options object that does not match the API schema.\n - options.static should be a non-empty string.\"\n`;\n\nexports[`options validate should throw an error on the \"static\" option with '{\"directory\":false}' value 1`] = `\n\"ValidationError: Invalid options object. Dev Server has been initialized using an options object that does not match the API schema.\n - options.static.directory should be a non-empty string.\n   -> Directory for static contents.\n   -> Read more at https://webpack.js.org/configuration/dev-server/#directory\"\n`;\n\nexports[`options validate should throw an error on the \"static\" option with '{\"publicPath\":false}' value 1`] = `\n\"ValidationError: Invalid options object. Dev Server has been initialized using an options object that does not match the API schema.\n - options.static should be one of these:\n   [non-empty string | object { directory?, staticOptions?, publicPath?, serveIndex?, watch? }, ...] | boolean | non-empty string | object { directory?, staticOptions?, publicPath?, serveIndex?, watch? }\n   -> Allows to configure options for serving static files from directory (by default 'public' directory).\n   -> Read more at https://webpack.js.org/configuration/dev-server/#devserverstatic\n   Details:\n    * options.static.publicPath should be one of these:\n      [string, ...] (should not have fewer than 1 item) | string\n      -> The static files will be available in the browser under this public path.\n      -> Read more at https://webpack.js.org/configuration/dev-server/#publicpath\n      Details:\n       * options.static.publicPath should be an array:\n         [string, ...] (should not have fewer than 1 item)\n       * options.static.publicPath should be a string.\"\n`;\n\nexports[`options validate should throw an error on the \"static\" option with '{\"serveIndex\":\"true\"}' value 1`] = `\n\"ValidationError: Invalid options object. Dev Server has been initialized using an options object that does not match the API schema.\n - options.static should be one of these:\n   [non-empty string | object { directory?, staticOptions?, publicPath?, serveIndex?, watch? }, ...] | boolean | non-empty string | object { directory?, staticOptions?, publicPath?, serveIndex?, watch? }\n   -> Allows to configure options for serving static files from directory (by default 'public' directory).\n   -> Read more at https://webpack.js.org/configuration/dev-server/#devserverstatic\n   Details:\n    * options.static.serveIndex should be one of these:\n      boolean | object { … }\n      -> Tells dev server to use serveIndex middleware when enabled.\n      -> Read more at https://webpack.js.org/configuration/dev-server/#serveindex\n      Details:\n       * options.static.serveIndex should be a boolean.\n       * options.static.serveIndex should be an object:\n         object { … }\"\n`;\n\nexports[`options validate should throw an error on the \"static\" option with '{\"watch\":10}' value 1`] = `\n\"ValidationError: Invalid options object. Dev Server has been initialized using an options object that does not match the API schema.\n - options.static should be one of these:\n   [non-empty string | object { directory?, staticOptions?, publicPath?, serveIndex?, watch? }, ...] | boolean | non-empty string | object { directory?, staticOptions?, publicPath?, serveIndex?, watch? }\n   -> Allows to configure options for serving static files from directory (by default 'public' directory).\n   -> Read more at https://webpack.js.org/configuration/dev-server/#devserverstatic\n   Details:\n    * options.static.watch should be one of these:\n      boolean | object { … }\n      -> Watches for files in static content directory.\n      -> Read more at https://webpack.js.org/configuration/dev-server/#watch\n      Details:\n       * options.static.watch should be a boolean.\n       * options.static.watch should be an object:\n         object { … }\n         -> Options for watch.\n         -> Read more at https://github.com/paulmillr/chokidar#api\"\n`;\n\nexports[`options validate should throw an error on the \"static\" option with '0' value 1`] = `\n\"ValidationError: Invalid options object. Dev Server has been initialized using an options object that does not match the API schema.\n - options.static should be one of these:\n   [non-empty string | object { directory?, staticOptions?, publicPath?, serveIndex?, watch? }, ...] | boolean | non-empty string | object { directory?, staticOptions?, publicPath?, serveIndex?, watch? }\n   -> Allows to configure options for serving static files from directory (by default 'public' directory).\n   -> Read more at https://webpack.js.org/configuration/dev-server/#devserverstatic\n   Details:\n    * options.static should be an array:\n      [non-empty string | object { directory?, staticOptions?, publicPath?, serveIndex?, watch? }, ...]\n    * options.static should be a boolean.\n    * options.static should be a non-empty string.\n    * options.static should be an object:\n      object { directory?, staticOptions?, publicPath?, serveIndex?, watch? }\"\n`;\n\nexports[`options validate should throw an error on the \"static\" option with 'null' value 1`] = `\n\"ValidationError: Invalid options object. Dev Server has been initialized using an options object that does not match the API schema.\n - options.static should be one of these:\n   [non-empty string | object { directory?, staticOptions?, publicPath?, serveIndex?, watch? }, ...] | boolean | non-empty string | object { directory?, staticOptions?, publicPath?, serveIndex?, watch? }\n   -> Allows to configure options for serving static files from directory (by default 'public' directory).\n   -> Read more at https://webpack.js.org/configuration/dev-server/#devserverstatic\n   Details:\n    * options.static should be an array:\n      [non-empty string | object { directory?, staticOptions?, publicPath?, serveIndex?, watch? }, ...]\n    * options.static should be a boolean.\n    * options.static should be a non-empty string.\n    * options.static should be an object:\n      object { directory?, staticOptions?, publicPath?, serveIndex?, watch? }\"\n`;\n\nexports[`options validate should throw an error on the \"watchFiles\" option with '{\"options\":false}' value 1`] = `\n\"ValidationError: Invalid options object. Dev Server has been initialized using an options object that does not match the API schema.\n - options.watchFiles.options should be an object:\n   object { … }\n   -> Configure advanced options for watching. See the chokidar documentation for the possible options.\n   -> Read more at https://github.com/paulmillr/chokidar#api\"\n`;\n\nexports[`options validate should throw an error on the \"watchFiles\" option with '{\"paths\":false}' value 1`] = `\n\"ValidationError: Invalid options object. Dev Server has been initialized using an options object that does not match the API schema.\n - options.watchFiles should be one of these:\n   [non-empty string | object { paths?, options? }, ...] | non-empty string | object { paths?, options? }\n   -> Allows to configure list of globs/directories/files to watch for file changes.\n   -> Read more at https://webpack.js.org/configuration/dev-server/#devserverwatchfiles\n   Details:\n    * options.watchFiles.paths should be one of these:\n      [non-empty string, ...] | non-empty string\n      -> Path(s) of globs/directories/files to watch for file changes.\n      Details:\n       * options.watchFiles.paths should be an array:\n         [non-empty string, ...]\n       * options.watchFiles.paths should be a non-empty string.\"\n`;\n\nexports[`options validate should throw an error on the \"watchFiles\" option with '123' value 1`] = `\n\"ValidationError: Invalid options object. Dev Server has been initialized using an options object that does not match the API schema.\n - options.watchFiles should be one of these:\n   [non-empty string | object { paths?, options? }, ...] | non-empty string | object { paths?, options? }\n   -> Allows to configure list of globs/directories/files to watch for file changes.\n   -> Read more at https://webpack.js.org/configuration/dev-server/#devserverwatchfiles\n   Details:\n    * options.watchFiles should be an array:\n      [non-empty string | object { paths?, options? }, ...]\n    * options.watchFiles should be a non-empty string.\n    * options.watchFiles should be an object:\n      object { paths?, options? }\"\n`;\n\nexports[`options validate should throw an error on the \"watchFiles\" option with 'false' value 1`] = `\n\"ValidationError: Invalid options object. Dev Server has been initialized using an options object that does not match the API schema.\n - options.watchFiles should be one of these:\n   [non-empty string | object { paths?, options? }, ...] | non-empty string | object { paths?, options? }\n   -> Allows to configure list of globs/directories/files to watch for file changes.\n   -> Read more at https://webpack.js.org/configuration/dev-server/#devserverwatchfiles\n   Details:\n    * options.watchFiles should be an array:\n      [non-empty string | object { paths?, options? }, ...]\n    * options.watchFiles should be a non-empty string.\n    * options.watchFiles should be an object:\n      object { paths?, options? }\"\n`;\n\nexports[`options validate should throw an error on the \"webSocketServer\" option with '{\"notAnOption\":true}' value 1`] = `\n\"ValidationError: Invalid options object. Dev Server has been initialized using an options object that does not match the API schema.\n - options.webSocketServer has an unknown property 'notAnOption'. These properties are valid:\n   object { type?, options? }\"\n`;\n\nexports[`options validate should throw an error on the \"webSocketServer\" option with '{\"type\":false}' value 1`] = `\n\"ValidationError: Invalid options object. Dev Server has been initialized using an options object that does not match the API schema.\n - options.webSocketServer should be one of these:\n   false | \"sockjs\" | \"ws\" | non-empty string | function | object { type?, options? }\n   -> Allows to set web socket server and options (by default 'ws').\n   -> Read more at https://webpack.js.org/configuration/dev-server/#devserverwebsocketserver\n   Details:\n    * options.webSocketServer.type should be one of these:\n      \"sockjs\" | \"ws\" | non-empty string | function\n      Details:\n       * options.webSocketServer.type should be one of these:\n         \"sockjs\" | \"ws\"\n       * options.webSocketServer.type should be a non-empty string.\n       * options.webSocketServer.type should be an instance of function.\"\n`;\n\nexports[`options validate should throw an error on the \"webSocketServer\" option with '{\"type\":true}' value 1`] = `\n\"ValidationError: Invalid options object. Dev Server has been initialized using an options object that does not match the API schema.\n - options.webSocketServer should be one of these:\n   false | \"sockjs\" | \"ws\" | non-empty string | function | object { type?, options? }\n   -> Allows to set web socket server and options (by default 'ws').\n   -> Read more at https://webpack.js.org/configuration/dev-server/#devserverwebsocketserver\n   Details:\n    * options.webSocketServer.type should be one of these:\n      \"sockjs\" | \"ws\" | non-empty string | function\n      Details:\n       * options.webSocketServer.type should be one of these:\n         \"sockjs\" | \"ws\"\n       * options.webSocketServer.type should be a non-empty string.\n       * options.webSocketServer.type should be an instance of function.\"\n`;\n\nexports[`options validate should throw an error on the \"webSocketServer\" option with 'null' value 1`] = `\n\"ValidationError: Invalid options object. Dev Server has been initialized using an options object that does not match the API schema.\n - options.webSocketServer should be one of these:\n   false | \"sockjs\" | \"ws\" | non-empty string | function | object { type?, options? }\n   -> Allows to set web socket server and options (by default 'ws').\n   -> Read more at https://webpack.js.org/configuration/dev-server/#devserverwebsocketserver\n   Details:\n    * options.webSocketServer should be one of these:\n      false | \"sockjs\" | \"ws\"\n      Details:\n       * options.webSocketServer should be false.\n       * options.webSocketServer should be one of these:\n         \"sockjs\" | \"ws\"\n    * options.webSocketServer should be a non-empty string.\n    * options.webSocketServer should be an instance of function.\n    * options.webSocketServer should be an object:\n      object { type?, options? }\"\n`;\n\nexports[`options validate should throw an error on the \"webSocketServer\" option with 'true' value 1`] = `\n\"ValidationError: Invalid options object. Dev Server has been initialized using an options object that does not match the API schema.\n - options.webSocketServer should be one of these:\n   false | \"sockjs\" | \"ws\" | non-empty string | function | object { type?, options? }\n   -> Allows to set web socket server and options (by default 'ws').\n   -> Read more at https://webpack.js.org/configuration/dev-server/#devserverwebsocketserver\n   Details:\n    * options.webSocketServer should be one of these:\n      false | \"sockjs\" | \"ws\"\n      Details:\n       * options.webSocketServer should be false.\n       * options.webSocketServer should be one of these:\n         \"sockjs\" | \"ws\"\n    * options.webSocketServer should be a non-empty string.\n    * options.webSocketServer should be an instance of function.\n    * options.webSocketServer should be an object:\n      object { type?, options? }\"\n`;\n"
  },
  {
    "path": "test/cli/__snapshots__/basic.test.js.snap.webpack5",
    "content": "// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing\n\nexports[`basic basic should accept the promise function of webpack.config.js: stderr 1`] = `\n\"<i> [webpack-dev-server] Project is running at:\n<i> Loopback: http://localhost:<port>/, http://<ip-v4>:<port>/, http://[<ip-v6>]:<port>/\n<i> [webpack-dev-server] On Your Network (IPv4): http://<ip-v4>:<port>/\n<i> [webpack-dev-server] On Your Network (IPv6): http://[<ip-v6>]:<port>/\n<i> [webpack-dev-server] Content not from webpack is served from '<cwd>/public' directory\"\n`;\n\nexports[`basic basic should work using \"--host localhost --port <port>\": stderr 1`] = `\n\"<i> [webpack-dev-server] Project is running at:\n<i> Loopback: http://localhost:<port>/, http://<ip-v4>:<port>/, http://[<ip-v6>]:<port>/\n<i> [webpack-dev-server] Content not from webpack is served from '<cwd>/public' directory\"\n`;\n\nexports[`basic basic should work using multi compiler mode: stderr 1`] = `\n\"<i> [webpack-dev-server] Project is running at:\n<i> Loopback: http://localhost:<port>/, http://<ip-v4>:<port>/, http://[<ip-v6>]:<port>/\n<i> [webpack-dev-server] On Your Network (IPv4): http://<ip-v4>:<port>/\n<i> [webpack-dev-server] On Your Network (IPv6): http://[<ip-v6>]:<port>/\n<i> [webpack-dev-server] Content not from webpack is served from '<cwd>/public' directory\"\n`;\n\nexports[`basic basic should work: stderr 1`] = `\n\"<i> [webpack-dev-server] Project is running at:\n<i> Loopback: http://localhost:<port>/, http://<ip-v4>:<port>/, http://[<ip-v6>]:<port>/\n<i> [webpack-dev-server] On Your Network (IPv4): http://<ip-v4>:<port>/\n<i> [webpack-dev-server] On Your Network (IPv6): http://[<ip-v6>]:<port>/\n<i> [webpack-dev-server] Content not from webpack is served from '<cwd>/public' directory\"\n`;\n\nexports[`basic should output help should generate correct cli flags 1`] = `\n\"Usage: webpack serve|server|s [entries...] [options]\n\nRun the webpack dev server and watch for source file changes while serving.\n\nOptions:\n  -c, --config <pathToConfigFile...>                  Provide path to one or more webpack configuration files to process, e.g. \"./webpack.config.js\".\n  --config-name <name...>                             Name(s) of particular configuration(s) to use if configuration file exports an array of multiple configurations.\n  -m, --merge                                         Merge two or more configurations using 'webpack-merge'.\n  --disable-interpret                                 Disable interpret for loading the config file.\n  --env <value...>                                    Environment variables passed to the configuration when it is a function, e.g. \"myvar\" or \"myvar=myval\".\n  --node-env <value>                                  Sets process.env.NODE_ENV to the specified value for access within the configuration.(Deprecated: Use '--config-node-env' instead)\n  --config-node-env <value>                           Sets process.env.NODE_ENV to the specified value for access within the configuration.\n  --analyze                                           It invokes webpack-bundle-analyzer plugin to get bundle information.\n  --progress [value]                                  Print compilation progress during build.\n  -j, --json [pathToJsonFile]                         Prints result as JSON or store it in a file.\n  --fail-on-warnings                                  Stop webpack-cli process with non-zero exit code on warnings from webpack.\n  -d, --devtool <value>                               A developer tool to enhance debugging (false | eval | [inline-|hidden-|eval-][nosources-][cheap-[module-]]source-map).\n  --no-devtool                                        Negative 'devtool' option.\n  --entry <value...>                                  A module that is loaded upon startup. Only the last one is exported.\n  -e, --extends <value...>                            Path to the configuration to be extended (only works when using webpack-cli).\n  --mode <value>                                      Enable production optimizations or development hints.\n  --name <value>                                      Name of the configuration. Used when loading multiple configurations.\n  -o, --output-path <value>                           The output directory as **absolute path** (required).\n  --stats [value]                                     Stats options object or preset name.\n  --no-stats                                          Negative 'stats' option.\n  -t, --target <value...>                             Environment to build for. Environment to build for. An array of environments to build for all of them when possible.\n  --no-target                                         Negative 'target' option.\n  -w, --watch                                         Enter watch mode, which rebuilds on file change.\n  --no-watch                                          Negative 'watch' option.\n  --watch-options-stdin                               Stop watching when stdin stream has ended.\n  --no-watch-options-stdin                            Negative 'watch-options-stdin' option.\n  --allowed-hosts <value...>                          Allows to enumerate the hosts from which access to the dev server are allowed (useful when you are proxying dev server, by default is 'auto').\n  --allowed-hosts-reset                               Clear all items provided in 'allowedHosts' configuration. Allows to enumerate the hosts from which access to the dev server are allowed (useful when you are proxying dev server, by default is 'auto').\n  --bonjour                                           Allows to broadcasts dev server via ZeroConf networking on start.\n  --no-bonjour                                        Disallows to broadcasts dev server via ZeroConf networking on start.\n  --no-client                                         Disables client script.\n  --client-logging <value>                            Allows to set log level in the browser.\n  --client-overlay                                    Enables a full-screen overlay in the browser when there are compiler errors or warnings.\n  --no-client-overlay                                 Disables the full-screen overlay in the browser when there are compiler errors or warnings.\n  --client-overlay-errors                             Enables a full-screen overlay in the browser when there are compiler errors.\n  --no-client-overlay-errors                          Disables the full-screen overlay in the browser when there are compiler errors.\n  --client-overlay-warnings                           Enables a full-screen overlay in the browser when there are compiler warnings.\n  --no-client-overlay-warnings                        Disables the full-screen overlay in the browser when there are compiler warnings.\n  --client-overlay-runtime-errors                     Enables a full-screen overlay in the browser when there are uncaught runtime errors.\n  --no-client-overlay-runtime-errors                  Disables the full-screen overlay in the browser when there are uncaught runtime errors.\n  --client-overlay-trusted-types-policy-name <value>  The name of a Trusted Types policy for the overlay. Defaults to 'webpack-dev-server#overlay'.\n  --client-progress [value]                           Displays compilation progress in the browser. Options include 'linear' and 'circular' for visual indicators.\n  --no-client-progress                                Does not display compilation progress in the browser.\n  --client-reconnect [value]                          Tells dev-server the number of times it should try to reconnect the client.\n  --no-client-reconnect                               Tells dev-server to not to try to reconnect the client.\n  --client-web-socket-transport <value>               Allows to set custom web socket transport to communicate with dev server.\n  --client-web-socket-url <value>                     Allows to specify URL to web socket server (useful when you're proxying dev server and client script does not always know where to connect to).\n  --client-web-socket-url-hostname <value>            Tells clients connected to devServer to use the provided hostname.\n  --client-web-socket-url-pathname <value>            Tells clients connected to devServer to use the provided path to connect.\n  --client-web-socket-url-password <value>            Tells clients connected to devServer to use the provided password to authenticate.\n  --client-web-socket-url-port <value>                Tells clients connected to devServer to use the provided port.\n  --client-web-socket-url-protocol <value>            Tells clients connected to devServer to use the provided protocol.\n  --client-web-socket-url-username <value>            Tells clients connected to devServer to use the provided username to authenticate.\n  --compress                                          Enables gzip compression for everything served.\n  --no-compress                                       Disables gzip compression for everything served.\n  --history-api-fallback                              Allows to proxy requests through a specified index page (by default 'index.html'), useful for Single Page Applications that utilise the HTML5 History API.\n  --no-history-api-fallback                           Disallows to proxy requests through a specified index page.\n  --host <value>                                      Allows to specify a hostname to use.\n  --hot [value]                                       Enables Hot Module Replacement.\n  --no-hot                                            Disables Hot Module Replacement.\n  --ipc [value]                                       Listen to a unix socket.\n  --live-reload                                       Enables reload/refresh the page(s) when file changes are detected (enabled by default).\n  --no-live-reload                                    Disables reload/refresh the page(s) when file changes are detected (enabled by default).\n  --open [value...]                                   Allows to configure dev server to open the browser(s) and page(s) after server had been started (set it to true to open your default browser).\n  --no-open                                           Does not open the default browser.\n  --open-target <value...>                            Opens specified page in browser.\n  --open-app-name <value...>                          Open specified browser.\n  --open-reset                                        Clear all items provided in 'open' configuration. Allows to configure dev server to open the browser(s) and page(s) after server had been started (set it to true to open your default browser).\n  --open-target-reset                                 Clear all items provided in 'open.target' configuration. Opens specified page in browser.\n  --open-app-name-reset                               Clear all items provided in 'open.app.name' configuration. Open specified browser.\n  --port <value>                                      Allows to specify a port to use.\n  --server-type <value>                               Allows to set server and options (by default 'http').\n  --server-options-passphrase <value>                 Passphrase for a pfx file.\n  --server-options-request-cert                       Request for an SSL certificate.\n  --no-server-options-request-cert                    Does not request for an SSL certificate.\n  --server-options-ca <value...>                      Path to an SSL CA certificate or content of an SSL CA certificate.\n  --server-options-ca-reset                           Clear all items provided in 'server.options.ca' configuration. Path to an SSL CA certificate or content of an SSL CA certificate.\n  --server-options-cert <value...>                    Path to an SSL certificate or content of an SSL certificate.\n  --server-options-cert-reset                         Clear all items provided in 'server.options.cert' configuration. Path to an SSL certificate or content of an SSL certificate.\n  --server-options-crl <value...>                     Path to PEM formatted CRLs (Certificate Revocation Lists) or content of PEM formatted CRLs (Certificate Revocation Lists).\n  --server-options-crl-reset                          Clear all items provided in 'server.options.crl' configuration. Path to PEM formatted CRLs (Certificate Revocation Lists) or content of PEM formatted CRLs (Certificate Revocation Lists).\n  --server-options-key <value...>                     Path to an SSL key or content of an SSL key.\n  --server-options-key-reset                          Clear all items provided in 'server.options.key' configuration. Path to an SSL key or content of an SSL key.\n  --server-options-pfx <value...>                     Path to an SSL pfx file or content of an SSL pfx file.\n  --server-options-pfx-reset                          Clear all items provided in 'server.options.pfx' configuration. Path to an SSL pfx file or content of an SSL pfx file.\n  --static [value...]                                 Allows to configure options for serving static files from directory (by default 'public' directory).\n  --no-static                                         Disallows to configure options for serving static files from directory.\n  --static-directory <value...>                       Directory for static contents.\n  --static-public-path <value...>                     The static files will be available in the browser under this public path.\n  --static-serve-index                                Tells dev server to use serveIndex middleware when enabled.\n  --no-static-serve-index                             Does not tell dev server to use serveIndex middleware.\n  --static-watch                                      Watches for files in static content directory.\n  --no-static-watch                                   Does not watch for files in static content directory.\n  --static-reset                                      Clear all items provided in 'static' configuration. Allows to configure options for serving static files from directory (by default 'public' directory).\n  --static-public-path-reset                          Clear all items provided in 'static.publicPath' configuration. The static files will be available in the browser under this public path.\n  --watch-files <value...>                            Allows to configure list of globs/directories/files to watch for file changes.\n  --watch-files-reset                                 Clear all items provided in 'watchFiles' configuration. Allows to configure list of globs/directories/files to watch for file changes.\n  --no-web-socket-server                              Disallows to set web socket server and options.\n  --web-socket-server-type <value>                    Allows to set web socket server and options (by default 'ws').\n\nGlobal options:\n  --color                                             Enable colors on console.\n  --no-color                                          Disable colors on console.\n  -v, --version                                       Output the version number of 'webpack', 'webpack-cli' and 'webpack-dev-server' and commands.\n  -h, --help [verbose]                                Display help for commands and options.\n\nTo see list of all supported commands and options run 'webpack --help=verbose'.\n\nWebpack documentation: https://webpack.js.org/.\nCLI documentation: https://webpack.js.org/api/cli/.\nMade with ♥ by the webpack team.\"\n`;\n"
  },
  {
    "path": "test/cli/__snapshots__/bonjour-option.test.js.snap.webpack5",
    "content": "// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing\n\nexports[`\"bonjour\" CLI option should work using \"--bonjour and --server-type=https\" 1`] = `\n\"<i> [webpack-dev-server] Generating SSL certificate...\n<i> [webpack-dev-server] SSL certificate: <cwd>/node_modules/.cache/webpack-dev-server/server.pem\n<i> [webpack-dev-server] Project is running at:\n<i> Loopback: https://localhost:<port>/, https://<ip-v4>:<port>/, https://[<ip-v6>]:<port>/\n<i> [webpack-dev-server] On Your Network (IPv4): https://<ip-v4>:<port>/\n<i> [webpack-dev-server] On Your Network (IPv6): https://[<ip-v6>]:<port>/\n<i> [webpack-dev-server] Content not from webpack is served from '<cwd>/public' directory\n<i> [webpack-dev-server] Broadcasting \"https\" with subtype of \"webpack\" via ZeroConf DNS (Bonjour)\"\n`;\n\nexports[`\"bonjour\" CLI option should work using \"--bonjour\" 1`] = `\n\"<i> [webpack-dev-server] Project is running at:\n<i> Loopback: http://localhost:<port>/, http://<ip-v4>:<port>/, http://[<ip-v6>]:<port>/\n<i> [webpack-dev-server] On Your Network (IPv4): http://<ip-v4>:<port>/\n<i> [webpack-dev-server] On Your Network (IPv6): http://[<ip-v6>]:<port>/\n<i> [webpack-dev-server] Content not from webpack is served from '<cwd>/public' directory\n<i> [webpack-dev-server] Broadcasting \"http\" with subtype of \"webpack\" via ZeroConf DNS (Bonjour)\"\n`;\n\nexports[`\"bonjour\" CLI option should work using \"--no-bonjour\" 1`] = `\n\"<i> [webpack-dev-server] Project is running at:\n<i> Loopback: http://localhost:<port>/, http://<ip-v4>:<port>/, http://[<ip-v6>]:<port>/\n<i> [webpack-dev-server] On Your Network (IPv4): http://<ip-v4>:<port>/\n<i> [webpack-dev-server] On Your Network (IPv6): http://[<ip-v6>]:<port>/\n<i> [webpack-dev-server] Content not from webpack is served from '<cwd>/public' directory\"\n`;\n"
  },
  {
    "path": "test/cli/__snapshots__/colors.test.js.snap.webpack5",
    "content": "// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing\n\nexports[`colors should work and do not use colors using configuration with disabled colors: stderr 1`] = `\n\"<i> [webpack-dev-server] Project is running at:\n<i> Loopback: http://localhost:<port>/, http://<ip-v4>:<port>/, http://[<ip-v6>]:<port>/\n<i> [webpack-dev-server] On Your Network (IPv4): http://<ip-v4>:<port>/\n<i> [webpack-dev-server] On Your Network (IPv6): http://[<ip-v6>]:<port>/\n<i> [webpack-dev-server] Content not from webpack is served from '<cwd>/public' directory\"\n`;\n\nexports[`colors should work do not use colors using \"--no-color\": stderr 1`] = `\n\"<i> [webpack-dev-server] Project is running at:\n<i> Loopback: http://localhost:<port>/, http://<ip-v4>:<port>/, http://[<ip-v6>]:<port>/\n<i> [webpack-dev-server] On Your Network (IPv4): http://<ip-v4>:<port>/\n<i> [webpack-dev-server] On Your Network (IPv6): http://[<ip-v6>]:<port>/\n<i> [webpack-dev-server] Content not from webpack is served from '<cwd>/public' directory\"\n`;\n\nexports[`colors should work use colors by default: stderr 1`] = `\n\"<i> [webpack-dev-server] Project is running at:\n<i> Loopback: http://localhost:<port>/, http://<ip-v4>:<port>/, http://[<ip-v6>]:<port>/\n<i> [webpack-dev-server] On Your Network (IPv4): http://<ip-v4>:<port>/\n<i> [webpack-dev-server] On Your Network (IPv6): http://[<ip-v6>]:<port>/\n<i> [webpack-dev-server] Content not from webpack is served from '<cwd>/public' directory\"\n`;\n\nexports[`colors should work use colors using \"--color\": stderr 1`] = `\n\"<i> [webpack-dev-server] Project is running at:\n<i> Loopback: http://localhost:<port>/, http://<ip-v4>:<port>/, http://[<ip-v6>]:<port>/\n<i> [webpack-dev-server] On Your Network (IPv4): http://<ip-v4>:<port>/\n<i> [webpack-dev-server] On Your Network (IPv6): http://[<ip-v6>]:<port>/\n<i> [webpack-dev-server] Content not from webpack is served from '<cwd>/public' directory\"\n`;\n\nexports[`colors should work use colors using configuration with enabled colors: stderr 1`] = `\n\"<i> [webpack-dev-server] Project is running at:\n<i> Loopback: http://localhost:<port>/, http://<ip-v4>:<port>/, http://[<ip-v6>]:<port>/\n<i> [webpack-dev-server] On Your Network (IPv4): http://<ip-v4>:<port>/\n<i> [webpack-dev-server] On Your Network (IPv6): http://[<ip-v6>]:<port>/\n<i> [webpack-dev-server] Content not from webpack is served from '<cwd>/public' directory\"\n`;\n"
  },
  {
    "path": "test/cli/__snapshots__/historyApiFallback-option.test.js.snap.webpack5",
    "content": "// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing\n\nexports[`\"historyApiFallback\" CLI option should work using \"--history-api-fallback\" 1`] = `\n\"<i> [webpack-dev-server] Project is running at:\n<i> Loopback: http://localhost:<port>/, http://<ip-v4>:<port>/, http://[<ip-v6>]:<port>/\n<i> [webpack-dev-server] On Your Network (IPv4): http://<ip-v4>:<port>/\n<i> [webpack-dev-server] On Your Network (IPv6): http://[<ip-v6>]:<port>/\n<i> [webpack-dev-server] Content not from webpack is served from '<cwd>/public' directory\n<i> [webpack-dev-server] 404s will fallback to '/index.html'\"\n`;\n\nexports[`\"historyApiFallback\" CLI option should work using \"--no-history-api-fallback\" 1`] = `\n\"<i> [webpack-dev-server] Project is running at:\n<i> Loopback: http://localhost:<port>/, http://<ip-v4>:<port>/, http://[<ip-v6>]:<port>/\n<i> [webpack-dev-server] On Your Network (IPv4): http://<ip-v4>:<port>/\n<i> [webpack-dev-server] On Your Network (IPv6): http://[<ip-v6>]:<port>/\n<i> [webpack-dev-server] Content not from webpack is served from '<cwd>/public' directory\"\n`;\n"
  },
  {
    "path": "test/cli/__snapshots__/host-option.test.js.snap.webpack5",
    "content": "// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing\n\nexports[`\"host\" CLI option should work using \"--host ::\" (IPv6): stderr 1`] = `\n\"<i> [webpack-dev-server] Project is running at:\n<i> Loopback: http://localhost:<port>/, http://<ip-v4>:<port>/, http://[<ip-v6>]:<port>/\n<i> [webpack-dev-server] On Your Network (IPv4): http://<ip-v4>:<port>/\n<i> [webpack-dev-server] On Your Network (IPv6): http://[<ip-v6>]:<port>/\n<i> [webpack-dev-server] Content not from webpack is served from '<cwd>/public' directory\"\n`;\n\nexports[`\"host\" CLI option should work using \"--host ::1\" (IPv6): stderr 1`] = `\n\"<i> [webpack-dev-server] Project is running at:\n<i> Loopback: http://localhost:<port>/, http://<ip-v4>:<port>/, http://[<ip-v6>]:<port>/\n<i> [webpack-dev-server] Content not from webpack is served from '<cwd>/public' directory\"\n`;\n\nexports[`\"host\" CLI option should work using \"--host <IPv4>\": stderr 1`] = `\n\"<i> [webpack-dev-server] Project is running at:\n<i> [webpack-dev-server] On Your Network (IPv4): http://<ip-v4>:<port>/\n<i> [webpack-dev-server] Content not from webpack is served from '<cwd>/public' directory\"\n`;\n\nexports[`\"host\" CLI option should work using \"--host 0.0.0.0\" (IPv4): stderr 1`] = `\n\"<i> [webpack-dev-server] Project is running at:\n<i> Loopback: http://localhost:<port>/, http://<ip-v4>:<port>/, http://[<ip-v6>]:<port>/\n<i> [webpack-dev-server] On Your Network (IPv4): http://<ip-v4>:<port>/\n<i> [webpack-dev-server] On Your Network (IPv6): http://[<ip-v6>]:<port>/\n<i> [webpack-dev-server] Content not from webpack is served from '<cwd>/public' directory\"\n`;\n\nexports[`\"host\" CLI option should work using \"--host 127.0.0.1\" (IPv4): stderr 1`] = `\n\"<i> [webpack-dev-server] Project is running at:\n<i> Loopback: http://localhost:<port>/, http://<ip-v4>:<port>/, http://[<ip-v6>]:<port>/\n<i> [webpack-dev-server] Content not from webpack is served from '<cwd>/public' directory\"\n`;\n\nexports[`\"host\" CLI option should work using \"--host local-ip\": stderr 1`] = `\n\"<i> [webpack-dev-server] Project is running at:\n<i> [webpack-dev-server] On Your Network (IPv4): http://<ip-v4>:<port>/\n<i> [webpack-dev-server] Content not from webpack is served from '<cwd>/public' directory\"\n`;\n\nexports[`\"host\" CLI option should work using \"--host local-ipv4\": stderr 1`] = `\n\"<i> [webpack-dev-server] Project is running at:\n<i> [webpack-dev-server] On Your Network (IPv4): http://<ip-v4>:<port>/\n<i> [webpack-dev-server] Content not from webpack is served from '<cwd>/public' directory\"\n`;\n\nexports[`\"host\" CLI option should work using \"--host localhost\": stderr 1`] = `\n\"<i> [webpack-dev-server] Project is running at:\n<i> Loopback: http://localhost:<port>/, http://<ip-v4>:<port>/, http://[<ip-v6>]:<port>/\n<i> [webpack-dev-server] Content not from webpack is served from '<cwd>/public' directory\"\n`;\n"
  },
  {
    "path": "test/cli/__snapshots__/ipc-option.test.js.snap.webpack5",
    "content": "// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing\n\nexports[`\"ipc\" CLI option should work using \"--ipc\": stderr 1`] = `\n\"<i> [webpack-dev-server] Project is running at: \"<tmp>/webpack-dev-server.sock\"\n<i> [webpack-dev-server] Content not from webpack is served from '<cwd>/public' directory\"\n`;\n\nexports[`\"ipc\" CLI option should work using \"--ipc=<string>\": stderr 1`] = `\n\"<i> [webpack-dev-server] Project is running at: \"<tmp>/webpack-dev-server.cli.sock\"\n<i> [webpack-dev-server] Content not from webpack is served from '<cwd>/public' directory\"\n`;\n"
  },
  {
    "path": "test/cli/__snapshots__/port-option.test.js.snap.webpack5",
    "content": "// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing\n\nexports[`\"port\" CLI option should work using \"--port <string>\": stderr 1`] = `\n\"<i> [webpack-dev-server] Project is running at:\n<i> Loopback: http://localhost:<port>/, http://<ip-v4>:<port>/, http://[<ip-v6>]:<port>/\n<i> [webpack-dev-server] On Your Network (IPv4): http://<ip-v4>:<port>/\n<i> [webpack-dev-server] On Your Network (IPv6): http://[<ip-v6>]:<port>/\n<i> [webpack-dev-server] Content not from webpack is served from '<cwd>/public' directory\"\n`;\n\nexports[`\"port\" CLI option should work using \"--port auto\": stderr 1`] = `\n\"<i> [webpack-dev-server] Project is running at:\n<i> Loopback: http://localhost:<port>/, http://<ip-v4>:<port>/, http://[<ip-v6>]:<port>/\n<i> [webpack-dev-server] On Your Network (IPv4): http://<ip-v4>:<port>/\n<i> [webpack-dev-server] On Your Network (IPv6): http://[<ip-v6>]:<port>/\n<i> [webpack-dev-server] Content not from webpack is served from '<cwd>/public' directory\"\n`;\n"
  },
  {
    "path": "test/cli/__snapshots__/server-option.test.js.snap.webpack5",
    "content": "// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing\n\nexports[`\"server\" CLI options should work using \"--no-server-options-request-cert\" 1`] = `\n\"<i> [webpack-dev-server] Generating SSL certificate...\n<i> [webpack-dev-server] SSL certificate: <cwd>/node_modules/.cache/webpack-dev-server/server.pem\n<i> [webpack-dev-server] Project is running at:\n<i> Loopback: https://localhost:<port>/, https://<ip-v4>:<port>/, https://[<ip-v6>]:<port>/\n<i> [webpack-dev-server] On Your Network (IPv4): https://<ip-v4>:<port>/\n<i> [webpack-dev-server] On Your Network (IPv6): https://[<ip-v6>]:<port>/\n<i> [webpack-dev-server] Content not from webpack is served from '<cwd>/public' directory\"\n`;\n\nexports[`\"server\" CLI options should work using \"--server-options-key <path> --server-options-pfx <path> --server-options-passphrase webpack-dev-server --server-options-cert <path> --server-options-ca <path>\" 1`] = `\n\"<i> [webpack-dev-server] Project is running at:\n<i> Loopback: https://localhost:<port>/, https://<ip-v4>:<port>/, https://[<ip-v6>]:<port>/\n<i> [webpack-dev-server] On Your Network (IPv4): https://<ip-v4>:<port>/\n<i> [webpack-dev-server] On Your Network (IPv6): https://[<ip-v6>]:<port>/\n<i> [webpack-dev-server] Content not from webpack is served from '<cwd>/public' directory\"\n`;\n\nexports[`\"server\" CLI options should work using \"--server-options-key <path> --server-options-pfx <path> --server-options-passphrase webpack-dev-server --server-options-cert <path>\" 1`] = `\n\"<i> [webpack-dev-server] Project is running at:\n<i> Loopback: https://localhost:<port>/, https://<ip-v4>:<port>/, https://[<ip-v6>]:<port>/\n<i> [webpack-dev-server] On Your Network (IPv4): https://<ip-v4>:<port>/\n<i> [webpack-dev-server] On Your Network (IPv6): https://[<ip-v6>]:<port>/\n<i> [webpack-dev-server] Content not from webpack is served from '<cwd>/public' directory\"\n`;\n\nexports[`\"server\" CLI options should work using \"--server-options-key-reset --server-options-key <path> --server-options-pfx-reset --server-options-pfx <path> --server-options-passphrase webpack-dev-server --server-options-cert-reset  --server-options-cert <path> --server-options-ca-reset --server-options-ca <path>\" 1`] = `\n\"<i> [webpack-dev-server] Project is running at:\n<i> Loopback: https://localhost:<port>/, https://<ip-v4>:<port>/, https://[<ip-v6>]:<port>/\n<i> [webpack-dev-server] On Your Network (IPv4): https://<ip-v4>:<port>/\n<i> [webpack-dev-server] On Your Network (IPv6): https://[<ip-v6>]:<port>/\n<i> [webpack-dev-server] Content not from webpack is served from '<cwd>/public' directory\"\n`;\n\nexports[`\"server\" CLI options should work using \"--server-options-request-cert\" 1`] = `\n\"<i> [webpack-dev-server] Generating SSL certificate...\n<i> [webpack-dev-server] SSL certificate: <cwd>/node_modules/.cache/webpack-dev-server/server.pem\n<i> [webpack-dev-server] Project is running at:\n<i> Loopback: https://localhost:<port>/, https://<ip-v4>:<port>/, https://[<ip-v6>]:<port>/\n<i> [webpack-dev-server] On Your Network (IPv4): https://<ip-v4>:<port>/\n<i> [webpack-dev-server] On Your Network (IPv6): https://[<ip-v6>]:<port>/\n<i> [webpack-dev-server] Content not from webpack is served from '<cwd>/public' directory\"\n`;\n\nexports[`\"server\" CLI options should work using \"--server-type http\" 1`] = `\n\"<i> [webpack-dev-server] Project is running at:\n<i> Loopback: http://localhost:<port>/, http://<ip-v4>:<port>/, http://[<ip-v6>]:<port>/\n<i> [webpack-dev-server] On Your Network (IPv4): http://<ip-v4>:<port>/\n<i> [webpack-dev-server] On Your Network (IPv6): http://[<ip-v6>]:<port>/\n<i> [webpack-dev-server] Content not from webpack is served from '<cwd>/public' directory\"\n`;\n\nexports[`\"server\" CLI options should work using \"--server-type https\" 1`] = `\n\"<i> [webpack-dev-server] Generating SSL certificate...\n<i> [webpack-dev-server] SSL certificate: <cwd>/node_modules/.cache/webpack-dev-server/server.pem\n<i> [webpack-dev-server] Project is running at:\n<i> Loopback: https://localhost:<port>/, https://<ip-v4>:<port>/, https://[<ip-v6>]:<port>/\n<i> [webpack-dev-server] On Your Network (IPv4): https://<ip-v4>:<port>/\n<i> [webpack-dev-server] On Your Network (IPv6): https://[<ip-v6>]:<port>/\n<i> [webpack-dev-server] Content not from webpack is served from '<cwd>/public' directory\"\n`;\n\nexports[`\"server\" CLI options should work using \"--server-type spdy\" 1`] = `\n\"<i> [webpack-dev-server] Generating SSL certificate...\n<i> [webpack-dev-server] SSL certificate: <cwd>/node_modules/.cache/webpack-dev-server/server.pem\n<i> [webpack-dev-server] Project is running at:\n<i> Loopback: https://localhost:<port>/, https://<ip-v4>:<port>/, https://[<ip-v6>]:<port>/\n<i> [webpack-dev-server] On Your Network (IPv4): https://<ip-v4>:<port>/\n<i> [webpack-dev-server] On Your Network (IPv6): https://[<ip-v6>]:<port>/\n<i> [webpack-dev-server] Content not from webpack is served from '<cwd>/public' directory\"\n`;\n"
  },
  {
    "path": "test/cli/__snapshots__/static-option.test.js.snap.webpack5",
    "content": "// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing\n\nexports[`\"static\" CLI option should work using \"--no-static-serve-index\": stderr 1`] = `\n\"<i> [webpack-dev-server] Project is running at:\n<i> Loopback: http://localhost:<port>/, http://<ip-v4>:<port>/, http://[<ip-v6>]:<port>/\n<i> [webpack-dev-server] On Your Network (IPv4): http://<ip-v4>:<port>/\n<i> [webpack-dev-server] On Your Network (IPv6): http://[<ip-v6>]:<port>/\n<i> [webpack-dev-server] Content not from webpack is served from '<cwd>/public' directory\"\n`;\n\nexports[`\"static\" CLI option should work using \"--no-static-watch\": stderr 1`] = `\n\"<i> [webpack-dev-server] Project is running at:\n<i> Loopback: http://localhost:<port>/, http://<ip-v4>:<port>/, http://[<ip-v6>]:<port>/\n<i> [webpack-dev-server] On Your Network (IPv4): http://<ip-v4>:<port>/\n<i> [webpack-dev-server] On Your Network (IPv6): http://[<ip-v6>]:<port>/\n<i> [webpack-dev-server] Content not from webpack is served from '<cwd>/public' directory\"\n`;\n\nexports[`\"static\" CLI option should work using \"--static new-static --static other-static\": stderr 1`] = `\n\"<i> [webpack-dev-server] Project is running at:\n<i> Loopback: http://localhost:<port>/, http://<ip-v4>:<port>/, http://[<ip-v6>]:<port>/\n<i> [webpack-dev-server] On Your Network (IPv4): http://<ip-v4>:<port>/\n<i> [webpack-dev-server] On Your Network (IPv6): http://[<ip-v6>]:<port>/\n<i> [webpack-dev-server] Content not from webpack is served from 'new-static, other-static' directory\"\n`;\n\nexports[`\"static\" CLI option should work using \"--static new-static\": stderr 1`] = `\n\"<i> [webpack-dev-server] Project is running at:\n<i> Loopback: http://localhost:<port>/, http://<ip-v4>:<port>/, http://[<ip-v6>]:<port>/\n<i> [webpack-dev-server] On Your Network (IPv4): http://<ip-v4>:<port>/\n<i> [webpack-dev-server] On Your Network (IPv6): http://[<ip-v6>]:<port>/\n<i> [webpack-dev-server] Content not from webpack is served from 'new-static' directory\"\n`;\n\nexports[`\"static\" CLI option should work using \"--static\": stderr 1`] = `\n\"<i> [webpack-dev-server] Project is running at:\n<i> Loopback: http://localhost:<port>/, http://<ip-v4>:<port>/, http://[<ip-v6>]:<port>/\n<i> [webpack-dev-server] On Your Network (IPv4): http://<ip-v4>:<port>/\n<i> [webpack-dev-server] On Your Network (IPv6): http://[<ip-v6>]:<port>/\n<i> [webpack-dev-server] Content not from webpack is served from '<cwd>/public' directory\"\n`;\n\nexports[`\"static\" CLI option should work using \"--static-directory static-dir\": stderr 1`] = `\n\"<i> [webpack-dev-server] Project is running at:\n<i> Loopback: http://localhost:<port>/, http://<ip-v4>:<port>/, http://[<ip-v6>]:<port>/\n<i> [webpack-dev-server] On Your Network (IPv4): http://<ip-v4>:<port>/\n<i> [webpack-dev-server] On Your Network (IPv6): http://[<ip-v6>]:<port>/\n<i> [webpack-dev-server] Content not from webpack is served from 'static-dir' directory\"\n`;\n\nexports[`\"static\" CLI option should work using \"--static-public-path /public\": stderr 1`] = `\n\"<i> [webpack-dev-server] Project is running at:\n<i> Loopback: http://localhost:<port>/, http://<ip-v4>:<port>/, http://[<ip-v6>]:<port>/\n<i> [webpack-dev-server] On Your Network (IPv4): http://<ip-v4>:<port>/\n<i> [webpack-dev-server] On Your Network (IPv6): http://[<ip-v6>]:<port>/\n<i> [webpack-dev-server] Content not from webpack is served from '<cwd>/public' directory\"\n`;\n\nexports[`\"static\" CLI option should work using \"--static-public-path-reset\": stderr 1`] = `\n\"<i> [webpack-dev-server] Project is running at:\n<i> Loopback: http://localhost:<port>/, http://<ip-v4>:<port>/, http://[<ip-v6>]:<port>/\n<i> [webpack-dev-server] On Your Network (IPv4): http://<ip-v4>:<port>/\n<i> [webpack-dev-server] On Your Network (IPv6): http://[<ip-v6>]:<port>/\n<i> [webpack-dev-server] Content not from webpack is served from '<cwd>/public' directory\"\n`;\n\nexports[`\"static\" CLI option should work using \"--static-reset --static-directory new-static-directory\": stderr 1`] = `\n\"<i> [webpack-dev-server] Project is running at:\n<i> Loopback: http://localhost:<port>/, http://<ip-v4>:<port>/, http://[<ip-v6>]:<port>/\n<i> [webpack-dev-server] On Your Network (IPv4): http://<ip-v4>:<port>/\n<i> [webpack-dev-server] On Your Network (IPv6): http://[<ip-v6>]:<port>/\n<i> [webpack-dev-server] Content not from webpack is served from 'new-static-directory' directory\"\n`;\n\nexports[`\"static\" CLI option should work using \"--static-reset\": stderr 1`] = `\n\"<i> [webpack-dev-server] Project is running at:\n<i> Loopback: http://localhost:<port>/, http://<ip-v4>:<port>/, http://[<ip-v6>]:<port>/\n<i> [webpack-dev-server] On Your Network (IPv4): http://<ip-v4>:<port>/\n<i> [webpack-dev-server] On Your Network (IPv6): http://[<ip-v6>]:<port>/\n<i> [webpack-dev-server] Content not from webpack is served from 'new-static-after-reset' directory\"\n`;\n\nexports[`\"static\" CLI option should work using \"--static-serve-index\": stderr 1`] = `\n\"<i> [webpack-dev-server] Project is running at:\n<i> Loopback: http://localhost:<port>/, http://<ip-v4>:<port>/, http://[<ip-v6>]:<port>/\n<i> [webpack-dev-server] On Your Network (IPv4): http://<ip-v4>:<port>/\n<i> [webpack-dev-server] On Your Network (IPv6): http://[<ip-v6>]:<port>/\n<i> [webpack-dev-server] Content not from webpack is served from '<cwd>/public' directory\"\n`;\n\nexports[`\"static\" CLI option should work using \"--static-watch\": stderr 1`] = `\n\"<i> [webpack-dev-server] Project is running at:\n<i> Loopback: http://localhost:<port>/, http://<ip-v4>:<port>/, http://[<ip-v6>]:<port>/\n<i> [webpack-dev-server] On Your Network (IPv4): http://<ip-v4>:<port>/\n<i> [webpack-dev-server] On Your Network (IPv6): http://[<ip-v6>]:<port>/\n<i> [webpack-dev-server] Content not from webpack is served from '<cwd>/public' directory\"\n`;\n"
  },
  {
    "path": "test/cli/__snapshots__/watchFiles-option.test.js.snap.webpack5",
    "content": "// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing\n\nexports[`\"watchFiles\" CLI option should work using \"--watch-files <value> --watch-files <other-value>\": stderr 1`] = `\n\"<i> [webpack-dev-server] Project is running at:\n<i> Loopback: http://localhost:<port>/, http://<ip-v4>:<port>/, http://[<ip-v6>]:<port>/\n<i> [webpack-dev-server] On Your Network (IPv4): http://<ip-v4>:<port>/\n<i> [webpack-dev-server] On Your Network (IPv6): http://[<ip-v6>]:<port>/\n<i> [webpack-dev-server] Content not from webpack is served from '<cwd>/public' directory\"\n`;\n\nexports[`\"watchFiles\" CLI option should work using \"--watch-files <value>\": stderr 1`] = `\n\"<i> [webpack-dev-server] Project is running at:\n<i> Loopback: http://localhost:<port>/, http://<ip-v4>:<port>/, http://[<ip-v6>]:<port>/\n<i> [webpack-dev-server] On Your Network (IPv4): http://<ip-v4>:<port>/\n<i> [webpack-dev-server] On Your Network (IPv6): http://[<ip-v6>]:<port>/\n<i> [webpack-dev-server] Content not from webpack is served from '<cwd>/public' directory\"\n`;\n\nexports[`\"watchFiles\" CLI option should work using \"--watch-files-reset --watch-files <static>\": stderr 1`] = `\n\"<i> [webpack-dev-server] Project is running at:\n<i> Loopback: http://localhost:<port>/, http://<ip-v4>:<port>/, http://[<ip-v6>]:<port>/\n<i> [webpack-dev-server] On Your Network (IPv4): http://<ip-v4>:<port>/\n<i> [webpack-dev-server] On Your Network (IPv6): http://[<ip-v6>]:<port>/\n<i> [webpack-dev-server] Content not from webpack is served from '<cwd>/public' directory\"\n`;\n"
  },
  {
    "path": "test/cli/allowedHosts-option.test.js",
    "content": "\"use strict\";\n\nconst { testBin } = require(\"../helpers/test-bin\");\nconst port = require(\"../ports-map\")[\"cli-allowed-hosts\"];\n\ndescribe('\"allowedHosts\" CLI option', () => {\n  it('should work using \"--allowed-hosts auto\"', async () => {\n    const { exitCode } = await testBin([\n      \"--port\",\n      port,\n      \"--allowed-hosts\",\n      \"auto\",\n    ]);\n\n    expect(exitCode).toBe(0);\n  });\n\n  it('should work using \"--allowed-hosts all\"', async () => {\n    const { exitCode } = await testBin([\n      \"--port\",\n      port,\n      \"--allowed-hosts\",\n      \"all\",\n    ]);\n\n    expect(exitCode).toBe(0);\n  });\n\n  it('should work using \"--allowed-hosts testhouse.com\"', async () => {\n    const { exitCode } = await testBin([\n      \"--port\",\n      port,\n      \"--allowed-hosts\",\n      \"testhouse.com\",\n    ]);\n\n    expect(exitCode).toBe(0);\n  });\n\n  it('should work using \"--allowed-hosts testhost.com --allowed-hosts testhost1.com\"', async () => {\n    const { exitCode } = await testBin([\n      \"--port\",\n      port,\n      \"--allowed-hosts\",\n      \"testhost.com\",\n      \"--allowed-hosts\",\n      \"testhost1.com\",\n    ]);\n\n    expect(exitCode).toBe(0);\n  });\n});\n"
  },
  {
    "path": "test/cli/basic.test.js",
    "content": "\"use strict\";\n\nconst path = require(\"node:path\");\nconst util = require(\"node:util\");\nconst execa = require(\"execa\");\nconst { normalizeStderr, testBin } = require(\"../helpers/test-bin\");\nconst port = require(\"../ports-map\")[\"cli-basic\"];\n\nconst isMacOS = process.platform === \"darwin\";\n\ndescribe(\"basic\", () => {\n  describe(\"should output help\", () => {\n    (isMacOS ? it.skip : it)(\"should generate correct cli flags\", async () => {\n      const { exitCode, stdout } = await testBin([\"--help\"]);\n\n      // eslint-disable-next-line jest/no-standalone-expect\n      expect(exitCode).toBe(0);\n      // eslint-disable-next-line jest/no-standalone-expect\n      expect(util.stripVTControlCharacters(stdout)).toMatchSnapshot();\n    });\n  });\n\n  describe(\"basic\", () => {\n    it(\"should work\", async () => {\n      const { exitCode, stderr } = await testBin([\n        // Ideally it should be empty to test without arguments, unfortunately it takes 8080 port and other test can failed\n        \"--port\",\n        port,\n      ]);\n\n      expect(exitCode).toBe(0);\n      expect(normalizeStderr(stderr, { ipv6: true })).toMatchSnapshot(\"stderr\");\n    });\n\n    it('should work using \"--host localhost --port <port>\"', async () => {\n      const { exitCode, stderr } = await testBin([\n        \"--port\",\n        port,\n        \"--host\",\n        \"localhost\",\n      ]);\n\n      expect(exitCode).toBe(0);\n      expect(normalizeStderr(stderr)).toMatchSnapshot(\"stderr\");\n    });\n\n    it(\"should accept the promise function of webpack.config.js\", async () => {\n      const { exitCode, stderr } = await testBin([\n        \"--config\",\n        path.resolve(\n          __dirname,\n          \"../fixtures/cli-promise-config/webpack.config.js\",\n        ),\n        \"--port\",\n        port,\n      ]);\n\n      expect(exitCode).toBe(0);\n      expect(normalizeStderr(stderr, { ipv6: true })).toMatchSnapshot(\"stderr\");\n    });\n\n    it(\"should work using multi compiler mode\", async () => {\n      const { exitCode, stderr } = await testBin([\n        \"--config\",\n        path.resolve(\n          __dirname,\n          \"../fixtures/cli-universal-compiler-config/webpack.config.js\",\n        ),\n        \"--port\",\n        port,\n      ]);\n\n      expect(exitCode).toBe(0);\n      expect(normalizeStderr(stderr, { ipv6: true })).toMatchSnapshot(\"stderr\");\n    });\n\n    it(\"should exit the process when SIGINT is detected\", (done) => {\n      const cliPath = path.resolve(\n        __dirname,\n        \"../../bin/webpack-dev-server.js\",\n      );\n      const examplePath = path.resolve(\n        __dirname,\n        \"../../examples/client/web-socket-url\",\n      );\n      const cp = execa(\"node\", [\"--port\", port, cliPath], { cwd: examplePath });\n\n      cp.stdout.on(\"data\", (data) => {\n        const bits = data.toString();\n\n        if (/main.js/.test(bits)) {\n          expect(cp.pid).not.toBe(0);\n\n          cp.kill(\"SIGINT\");\n        }\n      });\n\n      cp.on(\"exit\", () => {\n        done();\n      });\n    });\n\n    it(\"should exit the process when SIGINT is detected, even before the compilation is done\", (done) => {\n      const cliPath = path.resolve(\n        __dirname,\n        \"../../bin/webpack-dev-server.js\",\n      );\n      const cwd = path.resolve(__dirname, \"../fixtures/cli\");\n      const cp = execa(\"node\", [\"--port\", port, cliPath], { cwd });\n\n      let killed = false;\n\n      cp.stdout.on(\"data\", () => {\n        if (!killed) {\n          expect(cp.pid).not.toBe(0);\n\n          cp.kill(\"SIGINT\");\n        }\n\n        killed = true;\n      });\n\n      cp.on(\"exit\", () => {\n        done();\n      });\n    });\n\n    it(\"should exit the process when stdin ends if --watch-options-stdin\", (done) => {\n      const cliPath = path.resolve(\n        __dirname,\n        \"../../bin/webpack-dev-server.js\",\n      );\n      const examplePath = path.resolve(\n        __dirname,\n        \"../../examples/client/web-socket-url\",\n      );\n      const cp = execa(\n        \"node\",\n        [cliPath, \"--port\", port, \"--watch-options-stdin\"],\n        {\n          cwd: examplePath,\n        },\n      );\n\n      cp.stdout.on(\"data\", (data) => {\n        const bits = data.toString();\n\n        if (/main.js/.test(bits)) {\n          expect(cp.pid).not.toBe(0);\n\n          cp.stdin.write(\"hello\");\n          cp.stdin.end(\"world\");\n        }\n      });\n\n      cp.on(\"exit\", () => {\n        done();\n      });\n    });\n\n    it(\"should exit the process when stdin ends if --watch-options-stdin, even before the compilation is done\", (done) => {\n      const cliPath = path.resolve(\n        __dirname,\n        \"../../bin/webpack-dev-server.js\",\n      );\n      const cwd = path.resolve(__dirname, \"../fixtures/cli\");\n      const cp = execa(\n        \"node\",\n        [cliPath, \"--port\", port, \"--watch-options-stdin\"],\n        { cwd },\n      );\n\n      let killed = false;\n\n      cp.on(\"error\", (error) => {\n        done(error);\n      });\n\n      cp.stdin.on(\"error\", (error) => {\n        done(error);\n      });\n\n      cp.stdout.on(\"data\", () => {\n        if (!killed) {\n          expect(cp.pid).not.toBe(0);\n\n          cp.stdin.write(\"hello\");\n          cp.stdin.end(\"world\");\n        }\n\n        killed = true;\n      });\n\n      cp.on(\"exit\", () => {\n        done();\n      });\n    });\n\n    it(\"should add dev server entry points to a single entry point\", async () => {\n      const { exitCode, stdout } = await testBin(\n        [\n          \"--port\",\n          port,\n          \"--config\",\n          \"./test/fixtures/cli-single-entry/webpack.config.js\",\n        ],\n        {\n          outputKillStr: /client\\/index\\.js\\?/,\n        },\n      );\n\n      expect(exitCode).toBe(0);\n      expect(stdout).toContain(\"client/index.js?\");\n    });\n\n    it(\"should add dev server entry points to a multi entry point object\", async () => {\n      const { exitCode, stdout } = await testBin(\n        [\n          \"--port\",\n          port,\n          \"--config\",\n          \"./test/fixtures/cli-multi-entry/webpack.config.js\",\n          \"--stats\",\n          \"verbose\",\n        ],\n        {\n          outputKillStr: /foo\\.js/,\n        },\n      );\n\n      expect(exitCode).toBe(0);\n      expect(stdout).toContain(\"client/index.js?\");\n      expect(stdout).toContain(\"foo.js\");\n    });\n\n    it(\"should add dev server entry points to an empty entry object\", async () => {\n      const { exitCode, stdout } = await testBin(\n        [\n          \"--port\",\n          port,\n          \"--config\",\n          \"./test/fixtures/cli-empty-entry/webpack.config.js\",\n        ],\n        {\n          outputKillStr: /client\\/index\\.js\\?/,\n        },\n      );\n\n      expect(exitCode).toBe(0);\n      expect(stdout).toContain(\"client/index.js?\");\n    });\n\n    it(\"should supports entry as descriptor\", async () => {\n      const { exitCode, stdout } = await testBin(\n        [\n          \"--port\",\n          port,\n          \"--config\",\n          \"./test/fixtures/cli-entry-as-descriptor/webpack.config\",\n          \"--stats\",\n          \"detailed\",\n        ],\n        {\n          outputKillStr: /foo\\.js/,\n        },\n      );\n\n      expect(exitCode).toBe(0);\n      expect(stdout).toContain(\"foo.js\");\n    });\n\n    it('should only prepends dev server entry points to \"web\" target', async () => {\n      const { exitCode, stdout } = await testBin(\n        [\"--port\", port, \"--target\", \"web\"],\n        {\n          outputKillStr: /foo\\.js/,\n        },\n      );\n\n      expect(exitCode).toBe(0);\n      expect(stdout).toContain(\"client/index.js?\");\n      expect(stdout).toContain(\"foo.js\");\n    });\n\n    it('should not prepend dev server entry points to \"node\" target', async () => {\n      const { exitCode, stdout } = await testBin(\n        [\"--port\", port, \"--target\", \"node\"],\n        {\n          outputKillStr: /foo\\.js/,\n        },\n      );\n\n      expect(exitCode).toBe(0);\n      expect(stdout).not.toContain(\"client/index.js?\");\n      expect(stdout).toContain(\"foo.js\");\n    });\n\n    it('should prepends the hot runtime to \"node\" target as well', async () => {\n      const { exitCode, stdout } = await testBin(\n        [\"--port\", port, \"--target\", \"node\", \"--hot\"],\n        {\n          outputKillStr: /webpack\\/hot\\/dev-server/,\n        },\n      );\n\n      expect(exitCode).toBe(0);\n      expect(stdout).toContain(\"webpack/hot/dev-server\");\n    });\n\n    it(\"should prepend dev server entry points depending on targetProperties\", async () => {\n      const { exitCode, stdout } = await testBin(\n        [\n          \"--port\",\n          port,\n          \"--config\",\n          \"./test/fixtures/cli-target-config/webpack.config.js\",\n        ],\n        {\n          outputKillStr: /client\\/index\\.js/,\n        },\n      );\n\n      expect(exitCode).toBe(0);\n      expect(stdout).toContain(\"client/index.js\");\n    });\n\n    // eslint-disable-next-line jest/no-disabled-tests\n    it.skip(\"should use different random port when multiple instances are started on different processes\", async () => {\n      const cliPath = path.resolve(\n        __dirname,\n        \"../../bin/webpack-dev-server.js\",\n      );\n      const cwd = path.resolve(__dirname, \"../fixtures/cli\");\n\n      const cp = execa(\"node\", [cliPath, \"--colors=false\"], { cwd });\n      const cp2 = execa(\"node\", [cliPath, \"--colors=false\"], { cwd });\n\n      const runtime = {\n        cp: {\n          port: null,\n          done: false,\n        },\n        cp2: {\n          port: null,\n          done: false,\n        },\n      };\n\n      cp.stderr.on(\"data\", (data) => {\n        const bits = data.toString();\n        const portMatch =\n          /Project is running at http:\\/\\/localhost:(\\d*)\\//.exec(bits);\n\n        if (portMatch) {\n          [, runtime.cp.port] = portMatch;\n        }\n\n        if (/Compiled successfully/.test(bits)) {\n          expect(cp.pid).not.toBe(0);\n          cp.kill(\"SIGINT\");\n        }\n      });\n\n      cp2.stderr.on(\"data\", (data) => {\n        const bits = data.toString();\n        const portMatch =\n          /Project is running at http:\\/\\/localhost:(\\d*)\\//.exec(bits);\n\n        if (portMatch) {\n          [, runtime.cp2.port] = portMatch;\n        }\n\n        if (/Compiled successfully/.test(bits)) {\n          expect(cp.pid).not.toBe(0);\n          cp2.kill(\"SIGINT\");\n        }\n      });\n\n      cp.on(\"exit\", () => {\n        runtime.cp.done = true;\n        if (runtime.cp2.done) {\n          expect(runtime.cp.port).not.toBe(runtime.cp2.port);\n        }\n      });\n\n      cp2.on(\"exit\", () => {\n        runtime.cp2.done = true;\n\n        if (runtime.cp.done) {\n          expect(runtime.cp.port).not.toBe(runtime.cp2.port);\n        }\n      });\n    });\n  });\n});\n"
  },
  {
    "path": "test/cli/bonjour-option.test.js",
    "content": "\"use strict\";\n\nconst fs = require(\"node:fs\");\nconst Server = require(\"../../lib/Server\");\nconst { normalizeStderr, testBin } = require(\"../helpers/test-bin\");\nconst port = require(\"../ports-map\")[\"cli-bonjour\"];\n\nconst defaultCertificateDir = Server.findCacheDir();\n\ndescribe('\"bonjour\" CLI option', () => {\n  beforeEach(async () => {\n    fs.rmSync(defaultCertificateDir, { recursive: true, force: true });\n  });\n\n  it('should work using \"--bonjour\"', async () => {\n    const { exitCode, stderr } = await testBin([\"--port\", port, \"--bonjour\"], {\n      outputKillStr: /Broadcasting/,\n    });\n\n    expect(exitCode).toBe(0);\n    expect(normalizeStderr(stderr, { ipv6: true })).toMatchSnapshot();\n  });\n\n  it('should work using \"--bonjour and --server-type=https\"', async () => {\n    const { exitCode, stderr } = await testBin(\n      [\"--port\", port, \"--bonjour\", \"--server-type=https\"],\n      {\n        outputKillStr: /Broadcasting/,\n      },\n    );\n\n    expect(exitCode).toBe(0);\n    expect(\n      normalizeStderr(stderr, { ipv6: true, https: true }),\n    ).toMatchSnapshot();\n  });\n\n  it('should work using \"--no-bonjour\"', async () => {\n    const { exitCode, stderr } = await testBin([\n      \"--port\",\n      port,\n      \"--no-bonjour\",\n    ]);\n\n    expect(exitCode).toBe(0);\n    expect(normalizeStderr(stderr, { ipv6: true })).toMatchSnapshot();\n  });\n});\n"
  },
  {
    "path": "test/cli/client-option.test.js",
    "content": "\"use strict\";\n\nconst { testBin } = require(\"../helpers/test-bin\");\nconst port = require(\"../ports-map\")[\"cli-client\"];\n\ndescribe('\"client\" CLI option', () => {\n  it('should work using \"--client-web-socket-transport sockjs\"', async () => {\n    const { exitCode } = await testBin([\n      \"--port\",\n      port,\n      \"--client-web-socket-transport\",\n      \"sockjs\",\n    ]);\n\n    expect(exitCode).toBe(0);\n  });\n\n  it('should work using \"--client-web-socket-transport ws\"', async () => {\n    const { exitCode } = await testBin([\n      \"--port\",\n      port,\n      \"--client-web-socket-transport\",\n      \"ws\",\n    ]);\n\n    expect(exitCode).toBe(0);\n  });\n\n  it('should work using \"--client-overlay\"', async () => {\n    const { exitCode } = await testBin([\"--port\", port, \"--client-overlay\"]);\n\n    expect(exitCode).toBe(0);\n  });\n\n  it('should work using \"--no-client-overlay\"', async () => {\n    const { exitCode } = await testBin([\"--port\", port, \"--no-client-overlay\"]);\n\n    expect(exitCode).toBe(0);\n  });\n\n  it('should work using \"--client-overlay-errors\"', async () => {\n    const { exitCode } = await testBin([\n      \"--port\",\n      port,\n      \"--client-overlay-errors\",\n    ]);\n\n    expect(exitCode).toBe(0);\n  });\n\n  it('should work using \"--no-client-overlay-errors\"', async () => {\n    const { exitCode } = await testBin([\n      \"--port\",\n      port,\n      \"--no-client-overlay-errors\",\n    ]);\n\n    expect(exitCode).toBe(0);\n  });\n\n  it('should work using \"--client-overlay-warnings\"', async () => {\n    const { exitCode } = await testBin([\n      \"--port\",\n      port,\n      \"--client-overlay-warnings\",\n    ]);\n\n    expect(exitCode).toBe(0);\n  });\n\n  it('should work using \"--no-client-overlay-warnings\"', async () => {\n    const { exitCode } = await testBin([\n      \"--port\",\n      port,\n      \"--no-client-overlay-warnings\",\n    ]);\n\n    expect(exitCode).toBe(0);\n  });\n\n  it('should work using \"--client-logging\"', async () => {\n    const { exitCode } = await testBin([\n      \"--port\",\n      port,\n      \"--client-logging\",\n      \"verbose\",\n    ]);\n\n    expect(exitCode).toBe(0);\n  });\n\n  it('should work using \"--client-progress\"', async () => {\n    const { exitCode } = await testBin([\"--port\", port, \"--client-progress\"]);\n\n    expect(exitCode).toBe(0);\n  });\n\n  it('should work using \"--no-client-progress\"', async () => {\n    const { exitCode } = await testBin([\n      \"--port\",\n      port,\n      \"--no-client-progress\",\n    ]);\n\n    expect(exitCode).toBe(0);\n  });\n\n  it('should work using \"--client-reconnect\"', async () => {\n    const { exitCode } = await testBin([\"--port\", port, \"--client-reconnect\"]);\n\n    expect(exitCode).toBe(0);\n  });\n\n  it('should work using \"--client-reconnect <value>\"', async () => {\n    const { exitCode } = await testBin([\n      \"--port\",\n      port,\n      \"--client-reconnect\",\n      5,\n    ]);\n\n    expect(exitCode).toBe(0);\n  });\n\n  it('should work using \"--no-client-reconnect\"', async () => {\n    const { exitCode } = await testBin([\n      \"--port\",\n      port,\n      \"--no-client-reconnect\",\n    ]);\n\n    expect(exitCode).toBe(0);\n  });\n\n  it('should work using \"--client-web-socket-url\"', async () => {\n    const { exitCode } = await testBin([\n      \"--port\",\n      port,\n      \"--client-web-socket-url\",\n      \"ws://myhost.com:8080/foo/test\",\n    ]);\n\n    expect(exitCode).toBe(0);\n  });\n\n  it('should work using \"--client-web-socket-url-protocol\"', async () => {\n    const { exitCode } = await testBin([\n      \"--port\",\n      port,\n      \"--client-web-socket-url-protocol\",\n      \"ws:\",\n    ]);\n\n    expect(exitCode).toBe(0);\n  });\n\n  it('should work using \"--client-web-socket-url-hostname\"', async () => {\n    const { exitCode } = await testBin([\n      \"--port\",\n      port,\n      \"--client-web-socket-url-hostname\",\n      \"0.0.0.0\",\n    ]);\n\n    expect(exitCode).toBe(0);\n  });\n\n  it('should work using \"--client-web-socket-url-pathname\"', async () => {\n    const { exitCode } = await testBin([\n      \"--port\",\n      port,\n      \"--client-web-socket-url-pathname\",\n      \"/ws\",\n    ]);\n\n    expect(exitCode).toBe(0);\n  });\n\n  it('should work using \"--client-web-socket-url-port\"', async () => {\n    const { exitCode } = await testBin([\n      \"--port\",\n      port,\n      \"--client-web-socket-url-port\",\n      8080,\n    ]);\n\n    expect(exitCode).toBe(0);\n  });\n});\n"
  },
  {
    "path": "test/cli/colors.test.js",
    "content": "\"use strict\";\n\nconst { normalizeStderr, testBin } = require(\"../helpers/test-bin\");\nconst port = require(\"../ports-map\")[\"cli-colors\"];\n\nconst colorsDefaultStats = require.resolve(\n  \"../fixtures/cli-colors-default-stats/webpack.config\",\n);\nconst colorsDisabled = require.resolve(\n  \"../fixtures/cli-colors-disabled/webpack.config\",\n);\nconst colorsEnabled = require.resolve(\n  \"../fixtures/cli-colors-enabled/webpack.config\",\n);\n\ndescribe(\"colors\", () => {\n  it(\"should work use colors by default\", async () => {\n    const { exitCode, stderr } = await testBin([\n      \"--port\",\n      port,\n      \"--color\",\n      colorsDefaultStats,\n    ]);\n\n    expect(exitCode).toBe(0);\n    expect(normalizeStderr(stderr, { ipv6: true })).toMatchSnapshot(\"stderr\");\n    expect(stderr).toContain(\"\\u001B[\");\n  });\n\n  it('should work use colors using \"--color\"', async () => {\n    const { exitCode, stderr } = await testBin([\"--port\", port, \"--color\"]);\n\n    expect(exitCode).toBe(0);\n    expect(normalizeStderr(stderr, { ipv6: true })).toMatchSnapshot(\"stderr\");\n    expect(stderr).toContain(\"\\u001B[\");\n  });\n\n  it('should work do not use colors using \"--no-color\"', async () => {\n    const { exitCode, stderr } = await testBin([\"--port\", port, \"--no-color\"]);\n\n    expect(exitCode).toBe(0);\n    expect(normalizeStderr(stderr, { ipv6: true })).toMatchSnapshot(\"stderr\");\n    expect(stderr).not.toContain(\"\\u001B[\");\n  });\n\n  it(\"should work use colors using configuration with enabled colors\", async () => {\n    const { exitCode, stderr } = await testBin([\n      \"--port\",\n      port,\n      \"--config\",\n      colorsEnabled,\n    ]);\n\n    expect(exitCode).toBe(0);\n    expect(normalizeStderr(stderr, { ipv6: true })).toMatchSnapshot(\"stderr\");\n    expect(stderr).toContain(\"\\u001B[\");\n  });\n\n  it(\"should work and do not use colors using configuration with disabled colors\", async () => {\n    const { exitCode, stderr } = await testBin([\n      \"--port\",\n      port,\n      \"--config\",\n      colorsDisabled,\n    ]);\n\n    expect(exitCode).toBe(0);\n    expect(normalizeStderr(stderr, { ipv6: true })).toMatchSnapshot(\"stderr\");\n    expect(stderr).not.toContain(\"\\u001B[\");\n  });\n});\n"
  },
  {
    "path": "test/cli/compress-option.test.js",
    "content": "\"use strict\";\n\nconst { testBin } = require(\"../helpers/test-bin\");\nconst port = require(\"../ports-map\")[\"cli-compress\"];\n\ndescribe('\"compress\" CLI option', () => {\n  it('should work using \"--compress\"', async () => {\n    const { exitCode } = await testBin([\"--port\", port, \"--compress\"]);\n\n    expect(exitCode).toBe(0);\n  });\n\n  it('should work using \"--no-compress\"', async () => {\n    const { exitCode } = await testBin([\"--port\", port, \"--no-compress\"]);\n\n    expect(exitCode).toBe(0);\n  });\n});\n"
  },
  {
    "path": "test/cli/historyApiFallback-option.test.js",
    "content": "\"use strict\";\n\nconst { normalizeStderr, testBin } = require(\"../helpers/test-bin\");\nconst port = require(\"../ports-map\")[\"cli-history-api-fallback\"];\n\ndescribe('\"historyApiFallback\" CLI option', () => {\n  it('should work using \"--history-api-fallback\"', async () => {\n    const { exitCode, stderr } = await testBin(\n      [\"--port\", port, \"--history-api-fallback\"],\n      {\n        outputKillStr: /404s will fallback/,\n      },\n    );\n\n    expect(exitCode).toBe(0);\n    expect(normalizeStderr(stderr, { ipv6: true })).toMatchSnapshot();\n  });\n\n  it('should work using \"--no-history-api-fallback\"', async () => {\n    const { exitCode, stderr } = await testBin([\n      \"--port\",\n      port,\n      \"--no-history-api-fallback\",\n    ]);\n\n    expect(exitCode).toBe(0);\n    expect(normalizeStderr(stderr, { ipv6: true })).toMatchSnapshot();\n  });\n});\n"
  },
  {
    "path": "test/cli/host-option.test.js",
    "content": "\"use strict\";\n\nconst os = require(\"node:os\");\nconst Server = require(\"../../lib/Server\");\nconst { normalizeStderr, testBin } = require(\"../helpers/test-bin\");\nconst port = require(\"../ports-map\")[\"cli-host\"];\n\nconst localIPv4 = Server.findIp(\"v4\", false);\nconst localIPv6 = Server.findIp(\"v6\", false);\n\ndescribe('\"host\" CLI option', () => {\n  it('should work using \"--host 0.0.0.0\" (IPv4)', async () => {\n    const { exitCode, stderr } = await testBin([\n      \"--port\",\n      port,\n      \"--host\",\n      \"0.0.0.0\",\n    ]);\n\n    expect(exitCode).toBe(0);\n    expect(normalizeStderr(stderr, { ipv6: true })).toMatchSnapshot(\"stderr\");\n  });\n\n  it('should work using \"--host ::\" (IPv6)', async () => {\n    const { exitCode, stderr } = await testBin([\n      \"--port\",\n      port,\n      \"--host\",\n      \"::\",\n    ]);\n\n    expect(exitCode).toBe(0);\n    expect(normalizeStderr(stderr, { ipv6: true })).toMatchSnapshot(\"stderr\");\n  });\n\n  it('should work using \"--host ::1\" (IPv6)', async () => {\n    const { exitCode, stderr } = await testBin([\n      \"--port\",\n      port,\n      \"--host\",\n      \"::1\",\n    ]);\n\n    expect(exitCode).toBe(0);\n    expect(normalizeStderr(stderr)).toMatchSnapshot(\"stderr\");\n  });\n\n  it('should work using \"--host localhost\"', async () => {\n    const { exitCode, stderr } = await testBin([\n      \"--port\",\n      port,\n      \"--host\",\n      \"localhost\",\n    ]);\n\n    expect(exitCode).toBe(0);\n    expect(normalizeStderr(stderr)).toMatchSnapshot(\"stderr\");\n  });\n\n  it('should work using \"--host 127.0.0.1\" (IPv4)', async () => {\n    const { exitCode, stderr } = await testBin([\n      \"--port\",\n      port,\n      \"--host\",\n      \"127.0.0.1\",\n    ]);\n\n    expect(exitCode).toBe(0);\n    expect(normalizeStderr(stderr)).toMatchSnapshot(\"stderr\");\n  });\n\n  it('should work using \"--host <IPv4>\"', async () => {\n    const { exitCode, stderr } = await testBin([\n      \"--port\",\n      port,\n      \"--host\",\n      localIPv4,\n    ]);\n\n    expect(exitCode).toBe(0);\n    expect(normalizeStderr(stderr)).toMatchSnapshot(\"stderr\");\n  });\n\n  // eslint-disable-next-line jest/no-disabled-tests\n  it.skip('should work using \"--host <IPv6>\"', async () => {\n    const { exitCode, stderr } = await testBin([\n      \"--port\",\n      port,\n      \"--host\",\n      localIPv6,\n    ]);\n\n    expect(exitCode).toBe(0);\n    expect(normalizeStderr(stderr)).toMatchSnapshot(\"stderr\");\n  });\n\n  it('should work using \"--host local-ip\"', async () => {\n    const { exitCode, stderr } = await testBin([\n      \"--port\",\n      port,\n      \"--host\",\n      \"local-ip\",\n    ]);\n\n    expect(exitCode).toBe(0);\n    expect(normalizeStderr(stderr)).toMatchSnapshot(\"stderr\");\n  });\n\n  // eslint-disable-next-line jest/no-disabled-tests\n  it.skip('should work using \"--host local-ip\" take the first network found', async () => {\n    const { exitCode, stderr } = await testBin([\n      \"--port\",\n      port,\n      \"--host\",\n      \"local-ip\",\n    ]);\n\n    expect(exitCode).toBe(0);\n    jest.spyOn(os, \"networkInterfaces\").mockImplementation(() => ({\n      lo: [\n        {\n          address: \"127.0.0.1\",\n          netmask: \"255.0.0.0\",\n          family: \"IPv4\",\n          mac: \"00:00:00:00:00:00\",\n          internal: true,\n          cidr: \"127.0.0.1/8\",\n        },\n        {\n          address: \"::1\",\n          netmask: \"ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff\",\n          family: \"IPv6\",\n          mac: \"00:00:00:00:00:00\",\n          internal: true,\n          cidr: \"::1/128\",\n          scopeid: 0,\n        },\n      ],\n      enp6s0: [\n        {\n          address: \"192.168.1.15\",\n          netmask: \"255.255.255.0\",\n          family: \"IPv4\",\n          mac: \"50:eb:f6:97:9f:6f\",\n          internal: false,\n          cidr: \"192.168.1.15/24\",\n        },\n        {\n          address: \"2a01:cb0c:1623:6800:4ff8:723c:1a4b:fe5d\",\n          netmask: \"ffff:ffff:ffff:ffff::\",\n          family: \"IPv6\",\n          mac: \"50:eb:f6:97:9f:6f\",\n          internal: false,\n          cidr: \"2a01:cb0c:1623:6800:4ff8:723c:1a4b:fe5d/64\",\n          scopeid: 0,\n        },\n        {\n          address: \"2a01:cb0c:1623:6800:9acc:408c:ee87:27cf\",\n          netmask: \"ffff:ffff:ffff:ffff::\",\n          family: \"IPv6\",\n          mac: \"50:eb:f6:97:9f:6f\",\n          internal: false,\n          cidr: \"2a01:cb0c:1623:6800:9acc:408c:ee87:27cf/64\",\n          scopeid: 0,\n        },\n        {\n          address: \"fe80::bf2a:e5e2:8f9:4336\",\n          netmask: \"ffff:ffff:ffff:ffff::\",\n          family: \"IPv6\",\n          mac: \"50:eb:f6:97:9f:6f\",\n          internal: false,\n          cidr: \"fe80::bf2a:e5e2:8f9:4336/64\",\n          scopeid: 2,\n        },\n      ],\n      \"br-9bb0264f9b1c\": [\n        {\n          address: \"172.19.0.1\",\n          netmask: \"255.255.0.0\",\n          family: \"IPv4\",\n          mac: \"02:42:e4:c8:6e:5f\",\n          internal: false,\n          cidr: \"172.19.0.1/16\",\n        },\n        {\n          address: \"fe80::42:e4ff:fec8:6e5f\",\n          netmask: \"ffff:ffff:ffff:ffff::\",\n          family: \"IPv6\",\n          mac: \"02:42:e4:c8:6e:5f\",\n          internal: false,\n          cidr: \"fe80::42:e4ff:fec8:6e5f/64\",\n          scopeid: 4,\n        },\n      ],\n      \"br-a52e5d90701f\": [\n        {\n          address: \"172.18.0.1\",\n          netmask: \"255.255.0.0\",\n          family: \"IPv4\",\n          mac: \"02:42:f6:7e:a2:45\",\n          internal: false,\n          cidr: \"172.18.0.1/16\",\n        },\n        {\n          address: \"fe80::42:f6ff:fe7e:a245\",\n          netmask: \"ffff:ffff:ffff:ffff::\",\n          family: \"IPv6\",\n          mac: \"02:42:f6:7e:a2:45\",\n          internal: false,\n          cidr: \"fe80::42:f6ff:fe7e:a245/64\",\n          scopeid: 5,\n        },\n      ],\n      docker0: [\n        {\n          address: \"172.17.0.1\",\n          netmask: \"255.255.0.0\",\n          family: \"IPv4\",\n          mac: \"02:42:3e:89:61:cf\",\n          internal: false,\n          cidr: \"172.17.0.1/16\",\n        },\n      ],\n    }));\n    expect(stderr).not.toContain(\"172.17.0.1\");\n    expect(stderr).toContain(\"192.168.1.15\");\n  });\n\n  it('should work using \"--host local-ipv4\"', async () => {\n    const { exitCode, stderr } = await testBin([\n      \"--port\",\n      port,\n      \"--host\",\n      \"local-ipv4\",\n    ]);\n\n    expect(exitCode).toBe(0);\n    expect(normalizeStderr(stderr)).toMatchSnapshot(\"stderr\");\n  });\n});\n"
  },
  {
    "path": "test/cli/hot-option.test.js",
    "content": "\"use strict\";\n\nconst { testBin } = require(\"../helpers/test-bin\");\nconst port = require(\"../ports-map\")[\"cli-hot\"];\n\ndescribe('\"hot\" CLI option', () => {\n  it('should work using \"--hot\"', async () => {\n    const { exitCode, stdout } = await testBin(\n      [\"--port\", port, \"--hot\", \"--stats=detailed\"],\n      {\n        outputKillStr: /compiled successfully/,\n      },\n    );\n\n    expect(exitCode).toBe(0);\n    expect(stdout).toContain(\"webpack/hot/dev-server.js\");\n  });\n\n  it('should work using \"--no-hot\"', async () => {\n    const { exitCode, stdout } = await testBin(\n      [\"--port\", port, \"--no-hot\", \"--stats=detailed\"],\n      {\n        outputKillStr: /compiled successfully/,\n      },\n    );\n\n    expect(exitCode).toBe(0);\n    expect(stdout).not.toContain(\"webpack/hot/dev-server.js\");\n  });\n\n  it('should work using \"--hot only\"', async () => {\n    const { exitCode, stdout } = await testBin(\n      [\"--port\", port, \"--hot\", \"only\"],\n      {\n        outputKillStr: /compiled successfully/,\n      },\n    );\n\n    expect(exitCode).toBe(0);\n    expect(stdout).toContain(\"/hot/only-dev-server.js\");\n  });\n});\n"
  },
  {
    "path": "test/cli/ipc-option.test.js",
    "content": "\"use strict\";\n\nconst os = require(\"node:os\");\nconst path = require(\"node:path\");\nconst { normalizeStderr, testBin } = require(\"../helpers/test-bin\");\n\ndescribe('\"ipc\" CLI option', () => {\n  it('should work using \"--ipc\"', async () => {\n    const { exitCode, stderr } = await testBin([\"--ipc\"]);\n\n    expect(exitCode).toBe(0);\n    expect(normalizeStderr(stderr)).toMatchSnapshot(\"stderr\");\n  });\n\n  it('should work using \"--ipc=<string>\"', async () => {\n    const isWindows = process.platform === \"win32\";\n    const pipePrefix = isWindows ? \"\\\\\\\\.\\\\pipe\\\\\" : os.tmpdir();\n    const pipeName = \"webpack-dev-server.cli.sock\";\n    const ipc = path.join(pipePrefix, pipeName);\n\n    const { exitCode, stderr } = await testBin([\"--ipc\", ipc]);\n\n    expect(exitCode).toBe(0);\n    expect(normalizeStderr(stderr)).toMatchSnapshot(\"stderr\");\n  });\n});\n"
  },
  {
    "path": "test/cli/liveReload-option.test.js",
    "content": "\"use strict\";\n\nconst { testBin } = require(\"../helpers/test-bin\");\nconst port = require(\"../ports-map\")[\"cli-live-reload\"];\n\ndescribe('\"liveReload\" CLI option', () => {\n  it('should work using \"--live-reload\"', async () => {\n    const { exitCode } = await testBin([\"--port\", port, \"--live-reload\"]);\n\n    expect(exitCode).toBe(0);\n  });\n\n  it('should work using \"--no-live-reload\"', async () => {\n    const { exitCode } = await testBin([\"--port\", port, \"--no-live-reload\"]);\n\n    expect(exitCode).toBe(0);\n  });\n});\n"
  },
  {
    "path": "test/cli/open-option.test.js",
    "content": "\"use strict\";\n\nconst { testBin } = require(\"../helpers/test-bin\");\nconst port = require(\"../ports-map\")[\"cli-open\"];\n\ndescribe('\"open\" CLI option', () => {\n  it('should work using \"--open\"', async () => {\n    const { exitCode } = await testBin([\"--port\", port, \"--open\"]);\n\n    expect(exitCode).toBe(0);\n  });\n\n  it('should work using \"--open /index.html\"', async () => {\n    const { exitCode } = await testBin([\n      \"--port\",\n      port,\n      \"--open\",\n      \"/index.html\",\n    ]);\n\n    expect(exitCode).toBe(0);\n  });\n\n  it('should work using \"--open /first.html second.html\"', async () => {\n    const { exitCode } = await testBin([\n      \"--port\",\n      port,\n      \"--open\",\n      \"/first.html\",\n      \"second.html\",\n    ]);\n\n    expect(exitCode).toBe(0);\n  });\n\n  it('should work using \"--no-open\"', async () => {\n    const { exitCode } = await testBin([\"--no-open\", \"--port\", port]);\n\n    expect(exitCode).toBe(0);\n  });\n\n  it('should work using \"--open-reset --open /third.html\"', async () => {\n    const { exitCode } = await testBin([\n      \"--port\",\n      port,\n      \"--open-reset\",\n      \"--open\",\n      \"/third.html\",\n    ]);\n\n    expect(exitCode).toBe(0);\n  });\n\n  it('should work using \"--open-reset --open-target <url>\"', async () => {\n    const { exitCode } = await testBin([\n      \"--port\",\n      port,\n      \"--open-reset\",\n      \"--open-target\",\n      \"<url>\",\n    ]);\n\n    expect(exitCode).toBe(0);\n  });\n\n  it('should work using \"--open-reset --open-target /third.html\"', async () => {\n    const { exitCode } = await testBin([\n      \"--port\",\n      port,\n      \"--open-reset\",\n      \"--open-target\",\n      \"/third.html\",\n    ]);\n\n    expect(exitCode).toBe(0);\n  });\n\n  it('should work using \"--open-app-name google-chrome\"', async () => {\n    const { exitCode } = await testBin([\n      \"--port\",\n      port,\n      \"--open-app-name\",\n      \"google-chrome\",\n    ]);\n\n    expect(exitCode).toBe(0);\n  });\n\n  it('should work using \"--open-app-name-reset --open-app-name firefox\"', async () => {\n    const { exitCode } = await testBin([\n      \"--port\",\n      port,\n      \"--open-app-name-reset\",\n      \"--open-app-name\",\n      \"firefox\",\n    ]);\n\n    expect(exitCode).toBe(0);\n  });\n\n  it('should work using \"--open-target index.html\"', async () => {\n    const { exitCode } = await testBin([\n      \"--port\",\n      port,\n      \"--open-target\",\n      \"index.html\",\n    ]);\n\n    expect(exitCode).toBe(0);\n  });\n\n  it('should work using \"--open-target-reset --open-target first.html\"', async () => {\n    const { exitCode } = await testBin([\n      \"--port\",\n      port,\n      \"--open-target-reset\",\n      \"--open-target\",\n      \"first.html\",\n    ]);\n\n    expect(exitCode).toBe(0);\n  });\n\n  it('should work using \"--open-target /first.html second.html\"', async () => {\n    const { exitCode } = await testBin([\n      \"--port\",\n      port,\n      \"--open-target\",\n      \"/first.html\",\n      \"second.html\",\n    ]);\n\n    expect(exitCode).toBe(0);\n  });\n\n  it('should work using \"--open-target /index.html --open-app-name google-chrome\"', async () => {\n    const { exitCode } = await testBin([\n      \"--port\",\n      port,\n      \"--open-target\",\n      \"/index.html\",\n      \"--open-app-name\",\n      \"google-chrome\",\n    ]);\n\n    expect(exitCode).toBe(0);\n  });\n});\n"
  },
  {
    "path": "test/cli/port-option.test.js",
    "content": "\"use strict\";\n\nconst { normalizeStderr, testBin } = require(\"../helpers/test-bin\");\nconst port = require(\"../ports-map\")[\"cli-port-option\"];\n\ndescribe('\"port\" CLI option', () => {\n  it('should work using \"--port <string>\"', async () => {\n    const { exitCode, stderr } = await testBin([\"--port\", port]);\n\n    expect(exitCode).toBe(0);\n    expect(normalizeStderr(stderr, { ipv6: true })).toMatchSnapshot(\"stderr\");\n  });\n\n  it('should work using \"--port auto\"', async () => {\n    const { exitCode, stderr } = await testBin([\"--port\", \"auto\"]);\n\n    expect(exitCode).toBe(0);\n    expect(normalizeStderr(stderr, { ipv6: true })).toMatchSnapshot(\"stderr\");\n  });\n});\n"
  },
  {
    "path": "test/cli/server-option.test.js",
    "content": "\"use strict\";\n\nconst path = require(\"node:path\");\nconst { rimraf } = require(\"rimraf\");\nconst Server = require(\"../../lib/Server\");\nconst { normalizeStderr, testBin } = require(\"../helpers/test-bin\");\nconst port = require(\"../ports-map\")[\"cli-server\"];\n\nconst httpsCertificateDirectory = path.resolve(\n  __dirname,\n  \"../fixtures/https-certificate\",\n);\n\nconst defaultCertificateDir = Server.findCacheDir();\n\ndescribe('\"server\" CLI options', () => {\n  beforeEach(async () => {\n    await rimraf(defaultCertificateDir);\n  });\n\n  it('should work using \"--server-type http\"', async () => {\n    const { exitCode, stderr } = await testBin([\n      \"--port\",\n      port,\n      \"--server-type\",\n      \"http\",\n    ]);\n\n    expect(exitCode).toBe(0);\n    expect(\n      normalizeStderr(stderr, { ipv6: true, https: false }),\n    ).toMatchSnapshot();\n  });\n\n  it('should work using \"--server-type https\"', async () => {\n    const { exitCode, stderr } = await testBin([\n      \"--port\",\n      port,\n      \"--server-type\",\n      \"https\",\n    ]);\n\n    expect(exitCode).toBe(0);\n    expect(\n      normalizeStderr(stderr, { ipv6: true, https: true }),\n    ).toMatchSnapshot();\n  });\n\n  const [major] = process.versions.node.split(\".\").map(Number);\n\n  (major >= 24 ? it.skip : it)(\n    'should work using \"--server-type spdy\"',\n    async () => {\n      const { exitCode, stderr } = await testBin([\n        \"--port\",\n        port,\n        \"--server-type\",\n        \"spdy\",\n      ]);\n\n      // eslint-disable-next-line jest/no-standalone-expect\n      expect(exitCode).toBe(0);\n      // eslint-disable-next-line jest/no-standalone-expect\n      expect(\n        normalizeStderr(stderr, { ipv6: true, https: true }),\n      ).toMatchSnapshot();\n    },\n  );\n\n  it('should work using \"--server-options-key <path> --server-options-pfx <path> --server-options-passphrase webpack-dev-server --server-options-cert <path> --server-options-ca <path>\"', async () => {\n    const pfxFile = path.join(httpsCertificateDirectory, \"server.pfx\");\n    const key = path.join(httpsCertificateDirectory, \"server.key\");\n    const cert = path.join(httpsCertificateDirectory, \"server.crt\");\n    const ca = path.join(httpsCertificateDirectory, \"ca.pem\");\n    const passphrase = \"webpack-dev-server\";\n\n    const { exitCode, stderr } = await testBin([\n      \"--port\",\n      port,\n      \"--server-type\",\n      \"https\",\n      \"--server-options-key\",\n      key,\n      \"--server-options-pfx\",\n      pfxFile,\n      \"--server-options-passphrase\",\n      passphrase,\n      \"--server-options-cert\",\n      cert,\n      \"--server-options-ca\",\n      ca,\n    ]);\n\n    expect(exitCode).toBe(0);\n    expect(\n      normalizeStderr(stderr, { ipv6: true, https: true }),\n    ).toMatchSnapshot();\n  });\n\n  it('should work using \"--server-options-key-reset --server-options-key <path> --server-options-pfx-reset --server-options-pfx <path> --server-options-passphrase webpack-dev-server --server-options-cert-reset  --server-options-cert <path> --server-options-ca-reset --server-options-ca <path>\"', async () => {\n    const pfxFile = path.join(httpsCertificateDirectory, \"server.pfx\");\n    const key = path.join(httpsCertificateDirectory, \"server.key\");\n    const cert = path.join(httpsCertificateDirectory, \"server.crt\");\n    const ca = path.join(httpsCertificateDirectory, \"ca.pem\");\n    const passphrase = \"webpack-dev-server\";\n\n    const { exitCode, stderr } = await testBin([\n      \"--port\",\n      port,\n      \"--server-type\",\n      \"https\",\n      \"--server-options-key-reset\",\n      \"--server-options-key\",\n      key,\n      \"--server-options-pfx-reset\",\n      \"--server-options-pfx\",\n      pfxFile,\n      \"--server-options-passphrase\",\n      passphrase,\n      \"--server-options-cert-reset\",\n      \"--server-options-cert\",\n      cert,\n      \"--server-options-ca-reset\",\n      \"--server-options-ca\",\n      ca,\n    ]);\n\n    expect(exitCode).toBe(0);\n    expect(\n      normalizeStderr(stderr, { ipv6: true, https: true }),\n    ).toMatchSnapshot();\n  });\n\n  // For https://github.com/webpack/webpack-dev-server/issues/3306\n  it('should work using \"--server-options-key <path> --server-options-pfx <path> --server-options-passphrase webpack-dev-server --server-options-cert <path>\"', async () => {\n    const pfxFile = path.join(httpsCertificateDirectory, \"server.pfx\");\n    const key = path.join(httpsCertificateDirectory, \"server.key\");\n    const cert = path.join(httpsCertificateDirectory, \"server.crt\");\n    const passphrase = \"webpack-dev-server\";\n\n    const { exitCode, stderr } = await testBin([\n      \"--port\",\n      port,\n      \"--server-type\",\n      \"https\",\n      \"--server-options-key\",\n      key,\n      \"--server-options-pfx\",\n      pfxFile,\n      \"--server-options-passphrase\",\n      passphrase,\n      \"--server-options-cert\",\n      cert,\n    ]);\n\n    expect(exitCode).toBe(0);\n    expect(\n      normalizeStderr(stderr, { ipv6: true, https: true }),\n    ).toMatchSnapshot();\n  });\n\n  it('should work using \"--server-options-request-cert\"', async () => {\n    const { exitCode, stderr } = await testBin([\n      \"--port\",\n      port,\n      \"--server-type\",\n      \"https\",\n      \"--server-options-request-cert\",\n    ]);\n\n    expect(exitCode).toBe(0);\n    expect(\n      normalizeStderr(stderr, { ipv6: true, https: true }),\n    ).toMatchSnapshot();\n  });\n\n  it('should work using \"--no-server-options-request-cert\"', async () => {\n    const { exitCode, stderr } = await testBin([\n      \"--port\",\n      port,\n      \"--server-type\",\n      \"https\",\n      \"--no-server-options-request-cert\",\n    ]);\n\n    expect(exitCode).toBe(0);\n    expect(\n      normalizeStderr(stderr, { ipv6: true, https: true }),\n    ).toMatchSnapshot();\n  });\n});\n"
  },
  {
    "path": "test/cli/static-option.test.js",
    "content": "\"use strict\";\n\nconst { normalizeStderr, testBin } = require(\"../helpers/test-bin\");\nconst port = require(\"../ports-map\")[\"cli-static\"];\n\ndescribe('\"static\" CLI option', () => {\n  it('should work using \"--static\"', async () => {\n    const { exitCode, stderr } = await testBin([\"--port\", port, \"--static\"]);\n\n    expect(exitCode).toBe(0);\n    expect(normalizeStderr(stderr, { ipv6: true })).toMatchSnapshot(\"stderr\");\n  });\n\n  it('should work using \"--static new-static\"', async () => {\n    const { exitCode, stderr } = await testBin([\n      \"--port\",\n      port,\n      \"--static\",\n      \"new-static\",\n    ]);\n\n    expect(exitCode).toBe(0);\n    expect(normalizeStderr(stderr, { ipv6: true })).toMatchSnapshot(\"stderr\");\n  });\n\n  it('should work using \"--static new-static --static other-static\"', async () => {\n    const { exitCode, stderr } = await testBin([\n      \"--port\",\n      port,\n      \"--static\",\n      \"new-static\",\n      \"--static\",\n      \"other-static\",\n    ]);\n\n    expect(exitCode).toBe(0);\n    expect(normalizeStderr(stderr, { ipv6: true })).toMatchSnapshot(\"stderr\");\n  });\n\n  it('should work using \"--static-reset\"', async () => {\n    const { exitCode, stderr } = await testBin([\n      \"--port\",\n      port,\n      \"--static-reset\",\n      \"--static\",\n      \"new-static-after-reset\",\n    ]);\n\n    expect(exitCode).toBe(0);\n    expect(normalizeStderr(stderr, { ipv6: true })).toMatchSnapshot(\"stderr\");\n  });\n\n  it('should work using \"--static-reset --static-directory new-static-directory\"', async () => {\n    const { exitCode, stderr } = await testBin([\n      \"--port\",\n      port,\n      \"--static-reset\",\n      \"--static-directory\",\n      \"new-static-directory\",\n    ]);\n\n    expect(exitCode).toBe(0);\n    expect(normalizeStderr(stderr, { ipv6: true })).toMatchSnapshot(\"stderr\");\n  });\n\n  it('should work using \"--static-directory static-dir\"', async () => {\n    const { exitCode, stderr } = await testBin([\n      \"--port\",\n      port,\n      \"--static-directory\",\n      \"static-dir\",\n    ]);\n\n    expect(exitCode).toBe(0);\n    expect(normalizeStderr(stderr, { ipv6: true })).toMatchSnapshot(\"stderr\");\n  });\n\n  it('should work using \"--static-public-path /public\"', async () => {\n    const { exitCode, stderr } = await testBin([\n      \"--port\",\n      port,\n      \"--static-public-path\",\n      \"/public\",\n    ]);\n\n    expect(exitCode).toBe(0);\n    expect(normalizeStderr(stderr, { ipv6: true })).toMatchSnapshot(\"stderr\");\n  });\n\n  it('should work using \"--static-public-path-reset\"', async () => {\n    const { exitCode, stderr } = await testBin([\n      \"--port\",\n      port,\n      \"--static-public-path-reset\",\n      \"--static-public-path\",\n      \"/new-public\",\n    ]);\n\n    expect(exitCode).toBe(0);\n    expect(normalizeStderr(stderr, { ipv6: true })).toMatchSnapshot(\"stderr\");\n  });\n\n  it('should work using \"--static-serve-index\"', async () => {\n    const { exitCode, stderr } = await testBin([\n      \"--port\",\n      port,\n      \"--static-serve-index\",\n    ]);\n\n    expect(exitCode).toBe(0);\n    expect(normalizeStderr(stderr, { ipv6: true })).toMatchSnapshot(\"stderr\");\n  });\n\n  it('should work using \"--no-static-serve-index\"', async () => {\n    const { exitCode, stderr } = await testBin([\n      \"--port\",\n      port,\n      \"--no-static-serve-index\",\n    ]);\n\n    expect(exitCode).toBe(0);\n    expect(normalizeStderr(stderr, { ipv6: true })).toMatchSnapshot(\"stderr\");\n  });\n\n  it('should work using \"--static-watch\"', async () => {\n    const { exitCode, stderr } = await testBin([\n      \"--port\",\n      port,\n      \"--static-watch\",\n    ]);\n\n    expect(exitCode).toBe(0);\n    expect(normalizeStderr(stderr, { ipv6: true })).toMatchSnapshot(\"stderr\");\n  });\n\n  it('should work using \"--no-static-watch\"', async () => {\n    const { exitCode, stderr } = await testBin([\n      \"--port\",\n      port,\n      \"--no-static-watch\",\n    ]);\n\n    expect(exitCode).toBe(0);\n    expect(normalizeStderr(stderr, { ipv6: true })).toMatchSnapshot(\"stderr\");\n  });\n});\n"
  },
  {
    "path": "test/cli/watchFiles-option.test.js",
    "content": "\"use strict\";\n\nconst path = require(\"node:path\");\nconst { normalizeStderr, testBin } = require(\"../helpers/test-bin\");\nconst port = require(\"../ports-map\")[\"cli-watch-files\"];\n\ndescribe('\"watchFiles\" CLI option', () => {\n  it('should work using \"--watch-files <value>\"', async () => {\n    const watchDirectory = path.resolve(__dirname, \"../fixtures/static/static\");\n\n    const { exitCode, stderr } = await testBin([\n      \"--port\",\n      port,\n      \"--watch-files\",\n      watchDirectory,\n    ]);\n\n    expect(exitCode).toBe(0);\n    expect(normalizeStderr(stderr, { ipv6: true })).toMatchSnapshot(\"stderr\");\n  });\n\n  it('should work using \"--watch-files <value> --watch-files <other-value>\"', async () => {\n    const watchDirectory = path.resolve(__dirname, \"../fixtures/static/static\");\n    const watchOtherDirectory = path.resolve(\n      __dirname,\n      \"../fixtures/static/simple-config\",\n    );\n\n    const { exitCode, stderr } = await testBin([\n      \"--port\",\n      port,\n      \"--watch-files\",\n      watchDirectory,\n      \"--watch-files\",\n      watchOtherDirectory,\n    ]);\n\n    expect(exitCode).toBe(0);\n    expect(normalizeStderr(stderr, { ipv6: true })).toMatchSnapshot(\"stderr\");\n  });\n\n  it('should work using \"--watch-files-reset --watch-files <static>\"', async () => {\n    const watchDirectory = path.resolve(__dirname, \"../fixtures/static/static\");\n\n    const { exitCode, stderr } = await testBin([\n      \"--port\",\n      port,\n      \"--watch-files-reset\",\n      \"--watch-files\",\n      watchDirectory,\n    ]);\n\n    expect(exitCode).toBe(0);\n    expect(normalizeStderr(stderr, { ipv6: true })).toMatchSnapshot(\"stderr\");\n  });\n});\n"
  },
  {
    "path": "test/cli/webSocketServer-option.test.js",
    "content": "\"use strict\";\n\nconst { testBin } = require(\"../helpers/test-bin\");\nconst port = require(\"../ports-map\")[\"cli-web-socket-server\"];\n\ndescribe('\"webSocketServer\" CLI option', () => {\n  it('should work using \"--web-socket-server-type ws\"', async () => {\n    const { exitCode } = await testBin([\n      \"--port\",\n      port,\n      \"--web-socket-server-type\",\n      \"ws\",\n    ]);\n\n    expect(exitCode).toBe(0);\n  });\n\n  it('should work using \"--web-socket-server-type sockjs\"', async () => {\n    const { exitCode } = await testBin([\n      \"--port\",\n      port,\n      \"--web-socket-server-type\",\n      \"sockjs\",\n    ]);\n\n    expect(exitCode).toBe(0);\n  });\n\n  it('should work using \"--no-web-socket-server\"', async () => {\n    const { exitCode } = await testBin([\n      \"--port\",\n      port,\n      \"--no-web-socket-server\",\n    ]);\n\n    expect(exitCode).toBe(0);\n  });\n});\n"
  },
  {
    "path": "test/client/ReactErrorBoundary.test.js",
    "content": "/**\n * @jest-environment jsdom\n */\n\n\"use strict\";\n\nconst { createOverlay } = require(\"../../client-src/overlay\");\n\ndescribe(\"createOverlay\", () => {\n  const originalDocument = globalThis.document;\n  const originalWindow = globalThis.window;\n\n  beforeEach(() => {\n    globalThis.document = {\n      createElement: jest.fn(() => ({\n        style: {},\n        appendChild: jest.fn(),\n        addEventListener: jest.fn(),\n        contentDocument: {\n          createElement: jest.fn(() => ({ style: {}, appendChild: jest.fn() })),\n          body: { appendChild: jest.fn() },\n        },\n      })),\n      body: { appendChild: jest.fn(), removeChild: jest.fn() },\n    };\n    globalThis.window = {\n      // Keep addEventListener mocked for other potential uses\n      addEventListener: jest.fn(),\n      removeEventListener: jest.fn(),\n      // Mock trustedTypes\n      trustedTypes: null,\n      // Mock dispatchEvent\n      dispatchEvent: jest.fn(),\n    };\n    jest.useFakeTimers();\n  });\n\n  afterEach(() => {\n    globalThis.document = originalDocument;\n    globalThis.window = originalWindow;\n    jest.useRealTimers();\n    jest.clearAllMocks();\n  });\n\n  it(\"should not show overlay for errors caught by React error boundaries\", () => {\n    const options = { trustedTypesPolicyName: null, catchRuntimeError: true };\n    const overlay = createOverlay(options);\n    const showOverlayMock = jest.spyOn(overlay, \"send\");\n\n    const reactError = new Error(\n      \"Error inside React render\\n\" +\n        \"    at Boom (webpack:///./src/index.jsx?:41:11)\\n\" +\n        \"    at renderWithHooks (webpack:///./node_modules/react-dom/cjs/react-dom.development.js?:16305:18)\\n\" +\n        \"    at mountIndeterminateComponent (webpack:///./node_modules/react-dom/cjs/react-dom.development.js?:20069:13)\\n\" +\n        \"    at beginWork (webpack:///./node_modules/react-dom/cjs/react-dom.development.js?:21582:16)\\n\" +\n        \"    at HTMLUnknownElement.callCallback (webpack:///./node_modules/react-dom/cjs/react-dom.development.js?:4164:14)\\n\" +\n        \"    at Object.invokeGuardedCallbackDev (webpack:///./node_modules/react-dom/cjs/react-dom.development.js?:4213:16)\\n\" +\n        \"    at invokeGuardedCallback (webpack:///./node_modules/react-dom/cjs/react-dom.development.js?:4277:31)\\n\" +\n        \"    at beginWork$1 (webpack:///./node_modules/react-dom/cjs/react-dom.development.js?:27446:7)\\n\" +\n        \"    at performUnitOfWork (webpack:///./node_modules/react-dom/cjs/react-dom.development.js?:26555:12)\\n\" +\n        \"    at workLoopSync (webpack:///./node_modules/react-dom/cjs/react-dom.development.js?:26461:5)\",\n    );\n    reactError._suppressLogging = true;\n\n    const errorEvent = new ErrorEvent(\"error\", {\n      error: reactError,\n      message: reactError.message,\n    });\n    globalThis.dispatchEvent(errorEvent);\n\n    expect(showOverlayMock).not.toHaveBeenCalled();\n    showOverlayMock.mockRestore();\n  });\n\n  it(\"should show overlay for normal uncaught errors\", () => {\n    const options = { trustedTypesPolicyName: null, catchRuntimeError: true };\n    const overlay = createOverlay(options);\n    const showOverlayMock = jest.spyOn(overlay, \"send\");\n\n    const regularError = new Error(\n      \"Error inside React render\\n\" +\n        \"    at Boom (webpack:///./src/index.jsx?:41:11)\\n\" +\n        \"    at renderWithHooks (webpack:///./node_modules/react-dom/cjs/react-dom.development.js?:16305:18)\\n\" +\n        \"    at mountIndeterminateComponent (webpack:///./node_modules/react-dom/cjs/react-dom.development.js?:20069:13)\\n\" +\n        \"    at beginWork (webpack:///./node_modules/react-dom/cjs/react-dom.development.js?:21582:16)\\n\" +\n        \"    at HTMLUnknownElement.callCallback (webpack:///./node_modules/react-dom/cjs/react-dom.development.js?:4164:14)\\n\",\n    );\n\n    const errorEvent = new ErrorEvent(\"error\", {\n      error: regularError,\n      message: \"Regular test error message\",\n    });\n    globalThis.dispatchEvent(errorEvent);\n\n    expect(showOverlayMock).toHaveBeenCalledWith({\n      type: \"RUNTIME_ERROR\",\n      messages: [\n        {\n          message: regularError.message,\n          stack: expect.anything(),\n        },\n      ],\n    });\n    showOverlayMock.mockRestore();\n  });\n\n  it(\"should show overlay for normal uncaught errors (when null is thrown)\", () => {\n    const options = { trustedTypesPolicyName: null, catchRuntimeError: true };\n    const overlay = createOverlay(options);\n    const showOverlayMock = jest.spyOn(overlay, \"send\");\n\n    const errorEvent = new ErrorEvent(\"error\", {\n      error: null,\n      message: \"error\",\n    });\n    globalThis.dispatchEvent(errorEvent);\n\n    expect(showOverlayMock).toHaveBeenCalledWith({\n      type: \"RUNTIME_ERROR\",\n      messages: [\n        {\n          message: \"error\",\n          stack: expect.anything(),\n        },\n      ],\n    });\n    showOverlayMock.mockRestore();\n  });\n\n  it(\"should show overlay for normal uncaught errors when catchRuntimeError is a function that return true\", () => {\n    const options = {\n      trustedTypesPolicyName: null,\n      catchRuntimeError: () => true,\n    };\n    const overlay = createOverlay(options);\n    const showOverlayMock = jest.spyOn(overlay, \"send\");\n\n    const regularError = new Error(\"Regular test error\");\n    const errorEvent = new ErrorEvent(\"error\", {\n      error: regularError,\n      message: \"Regular test error message\",\n    });\n    globalThis.dispatchEvent(errorEvent);\n\n    expect(showOverlayMock).toHaveBeenCalledWith({\n      type: \"RUNTIME_ERROR\",\n      messages: [\n        {\n          message: regularError.message,\n          stack: expect.anything(),\n        },\n      ],\n    });\n    showOverlayMock.mockRestore();\n  });\n\n  it(\"should not show overlay for normal uncaught errors when catchRuntimeError is a function that return false\", () => {\n    const options = {\n      trustedTypesPolicyName: null,\n      catchRuntimeError: () => false,\n    };\n    const overlay = createOverlay(options);\n    const showOverlayMock = jest.spyOn(overlay, \"send\");\n\n    const regularError = new Error(\"Regular test error\");\n    const errorEvent = new ErrorEvent(\"error\", {\n      error: regularError,\n      message: \"Regular test error message\",\n    });\n    globalThis.dispatchEvent(errorEvent);\n\n    expect(showOverlayMock).not.toHaveBeenCalled();\n    showOverlayMock.mockRestore();\n  });\n\n  it(\"should not show the overlay for errors with stack containing 'invokeGuardedCallbackDev'\", () => {\n    const options = { trustedTypesPolicyName: null, catchRuntimeError: true };\n    const overlay = createOverlay(options);\n    const showOverlayMock = jest.spyOn(overlay, \"send\");\n\n    const reactInternalError = new Error(\"React internal error\");\n    reactInternalError.stack = \"invokeGuardedCallbackDev\\n at somefile.js\";\n    const errorEvent = new ErrorEvent(\"error\", {\n      error: reactInternalError,\n      message: \"React internal error\",\n    });\n    globalThis.dispatchEvent(errorEvent);\n\n    expect(showOverlayMock).not.toHaveBeenCalled();\n    showOverlayMock.mockRestore();\n  });\n\n  it(\"should show overlay for unhandled rejections\", () => {\n    const options = { trustedTypesPolicyName: null, catchRuntimeError: true };\n    const overlay = createOverlay(options);\n    const showOverlayMock = jest.spyOn(overlay, \"send\");\n\n    const rejectionReason = new Error(\"Promise rejection reason\");\n    const rejectionEvent = new Event(\"unhandledrejection\");\n    rejectionEvent.reason = rejectionReason;\n\n    globalThis.dispatchEvent(rejectionEvent);\n\n    expect(showOverlayMock).toHaveBeenCalledWith({\n      type: \"RUNTIME_ERROR\",\n      messages: [\n        {\n          message: rejectionReason.message,\n          stack: expect.anything(),\n        },\n      ],\n    });\n    showOverlayMock.mockRestore();\n  });\n\n  it(\"should show overlay for unhandled rejections with string reason\", () => {\n    const options = { trustedTypesPolicyName: null, catchRuntimeError: true };\n    const overlay = createOverlay(options);\n    const showOverlayMock = jest.spyOn(overlay, \"send\");\n    const rejectionEvent = new Event(\"unhandledrejection\");\n    rejectionEvent.reason = \"some reason\";\n    globalThis.dispatchEvent(rejectionEvent);\n\n    expect(showOverlayMock).toHaveBeenCalledWith({\n      type: \"RUNTIME_ERROR\",\n      messages: [\n        {\n          message: \"some reason\",\n          stack: expect.anything(),\n        },\n      ],\n    });\n    showOverlayMock.mockRestore();\n  });\n  // ESC key test cases\n\n  it(\"should dismiss overlay when ESC key is pressed\", () => {\n    const options = { trustedTypesPolicyName: null, catchRuntimeError: true };\n    const overlay = createOverlay(options);\n    const showOverlayMock = jest.spyOn(overlay, \"send\");\n\n    const escEvent = new KeyboardEvent(\"keydown\", { key: \"Escape\" });\n    globalThis.window.dispatchEvent(escEvent);\n\n    expect(showOverlayMock).toHaveBeenCalledWith({ type: \"DISMISS\" });\n    showOverlayMock.mockRestore();\n  });\n\n  it(\"should dismiss overlay when 'Esc' key is pressed (older browsers)\", () => {\n    const options = { trustedTypesPolicyName: null, catchRuntimeError: true };\n    const overlay = createOverlay(options);\n    const showOverlayMock = jest.spyOn(overlay, \"send\");\n\n    const escEvent = new KeyboardEvent(\"keydown\", { key: \"Esc\" });\n    globalThis.window.dispatchEvent(escEvent);\n\n    expect(showOverlayMock).toHaveBeenCalledWith({ type: \"DISMISS\" });\n    showOverlayMock.mockRestore();\n  });\n\n  it(\"should not dismiss overlay for other keys\", () => {\n    const options = { trustedTypesPolicyName: null, catchRuntimeError: true };\n    const overlay = createOverlay(options);\n    const showOverlayMock = jest.spyOn(overlay, \"send\");\n\n    const otherKeyEvent = new KeyboardEvent(\"keydown\", { key: \"Enter\" });\n    globalThis.window.dispatchEvent(otherKeyEvent);\n\n    expect(showOverlayMock).not.toHaveBeenCalled();\n    showOverlayMock.mockRestore();\n  });\n});\n"
  },
  {
    "path": "test/client/__snapshots__/index.test.js.snap.webpack5",
    "content": "// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing\n\nexports[`index should run onSocketMessage.close (hot enabled) 1`] = `\"Disconnected!\"`;\n\nexports[`index should run onSocketMessage.close (hot enabled) 2`] = `\"Close\"`;\n\nexports[`index should run onSocketMessage.close (liveReload enabled) 1`] = `\"Disconnected!\"`;\n\nexports[`index should run onSocketMessage.close (liveReload enabled) 2`] = `\"Close\"`;\n\nexports[`index should run onSocketMessage.close 1`] = `\"Disconnected!\"`;\n\nexports[`index should run onSocketMessage.close 2`] = `\"Close\"`;\n\nexports[`index should run onSocketMessage.error 1`] = `\"error!!\"`;\n\nexports[`index should run onSocketMessage.ok 1`] = `\"Ok\"`;\n\nexports[`index should run onSocketMessage.progress and onSocketMessage['progress-update'] 1`] = `\"Progress\"`;\n\nexports[`index should run onSocketMessage.progress and onSocketMessage['progress-update'] 2`] = `\"12% - mock-msg.\"`;\n\nexports[`index should run onSocketMessage.progress and onSocketMessage['progress-update'] and log plugin name 1`] = `\"Progress\"`;\n\nexports[`index should run onSocketMessage.progress and onSocketMessage['progress-update'] and log plugin name 2`] = `\"[mock-plugin] 12% - mock-msg.\"`;\n\nexports[`index should run onSocketMessage.warnings 1`] = `\"Warnings while compiling.\"`;\n\nexports[`index should run onSocketMessage.warnings 2`] = `\"Warnings\"`;\n\nexports[`index should run onSocketMessage.warnings 3`] = `\n[\n  [\n    \"HEADER warning\nBODY: warning\",\n  ],\n  [\n    \"HEADER warning\nBODY: warning\",\n  ],\n  [\n    \"HEADER warning\nBODY: warning\",\n  ],\n]\n`;\n\nexports[`index should run onSocketMessage['static-changed'] 1`] = `\"Content from static directory was changed. Reloading...\"`;\n\nexports[`index should run onSocketMessage['static-changed'](file) 1`] = `\"\"/static/assets/index.html\" from static directory was changed. Reloading...\"`;\n\nexports[`index should run onSocketMessage['still-ok'] 1`] = `\"Nothing changed.\"`;\n\nexports[`index should run onSocketMessage['still-ok'] 2`] = `\"StillOk\"`;\n\nexports[`index should set arguments into socket function 1`] = `\n[\n  \"ws://localhost/ws\",\n  {\n    \"close\": [Function],\n    \"error\": [Function],\n    \"errors\": [Function],\n    \"hash\": [Function],\n    \"hot\": [Function],\n    \"invalid\": [Function],\n    \"liveReload\": [Function],\n    \"logging\": [Function],\n    \"ok\": [Function],\n    \"overlay\": [Function],\n    \"progress\": [Function],\n    \"progress-update\": [Function],\n    \"reconnect\": [Function],\n    \"static-changed\": [Function],\n    \"still-ok\": [Function],\n    \"warnings\": [Function],\n  },\n  undefined,\n]\n`;\n"
  },
  {
    "path": "test/client/__snapshots__/socket-helper.test.js.snap.webpack5",
    "content": "// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing\n\nexports[`socket should default to WebsocketClient when no __webpack_dev_server_client__ set 1`] = `\n[\n  \"my.url\",\n]\n`;\n\nexports[`socket should default to WebsocketClient when no __webpack_dev_server_client__ set 2`] = `\n[\n  [\n    [Function],\n  ],\n]\n`;\n\nexports[`socket should default to WebsocketClient when no __webpack_dev_server_client__ set 3`] = `\n[\n  [\n    [Function],\n  ],\n]\n`;\n\nexports[`socket should default to WebsocketClient when no __webpack_dev_server_client__ set 4`] = `\n[\n  [\n    [Function],\n  ],\n]\n`;\n\nexports[`socket should default to WebsocketClient when no __webpack_dev_server_client__ set 5`] = `\n[\n  [\n    \"hello world\",\n    {\n      \"foo\": \"bar\",\n    },\n  ],\n]\n`;\n\nexports[`socket should use __webpack_dev_server_client__ when set 1`] = `\n[\n  \"my.url\",\n]\n`;\n\nexports[`socket should use __webpack_dev_server_client__ when set 2`] = `\n[\n  [\n    [Function],\n  ],\n]\n`;\n\nexports[`socket should use __webpack_dev_server_client__ when set 3`] = `\n[\n  [\n    [Function],\n  ],\n]\n`;\n\nexports[`socket should use __webpack_dev_server_client__ when set 4`] = `\n[\n  [\n    [Function],\n  ],\n]\n`;\n\nexports[`socket should use __webpack_dev_server_client__ when set 5`] = `\n[\n  [\n    \"hello world\",\n    {\n      \"foo\": \"bar\",\n    },\n  ],\n]\n`;\n"
  },
  {
    "path": "test/client/bundle.test.js",
    "content": "\"use strict\";\n\nconst acorn = require(\"acorn\");\nconst request = require(\"supertest\");\nconst webpack = require(\"webpack\");\nconst Server = require(\"../../lib/Server\");\nconst config = require(\"../fixtures/simple-config/webpack.config\");\nconst port = require(\"../ports-map\").bundle;\n\ndescribe(\"bundle\", () => {\n  describe(\"main.js bundled output\", () => {\n    let server;\n    let req;\n\n    beforeAll(async () => {\n      const compiler = webpack({\n        ...config,\n        target: [\"es5\", \"web\"],\n      });\n\n      server = new Server({ port }, compiler);\n\n      await server.start();\n\n      req = request(server.app);\n    });\n\n    afterAll(async () => {\n      await server.stop();\n    });\n\n    it(\"should get full user bundle and parse with ES5\", async () => {\n      const { text } = await req\n        .get(\"/main.js\")\n        .expect(\"Content-Type\", \"text/javascript; charset=utf-8\")\n        .expect(200);\n\n      expect(() => {\n        let evalStep = 0;\n\n        acorn.parse(text, {\n          ecmaVersion: 5,\n          onToken: (token) => {\n            // a webpack bundle is a series of evaluated JavaScript\n            // strings like this: eval('...')\n            // if we want the bundle to work using ES5, we need to\n            // check that these strings are good with ES5 as well\n\n            // this can be done by waiting for tokens during the main parse\n            // then when we hit a string in an 'eval' function we also try\n            // to parse that string with ES5\n            if (token.type.label === \"name\" && token.value === \"eval\") {\n              evalStep += 1;\n            } else if (token.type.label === \"(\" && evalStep === 1) {\n              evalStep += 1;\n            } else if (token.type.label === \"string\" && evalStep === 2) {\n              const program = token.value;\n              acorn.parse(program, {\n                ecmaVersion: 5,\n              });\n\n              evalStep = 0;\n            }\n          },\n        });\n      }).not.toThrow();\n    });\n  });\n});\n"
  },
  {
    "path": "test/client/clients/SockJSClient.test.js",
    "content": "/**\n * @jest-environment jsdom\n */\n\n\"use strict\";\n\nconst http = require(\"node:http\");\nconst express = require(\"express\");\nconst sockjs = require(\"sockjs\");\nconst port = require(\"../../ports-map\")[\"sockjs-client\"];\n\njest.setMock(\"../../../client-src/utils/log\", {\n  log: {\n    error: jest.fn(),\n  },\n});\n\ndescribe(\"SockJSClient\", () => {\n  const SockJSClient =\n    require(\"../../../client-src/clients/SockJSClient\").default;\n  const { log } = require(\"../../../client-src/utils/log\");\n\n  let consoleMock;\n  let socketServer;\n  let server;\n\n  beforeAll((done) => {\n    consoleMock = jest.spyOn(console, \"log\").mockImplementation();\n\n    // eslint-disable-next-line new-cap\n    const app = new express();\n\n    server = http.createServer(app);\n    server.listen(port, \"localhost\", () => {\n      socketServer = sockjs.createServer();\n      socketServer.installHandlers(server, {\n        prefix: \"/ws\",\n      });\n      done();\n    });\n  });\n\n  afterAll((done) => {\n    consoleMock.mockRestore();\n    server.close(() => {\n      done();\n    });\n  });\n\n  describe(\"client\", () => {\n    it(\"should open, receive message, and close\", (done) => {\n      socketServer.on(\"connection\", (connection) => {\n        connection.write(\"hello world\");\n\n        setTimeout(() => {\n          connection.close();\n        }, 1000);\n      });\n\n      const client = new SockJSClient(`http://localhost:${port}/ws`);\n      const data = [];\n\n      client.onOpen(() => {\n        data.push(\"open\");\n      });\n      client.onClose(() => {\n        data.push(\"close\");\n      });\n      client.onMessage((msg) => {\n        data.push(msg);\n      });\n\n      const testError = new Error(\"test\");\n\n      client.sock.onerror(testError);\n\n      expect(log.error.mock.calls).toHaveLength(1);\n      expect(log.error.mock.calls[0]).toEqual([testError]);\n\n      setTimeout(() => {\n        expect(data).toMatchSnapshot();\n\n        done();\n      }, 3000);\n    });\n  });\n});\n"
  },
  {
    "path": "test/client/clients/WebsocketClient.test.js",
    "content": "/**\n * @jest-environment jsdom\n * @jest-environment-options { \"customExportConditions\": [\"main\"] }\n */\n\n\"use strict\";\n\nconst http = require(\"node:http\");\nconst express = require(\"express\");\nconst ws = require(\"ws\");\nconst port = require(\"../../ports-map\")[\"web-socket-client\"];\n\njest.setMock(\"../../../client-src/utils/log\", {\n  log: {\n    error: jest.fn(),\n  },\n});\n\ndescribe(\"WebsocketClient\", () => {\n  const WebSocketClient =\n    require(\"../../../client-src/clients/WebSocketClient\").default;\n  const { log } = require(\"../../../client-src/utils/log\");\n\n  let socketServer;\n  let server;\n\n  beforeAll((done) => {\n    // eslint-disable-next-line new-cap\n    const app = new express();\n\n    server = http.createServer(app);\n    server.listen(port, \"localhost\", () => {\n      socketServer = new ws.Server({\n        server,\n        path: \"/ws-server\",\n      });\n      done();\n    });\n  });\n\n  describe(\"client\", () => {\n    it(\"should open, receive message, and close\", (done) => {\n      socketServer.on(\"connection\", (connection) => {\n        connection.send(\"hello world\");\n\n        setTimeout(() => {\n          connection.close();\n        }, 1000);\n      });\n\n      const client = new WebSocketClient(`ws://localhost:${port}/ws-server`);\n      const data = [];\n\n      client.onOpen(() => {\n        data.push(\"open\");\n      });\n      client.onClose(() => {\n        data.push(\"close\");\n      });\n      client.onMessage((msg) => {\n        data.push(msg);\n      });\n\n      const testError = new Error(\"test\");\n\n      client.client.onerror(testError);\n\n      expect(log.error.mock.calls).toHaveLength(1);\n      expect(log.error.mock.calls[0]).toEqual([testError]);\n\n      setTimeout(() => {\n        expect(data).toMatchSnapshot();\n\n        done();\n      }, 3000);\n    });\n  });\n\n  afterAll((done) => {\n    server.close(() => {\n      done();\n    });\n  });\n});\n"
  },
  {
    "path": "test/client/clients/__snapshots__/SockJSClient.test.js.snap.webpack5",
    "content": "// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing\n\nexports[`SockJSClient client should open, receive message, and close 1`] = `\n[\n  \"open\",\n  \"hello world\",\n  \"close\",\n]\n`;\n"
  },
  {
    "path": "test/client/clients/__snapshots__/WebsocketClient.test.js.snap.webpack5",
    "content": "// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing\n\nexports[`WebsocketClient client should open, receive message, and close 1`] = `\n[\n  \"open\",\n  \"hello world\",\n  \"close\",\n]\n`;\n"
  },
  {
    "path": "test/client/index.test.js",
    "content": "/**\n * @jest-environment jsdom\n */\n\n\"use strict\";\n\ndescribe(\"index\", () => {\n  let log;\n  let socket;\n  let overlay;\n  let sendMessage;\n  let onSocketMessage;\n  const locationValue = self.location;\n  const resourceQueryValue = globalThis.__resourceQuery;\n\n  beforeEach(() => {\n    globalThis.__resourceQuery = \"?mock-url\";\n    globalThis.__webpack_hash__ = \"mock-hash\";\n\n    // log\n    jest.setMock(\"../../client-src/utils/log.js\", {\n      log: {\n        info: jest.fn(),\n        warn: jest.fn(),\n        error: jest.fn(),\n      },\n      logEnabledFeatures: jest.fn(),\n      setLogLevel: jest.fn(),\n    });\n\n    log = require(\"../../client-src/utils/log\");\n\n    // socket\n    jest.setMock(\"../../client-src/socket.js\", jest.fn());\n    socket = require(\"../../client-src/socket\");\n\n    const send = jest.fn();\n\n    // overlay\n    jest.setMock(\"../../client-src/overlay.js\", {\n      createOverlay: () => ({\n        send,\n      }),\n      formatProblem: (item) => ({\n        header: \"HEADER warning\",\n        body: `BODY: ${item}`,\n      }),\n    });\n\n    const { createOverlay } = require(\"../../client-src/overlay\");\n\n    overlay = createOverlay();\n\n    // sendMessage\n    jest.setMock(\"../../client-src/utils/sendMessage.js\", jest.fn());\n    sendMessage = require(\"../../client-src/utils/sendMessage\");\n\n    // issue: https://github.com/jsdom/jsdom/issues/2112\n    delete globalThis.location;\n\n    globalThis.location = { ...locationValue, reload: jest.fn() };\n\n    require(\"../../client-src\");\n    [[, onSocketMessage]] = socket.mock.calls;\n  });\n\n  afterEach(() => {\n    globalThis.__resourceQuery = resourceQueryValue;\n    Object.assign(globalThis, locationValue);\n    jest.resetAllMocks();\n    jest.resetModules();\n  });\n\n  it(\"should set arguments into socket function\", () => {\n    expect(socket.mock.calls[0]).toMatchSnapshot();\n  });\n\n  it(\"should run onSocketMessage['still-ok']\", () => {\n    onSocketMessage[\"still-ok\"]();\n\n    expect(log.log.info.mock.calls[1][0]).toMatchSnapshot();\n    expect(sendMessage.mock.calls[0][0]).toMatchSnapshot();\n    expect(overlay.send).not.toHaveBeenCalledWith({ type: \"DISMISS\" });\n\n    // change flags\n    onSocketMessage.overlay(true);\n    onSocketMessage[\"still-ok\"]();\n\n    expect(overlay.send).toHaveBeenCalledWith({ type: \"DISMISS\" });\n  });\n\n  it(\"should run onSocketMessage.progress and onSocketMessage['progress-update']\", () => {\n    onSocketMessage.progress(false);\n    onSocketMessage[\"progress-update\"]({\n      msg: \"mock-msg\",\n      percent: \"12\",\n    });\n\n    expect(sendMessage.mock.calls[0][0]).toMatchSnapshot();\n\n    onSocketMessage.progress(true);\n    onSocketMessage[\"progress-update\"]({\n      msg: \"mock-msg\",\n      percent: \"12\",\n    });\n\n    expect(log.log.info.mock.calls[1][0]).toMatchSnapshot();\n  });\n\n  it(\"should run onSocketMessage.progress and onSocketMessage['progress-update'] and log plugin name\", () => {\n    onSocketMessage.progress(false);\n    onSocketMessage[\"progress-update\"]({\n      msg: \"mock-msg\",\n      percent: \"12\",\n      pluginName: \"mock-plugin\",\n    });\n\n    expect(sendMessage.mock.calls[0][0]).toMatchSnapshot();\n\n    onSocketMessage.progress(true);\n    onSocketMessage[\"progress-update\"]({\n      msg: \"mock-msg\",\n      percent: \"12\",\n      pluginName: \"mock-plugin\",\n    });\n\n    expect(log.log.info.mock.calls[1][0]).toMatchSnapshot();\n  });\n\n  it(\"should run onSocketMessage.ok\", () => {\n    onSocketMessage.ok();\n\n    expect(sendMessage.mock.calls[0][0]).toMatchSnapshot();\n\n    onSocketMessage.errors([]);\n    onSocketMessage.hash(\"mock-hash\");\n\n    const res = onSocketMessage.ok();\n\n    expect(res).toBeUndefined();\n  });\n\n  it(\"should run onSocketMessage['static-changed']\", () => {\n    onSocketMessage[\"static-changed\"]();\n\n    expect(log.log.info.mock.calls[1][0]).toMatchSnapshot();\n    expect(self.location.reload).toHaveBeenCalled();\n  });\n\n  it(\"should run onSocketMessage['static-changed'](file)\", () => {\n    onSocketMessage[\"static-changed\"](\"/static/assets/index.html\");\n\n    expect(log.log.info.mock.calls[1][0]).toMatchSnapshot();\n    expect(self.location.reload).toHaveBeenCalled();\n  });\n\n  it(\"should run onSocketMessage.warnings\", () => {\n    onSocketMessage.warnings([\"warn1\", \"\\u001B[4mwarn2\\u001B[0m\", \"warn3\"]);\n\n    expect(log.log.warn.mock.calls[0][0]).toMatchSnapshot();\n    expect(sendMessage.mock.calls[0][0]).toMatchSnapshot();\n    expect(log.log.warn.mock.calls.splice(1)).toMatchSnapshot();\n\n    // change flags\n    onSocketMessage.overlay({ warnings: true });\n    onSocketMessage.warnings([\"warning message\"]);\n\n    expect(overlay.send).toHaveBeenCalledTimes(1);\n    expect(overlay.send).toHaveBeenCalledWith({\n      type: \"BUILD_ERROR\",\n      level: \"warning\",\n      messages: [\"warning message\"],\n    });\n  });\n\n  it(\"should parse overlay options from resource query\", () => {\n    jest.isolateModules(() => {\n      // Pass JSON config with warnings disabled\n      globalThis.__resourceQuery = `?overlay=${encodeURIComponent(\n        '{\"warnings\": false}',\n      )}`;\n      overlay.send.mockReset();\n      socket.mockReset();\n      require(\"../../client-src\");\n      [[, onSocketMessage]] = socket.mock.calls;\n\n      onSocketMessage.warnings([\"warn1\"]);\n      expect(overlay.send).not.toHaveBeenCalled();\n\n      onSocketMessage.errors([\"error1\"]);\n      expect(overlay.send).toHaveBeenCalledTimes(1);\n      expect(overlay.send).toHaveBeenCalledWith({\n        type: \"BUILD_ERROR\",\n        level: \"error\",\n        messages: [\"error1\"],\n      });\n    });\n\n    jest.isolateModules(() => {\n      // Pass JSON config with errors disabled\n      globalThis.__resourceQuery = `?overlay=${encodeURIComponent(\n        '{\"errors\": false}',\n      )}`;\n      overlay.send.mockReset();\n      socket.mockReset();\n      require(\"../../client-src\");\n      [[, onSocketMessage]] = socket.mock.calls;\n\n      onSocketMessage.errors([\"error1\"]);\n      expect(overlay.send).not.toHaveBeenCalled();\n\n      onSocketMessage.warnings([\"warn1\"]);\n      expect(overlay.send).toHaveBeenCalledTimes(1);\n      expect(overlay.send).toHaveBeenCalledWith({\n        type: \"BUILD_ERROR\",\n        level: \"warning\",\n        messages: [\"warn1\"],\n      });\n    });\n\n    jest.isolateModules(() => {\n      // Use simple boolean\n      globalThis.__resourceQuery = \"?overlay=true\";\n      socket.mockReset();\n      overlay.send.mockReset();\n      require(\"../../client-src\");\n      [[, onSocketMessage]] = socket.mock.calls;\n\n      onSocketMessage.warnings([\"warn2\"]);\n      expect(overlay.send).toHaveBeenCalledTimes(1);\n      expect(overlay.send).toHaveBeenLastCalledWith({\n        type: \"BUILD_ERROR\",\n        level: \"warning\",\n        messages: [\"warn2\"],\n      });\n\n      onSocketMessage.errors([\"error2\"]);\n      expect(overlay.send).toHaveBeenCalledTimes(2);\n      expect(overlay.send).toHaveBeenLastCalledWith({\n        type: \"BUILD_ERROR\",\n        level: \"error\",\n        messages: [\"error2\"],\n      });\n    });\n  });\n\n  it(\"should run onSocketMessage.error\", () => {\n    onSocketMessage.error(\"error!!\");\n\n    expect(log.log.error.mock.calls[0][0]).toMatchSnapshot();\n  });\n\n  it(\"should run onSocketMessage.close\", () => {\n    onSocketMessage.close();\n\n    expect(log.log.info.mock.calls[1][0]).toMatchSnapshot();\n    expect(sendMessage.mock.calls[0][0]).toMatchSnapshot();\n  });\n\n  it(\"should run onSocketMessage.close (hot enabled)\", () => {\n    // enabling hot\n    onSocketMessage.hot();\n    onSocketMessage.close();\n\n    expect(log.log.info.mock.calls[1][0]).toMatchSnapshot();\n    expect(sendMessage.mock.calls[0][0]).toMatchSnapshot();\n  });\n\n  it(\"should run onSocketMessage.close (liveReload enabled)\", () => {\n    // enabling liveReload\n    onSocketMessage.liveReload();\n    onSocketMessage.close();\n\n    expect(log.log.info.mock.calls[1][0]).toMatchSnapshot();\n    expect(sendMessage.mock.calls[0][0]).toMatchSnapshot();\n  });\n});\n"
  },
  {
    "path": "test/client/socket-helper.test.js",
    "content": "/**\n * @jest-environment jsdom\n */\n\n\"use strict\";\n\ndescribe(\"socket\", () => {\n  beforeEach(() => {\n    jest.resetAllMocks();\n    jest.resetModules();\n  });\n\n  it(\"should default to WebsocketClient when no __webpack_dev_server_client__ set\", () => {\n    jest.mock(\"../../client/clients/WebSocketClient\");\n\n    const socket = require(\"../../client/socket\").default;\n    const WebsocketClient =\n      require(\"../../client/clients/WebSocketClient\").default;\n\n    const mockHandler = jest.fn();\n\n    socket(\"my.url\", {\n      example: mockHandler,\n    });\n\n    const [mockClientInstance] = WebsocketClient.mock.instances;\n\n    // this simulates receiving a message from the server and passing it\n    // along to the callback of onMessage\n    mockClientInstance.onMessage.mock.calls[0][0](\n      JSON.stringify({\n        type: \"example\",\n        data: \"hello world\",\n        params: { foo: \"bar\" },\n      }),\n    );\n\n    expect(WebsocketClient.mock.calls[0]).toMatchSnapshot();\n    expect(mockClientInstance.onOpen.mock.calls).toMatchSnapshot();\n    expect(mockClientInstance.onClose.mock.calls).toMatchSnapshot();\n    expect(mockClientInstance.onMessage.mock.calls).toMatchSnapshot();\n    expect(mockHandler.mock.calls).toMatchSnapshot();\n  });\n\n  it(\"should use __webpack_dev_server_client__ when set\", () => {\n    jest.mock(\"../../client/clients/WebSocketClient\");\n\n    const socket = require(\"../../client/socket\").default;\n\n    globalThis.__webpack_dev_server_client__ =\n      require(\"../../client/clients/WebSocketClient\").default;\n\n    const mockHandler = jest.fn();\n\n    socket(\"my.url\", {\n      example: mockHandler,\n    });\n\n    const [mockClientInstance] =\n      globalThis.__webpack_dev_server_client__.mock.instances;\n\n    // this simulates receiving a message from the server and passing it\n    // along to the callback of onMessage\n    mockClientInstance.onMessage.mock.calls[0][0](\n      JSON.stringify({\n        type: \"example\",\n        data: \"hello world\",\n        params: { foo: \"bar\" },\n      }),\n    );\n\n    expect(\n      globalThis.__webpack_dev_server_client__.mock.calls[0],\n    ).toMatchSnapshot();\n    expect(mockClientInstance.onOpen.mock.calls).toMatchSnapshot();\n    expect(mockClientInstance.onClose.mock.calls).toMatchSnapshot();\n    expect(mockClientInstance.onMessage.mock.calls).toMatchSnapshot();\n    expect(mockHandler.mock.calls).toMatchSnapshot();\n  });\n\n  it(\"should export initialized client\", () => {\n    const socket = require(\"../../client/socket\").default;\n\n    const nonInitializedInstance = require(\"../../client/socket\").client;\n\n    expect(nonInitializedInstance).toBeNull();\n\n    socket(\"my.url\", {});\n\n    const initializedInstance = require(\"../../client/socket\").client;\n\n    expect(initializedInstance).not.toBeNull();\n    expect(typeof initializedInstance.onClose).toBe(\"function\");\n    expect(typeof initializedInstance.onMessage).toBe(\"function\");\n    expect(typeof initializedInstance.onOpen).toBe(\"function\");\n  });\n});\n"
  },
  {
    "path": "test/client/utils/__snapshots__/getCurrentScriptSource.test.js.snap.webpack5",
    "content": "// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing\n\nexports[`'getCurrentScriptSource' function should fail when 'document.currentScript' doesn't exist and no 'script' tags 1`] = `[Error: [webpack-dev-server] Failed to get current script source.]`;\n\nexports[`'getCurrentScriptSource' function should fail when 'document.scripts' doesn't exist and no scripts 1`] = `[Error: [webpack-dev-server] Failed to get current script source.]`;\n\nexports[`'getCurrentScriptSource' function should fail when no scripts with the 'scr' attribute 1`] = `[Error: [webpack-dev-server] Failed to get current script source.]`;\n"
  },
  {
    "path": "test/client/utils/__snapshots__/log.test.js.snap.webpack5",
    "content": "// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing\n\nexports[`'log' function should set log level via setLogLevel 1`] = `\n[\n  [\n    {\n      \"level\": \"none\",\n    },\n  ],\n  [\n    {\n      \"level\": \"error\",\n    },\n  ],\n  [\n    {\n      \"level\": \"warn\",\n    },\n  ],\n  [\n    {\n      \"level\": \"info\",\n    },\n  ],\n  [\n    {\n      \"level\": \"log\",\n    },\n  ],\n  [\n    {\n      \"level\": \"verbose\",\n    },\n  ],\n]\n`;\n"
  },
  {
    "path": "test/client/utils/__snapshots__/reloadApp.test.js.snap.webpack5",
    "content": "// Jest Snapshot v1, https://goo.gl/fbAQLP\n\nexports[`'reloadApp' function should run hot 1`] = `\"App hot update...\"`;\n\nexports[`'reloadApp' function should run hot 2`] = `\"webpackHotUpdate\"`;\n\nexports[`'reloadApp' function should run hot 3`] = `\n[\n  \"webpackHotUpdatehash\",\n  \"*\",\n]\n`;\n\nexports[`'reloadApp' function should run liveReload when protocol is about: 1`] = `\"App updated. Reloading...\"`;\n\nexports[`'reloadApp' function should run liveReload when protocol is http: 1`] = `\"App updated. Reloading...\"`;\n"
  },
  {
    "path": "test/client/utils/__snapshots__/sendMessage.test.js.snap.webpack5",
    "content": "// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing\n\nexports[`'sendMessage' function should run self.postMessage 1`] = `\n[\n  {\n    \"data\": \"bar\",\n    \"type\": \"webpackfoo\",\n  },\n  \"*\",\n]\n`;\n"
  },
  {
    "path": "test/client/utils/createSocketURL.test.js",
    "content": "/**\n * @jest-environment jsdom\n */\n\n\"use strict\";\n\ndescribe(\"'createSocketURL' function\", () => {\n  globalThis.__webpack_hash__ = \"hash\";\n\n  const samples = [\n    // // __resourceQuery, location and socket URL\n    [\n      \"?hostname=example.com&pathname=/ws\",\n      \"http://example.com\",\n      \"ws://example.com/ws\",\n    ],\n    [\"?protocol=auto:\", \"http://example.com\", \"ws://example.com/ws\"],\n    [\"?protocol=auto:\", \"https://example.com\", \"wss://example.com/ws\"],\n    [\"?protocol=wss:\", \"http://example.com\", \"wss://example.com/ws\"],\n    [\"?protocol=https:\", \"https://example.com\", \"wss://example.com/ws\"],\n    [\"?protocol=http:\", \"https://example.com\", \"ws://example.com/ws\"],\n    [\"?hostname=example.com\", \"http://example.com\", \"ws://example.com/ws\"],\n    [\n      \"?username=username&password=password\",\n      \"http://example.com\",\n      \"ws://username:password@example.com/ws\",\n    ],\n    [\n      \"?hostname=example.com&port=80\",\n      \"http://example.com\",\n      \"ws://example.com:80/ws\",\n    ],\n    [\"?port=0\", \"http://example.com:8080\", \"ws://example.com:8080/ws\"],\n    [\"?port=80\", \"http://example.com:8080\", \"ws://example.com:80/ws\"],\n    [\"?hostname=0.0.0.0\", \"http://127.0.0.1\", \"ws://127.0.0.1/ws\"],\n    [\"?hostname=0.0.0.0\", \"http://192.168.0.1\", \"ws://192.168.0.1/ws\"],\n    [\"?hostname=0.0.0.0\", \"https://192.168.0.1\", \"wss://192.168.0.1/ws\"],\n    [\"?hostname=0.0.0.0\", \"https://example.com\", \"wss://example.com/ws\"],\n    [\n      \"?hostname=0.0.0.0\",\n      \"http://example.com:8080\",\n      \"ws://example.com:8080/ws\",\n    ],\n    [\n      \"?hostname=0.0.0.0\",\n      \"http://example.com:8080\",\n      \"ws://example.com:8080/ws\",\n    ],\n    [\n      \"?hostname=0.0.0.0\",\n      \"https://example.com:8080\",\n      \"wss://example.com:8080/ws\",\n    ],\n    [\"?hostname=::\", \"http://example.com:8080\", \"ws://example.com:8080/ws\"],\n    [\"?hostname=[::]\", \"http://example.com:8080\", \"ws://example.com:8080/ws\"],\n    [\"?hostname=[::]\", \"http://example.com:8080\", \"ws://example.com:8080/ws\"],\n\n    [\"?hostname=%3A%3A\", \"http://example.com:8080\", \"ws://example.com:8080/ws\"],\n    [\"?hostname=%3A%3A1\", \"http://example.com:8080\", \"ws://[::1]:8080/ws\"],\n    [\"?hostname=%3A%3A1\", \"https://example.com:8080\", \"wss://[::1]:8080/ws\"],\n    [\n      \"?hostname=%3A%3A\",\n      \"https://example.com:8080\",\n      \"wss://example.com:8080/ws\",\n    ],\n    [\n      \"?hostname=%3A%3A\",\n      \"https://example.com:8080\",\n      \"wss://example.com:8080/ws\",\n    ],\n    [\n      \"?pathname=/custom-ws\",\n      \"http://example.com\",\n      \"ws://example.com/custom-ws\",\n    ],\n    [\n      \"?protocol=wss:&username=user&password=password&hostname=localhost&port=8080&pathname=/ws\",\n      \"http://user:password@localhost/\",\n      \"wss://user:password@localhost:8080/ws\",\n    ],\n    [null, \"http://example.com\", \"ws://example.com/ws\"],\n    [null, \"https://example.com\", \"wss://example.com/ws\"],\n    [null, \"http://example.com:8080\", \"ws://example.com:8080/ws\"],\n    [null, \"http://example.com/foo/bar\", \"ws://example.com/ws\"],\n    [\n      null,\n      \"http://user:password@localhost/\",\n      \"ws://user:password@localhost/ws\",\n    ],\n    [null, \"http://user@localhost:8080/\", \"ws://user@localhost:8080/ws\"],\n    [\n      null,\n      \"http://user:password@localhost:8080/\",\n      \"ws://user:password@localhost:8080/ws\",\n    ],\n    [null, \"https://localhost:8080\", \"wss://localhost:8080/ws\"],\n    [null, \"http://127.0.0.1\", \"ws://127.0.0.1/ws\"],\n    [null, \"http://127.0.0.1:8080\", \"ws://127.0.0.1:8080/ws\"],\n    [null, \"https://127.0.0.1\", \"wss://127.0.0.1/ws\"],\n    [null, \"http://[::1]:8080/ws\", \"ws://[::1]:8080/ws\"],\n    [null, \"https://[::1]:8080/ws\", \"wss://[::1]:8080/ws\"],\n    [null, \"file:///home/user/project/index.html\", \"ws://localhost/ws\"],\n    [null, \"chrome-extension://localhost/\", \"ws://localhost/ws\"],\n    [null, \"file://localhost/\", \"ws://localhost/ws\"],\n  ];\n\n  for (const [__resourceQuery, location, expected] of samples) {\n    it(`should return '${expected}' socket URL when '__resourceQuery' is '${__resourceQuery}' and 'self.location' is '${location}'`, () => {\n      globalThis.__resourceQuery = __resourceQuery;\n\n      if (__resourceQuery === null) {\n        Object.defineProperty(document, \"currentScript\", {\n          value: document.createElement(\"script\"),\n          configurable: true,\n        });\n      }\n\n      const client = require(\"../../../client-src/index\");\n\n      const { createSocketURL } = client;\n      const { parseURL } = client;\n\n      const selfLocation = new URL(location);\n\n      delete globalThis.location;\n\n      globalThis.location = selfLocation;\n\n      const parsedURL = parseURL(__resourceQuery);\n\n      if (__resourceQuery === null) {\n        Object.defineProperty(document, \"currentScript\", {\n          value: null,\n          configurable: true,\n        });\n      }\n\n      expect(createSocketURL(parsedURL)).toBe(expected);\n    });\n\n    jest.resetModules();\n  }\n});\n"
  },
  {
    "path": "test/client/utils/getCurrentScriptSource.test.js",
    "content": "/**\n * @jest-environment jsdom\n */\n\n\"use strict\";\n\ndescribe(\"'getCurrentScriptSource' function\", () => {\n  let getCurrentScriptSource;\n\n  beforeEach(() => {\n    globalThis.__webpack_hash__ = \"mock-hash\";\n    globalThis.__resourceQuery = \"?protocol=ws&hostname=0.0.0.0\";\n\n    getCurrentScriptSource =\n      require(\"../../../client-src/index\").getCurrentScriptSource;\n  });\n\n  afterEach(() => {\n    Object.defineProperty(document, \"currentScript\", {\n      value: undefined,\n      writable: true,\n    });\n    Object.defineProperty(document, \"scripts\", {\n      value: [],\n      writable: true,\n    });\n  });\n\n  it(\"should fail when 'document.currentScript' doesn't exist and no 'script' tags\", () => {\n    try {\n      getCurrentScriptSource();\n    } catch (error) {\n      expect(error).toMatchSnapshot();\n    }\n  });\n\n  it(\"should return src when 'document.currentScript' exists\", () => {\n    const elm = document.createElement(\"script\");\n\n    elm.setAttribute(\"src\", \"foo\");\n\n    Object.defineProperty(document, \"currentScript\", {\n      value: elm,\n    });\n\n    expect(getCurrentScriptSource()).toBe(\"foo\");\n  });\n\n  it(\"should fail when 'document.scripts' doesn't exist and no scripts\", () => {\n    Object.defineProperty(document, \"scripts\", {\n      value: undefined,\n      writable: true,\n    });\n\n    try {\n      getCurrentScriptSource();\n    } catch (error) {\n      expect(error).toMatchSnapshot();\n    }\n  });\n\n  it(\"should return the 'src' attribute of the last 'script' tag\", () => {\n    const elements = [\"foo\", \"bar\"].map((src) => {\n      const element = document.createElement(\"script\");\n\n      element.setAttribute(\"src\", src);\n\n      return element;\n    });\n\n    Object.defineProperty(document, \"scripts\", {\n      value: elements,\n    });\n\n    expect(getCurrentScriptSource()).toBe(\"bar\");\n  });\n\n  it(\"should fail when no scripts with the 'scr' attribute\", () => {\n    const elements = [\"foo\", \"bar\"].map(() => document.createElement(\"script\"));\n\n    Object.defineProperty(document, \"scripts\", {\n      value: elements,\n    });\n\n    try {\n      getCurrentScriptSource();\n    } catch (error) {\n      expect(error).toMatchSnapshot();\n    }\n  });\n});\n"
  },
  {
    "path": "test/client/utils/log.test.js",
    "content": "/**\n * @jest-environment jsdom\n */\n\n\"use strict\";\n\ndescribe(\"'log' function\", () => {\n  let logMock;\n  let setLogLevel;\n\n  beforeEach(() => {\n    jest.setMock(\"webpack/lib/logging/runtime\", {\n      getLogger: jest.fn(),\n      configureDefaultLogger: jest.fn(),\n    });\n    logMock = require(\"webpack/lib/logging/runtime\");\n\n    setLogLevel = require(\"../../../client-src/utils/log\").setLogLevel;\n  });\n\n  afterEach(() => {\n    logMock.getLogger.mockClear();\n    logMock.configureDefaultLogger.mockClear();\n  });\n\n  it(\"should set info as the default level and create logger\", () => {\n    const { getLogger } = logMock;\n    const { configureDefaultLogger } = logMock;\n\n    expect(configureDefaultLogger).toHaveBeenCalled();\n    expect(configureDefaultLogger.mock.calls[0][0]).toEqual({\n      level: \"info\",\n    });\n\n    expect(getLogger).toHaveBeenCalled();\n    expect(getLogger.mock.calls[0][0]).toBe(\"webpack-dev-server\");\n  });\n\n  it(\"should set log level via setLogLevel\", () => {\n    for (const level of [\"none\", \"error\", \"warn\", \"info\", \"log\", \"verbose\"]) {\n      setLogLevel(level);\n    }\n\n    expect(logMock.configureDefaultLogger.mock.calls).toMatchSnapshot();\n  });\n});\n"
  },
  {
    "path": "test/client/utils/sendMessage.test.js",
    "content": "/**\n * @jest-environment jsdom\n */\n\n\"use strict\";\n\nconst sendMessage = require(\"../../../client-src/utils/sendMessage\").default;\n\ndescribe(\"'sendMessage' function\", () => {\n  afterEach(() => {\n    jest.resetAllMocks();\n  });\n\n  it(\"should run self.postMessage\", () => {\n    jest.spyOn(globalThis, \"postMessage\").mockImplementation();\n\n    sendMessage(\"foo\", \"bar\");\n\n    expect(self.postMessage).toHaveBeenCalled();\n    expect(self.postMessage.mock.calls[0]).toMatchSnapshot();\n  });\n});\n"
  },
  {
    "path": "test/e2e/__snapshots__/allowed-hosts.test.js.snap.webpack5",
    "content": "// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing\n\nexports[`allowed hosts check host headers should allow hosts in allowedHosts: console messages 1`] = `[]`;\n\nexports[`allowed hosts check host headers should allow hosts in allowedHosts: page errors 1`] = `[]`;\n\nexports[`allowed hosts check host headers should allow hosts in allowedHosts: response status 1`] = `200`;\n\nexports[`allowed hosts check host headers should allow hosts that pass a wildcard in allowedHosts: console messages 1`] = `[]`;\n\nexports[`allowed hosts check host headers should allow hosts that pass a wildcard in allowedHosts: page errors 1`] = `[]`;\n\nexports[`allowed hosts check host headers should allow hosts that pass a wildcard in allowedHosts: response status 1`] = `200`;\n\nexports[`allowed hosts check host headers should always allow \\`localhost\\` if options.allowedHosts is auto: console messages 1`] = `[]`;\n\nexports[`allowed hosts check host headers should always allow \\`localhost\\` if options.allowedHosts is auto: page errors 1`] = `[]`;\n\nexports[`allowed hosts check host headers should always allow \\`localhost\\` if options.allowedHosts is auto: response status 1`] = `200`;\n\nexports[`allowed hosts check host headers should always allow \\`localhost\\` subdomain if options.allowedHosts is auto: console messages 1`] = `[]`;\n\nexports[`allowed hosts check host headers should always allow \\`localhost\\` subdomain if options.allowedHosts is auto: page errors 1`] = `[]`;\n\nexports[`allowed hosts check host headers should always allow \\`localhost\\` subdomain if options.allowedHosts is auto: response status 1`] = `200`;\n\nexports[`allowed hosts check host headers should always allow any host if options.allowedHosts is all: console messages 1`] = `[]`;\n\nexports[`allowed hosts check host headers should always allow any host if options.allowedHosts is all: page errors 1`] = `[]`;\n\nexports[`allowed hosts check host headers should always allow any host if options.allowedHosts is all: response status 1`] = `200`;\n\nexports[`allowed hosts check host headers should always allow value from the \\`host\\` options if options.allowedHosts is auto: console messages 1`] = `[]`;\n\nexports[`allowed hosts check host headers should always allow value from the \\`host\\` options if options.allowedHosts is auto: page errors 1`] = `[]`;\n\nexports[`allowed hosts check host headers should always allow value from the \\`host\\` options if options.allowedHosts is auto: response status 1`] = `200`;\n\nexports[`allowed hosts check host headers should always allow value of the \\`host\\` option from the \\`client.webSocketURL\\` option if options.allowedHosts is auto: console messages 1`] = `[]`;\n\nexports[`allowed hosts check host headers should always allow value of the \\`host\\` option from the \\`client.webSocketURL\\` option if options.allowedHosts is auto: page errors 1`] = `[]`;\n\nexports[`allowed hosts check host headers should always allow value of the \\`host\\` option from the \\`client.webSocketURL\\` option if options.allowedHosts is auto: response status 1`] = `200`;\n\nexports[`allowed hosts should connect web socket client using \"[::1] host to web socket server with the \"auto\" value (\"sockjs\"): console messages 1`] = `\n[\n  \"[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.\",\n  \"[HMR] Waiting for update signal from WDS...\",\n  \"Hey.\",\n]\n`;\n\nexports[`allowed hosts should connect web socket client using \"[::1] host to web socket server with the \"auto\" value (\"sockjs\"): page errors 1`] = `[]`;\n\nexports[`allowed hosts should connect web socket client using \"[::1] host to web socket server with the \"auto\" value (\"ws\"): console messages 1`] = `\n[\n  \"[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.\",\n  \"[HMR] Waiting for update signal from WDS...\",\n  \"Hey.\",\n]\n`;\n\nexports[`allowed hosts should connect web socket client using \"[::1] host to web socket server with the \"auto\" value (\"ws\"): page errors 1`] = `[]`;\n\nexports[`allowed hosts should connect web socket client using \"0.0.0.0\" host to web socket server with the \"auto\" value (\"sockjs\"): console messages 1`] = `\n[\n  \"[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.\",\n  \"[HMR] Waiting for update signal from WDS...\",\n  \"Hey.\",\n]\n`;\n\nexports[`allowed hosts should connect web socket client using \"0.0.0.0\" host to web socket server with the \"auto\" value (\"sockjs\"): page errors 1`] = `[]`;\n\nexports[`allowed hosts should connect web socket client using \"0.0.0.0\" host to web socket server with the \"auto\" value (\"ws\"): console messages 1`] = `\n[\n  \"[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.\",\n  \"[HMR] Waiting for update signal from WDS...\",\n  \"Hey.\",\n]\n`;\n\nexports[`allowed hosts should connect web socket client using \"0.0.0.0\" host to web socket server with the \"auto\" value (\"ws\"): page errors 1`] = `[]`;\n\nexports[`allowed hosts should connect web socket client using \"127.0.0.1\" host to web socket server by default (\"sockjs\"): console messages 1`] = `\n[\n  \"[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.\",\n  \"[HMR] Waiting for update signal from WDS...\",\n  \"Hey.\",\n]\n`;\n\nexports[`allowed hosts should connect web socket client using \"127.0.0.1\" host to web socket server by default (\"sockjs\"): page errors 1`] = `[]`;\n\nexports[`allowed hosts should connect web socket client using \"127.0.0.1\" host to web socket server by default (\"ws\"): console messages 1`] = `\n[\n  \"[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.\",\n  \"[HMR] Waiting for update signal from WDS...\",\n  \"Hey.\",\n]\n`;\n\nexports[`allowed hosts should connect web socket client using \"127.0.0.1\" host to web socket server by default (\"ws\"): page errors 1`] = `[]`;\n\nexports[`allowed hosts should connect web socket client using \"127.0.0.1\" host to web socket server with the \"auto\" value (\"sockjs\"): console messages 1`] = `\n[\n  \"[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.\",\n  \"[HMR] Waiting for update signal from WDS...\",\n  \"Hey.\",\n]\n`;\n\nexports[`allowed hosts should connect web socket client using \"127.0.0.1\" host to web socket server with the \"auto\" value (\"sockjs\"): page errors 1`] = `[]`;\n\nexports[`allowed hosts should connect web socket client using \"127.0.0.1\" host to web socket server with the \"auto\" value (\"ws\"): console messages 1`] = `\n[\n  \"[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.\",\n  \"[HMR] Waiting for update signal from WDS...\",\n  \"Hey.\",\n]\n`;\n\nexports[`allowed hosts should connect web socket client using \"127.0.0.1\" host to web socket server with the \"auto\" value (\"ws\"): page errors 1`] = `[]`;\n\nexports[`allowed hosts should connect web socket client using \"chrome-extension:\" protocol to web socket server with the \"auto\" value (\"sockjs\"): console messages 1`] = `\n[\n  \"[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.\",\n  \"[HMR] Waiting for update signal from WDS...\",\n  \"Hey.\",\n]\n`;\n\nexports[`allowed hosts should connect web socket client using \"chrome-extension:\" protocol to web socket server with the \"auto\" value (\"sockjs\"): page errors 1`] = `[]`;\n\nexports[`allowed hosts should connect web socket client using \"chrome-extension:\" protocol to web socket server with the \"auto\" value (\"ws\"): console messages 1`] = `\n[\n  \"[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.\",\n  \"[HMR] Waiting for update signal from WDS...\",\n  \"Hey.\",\n]\n`;\n\nexports[`allowed hosts should connect web socket client using \"chrome-extension:\" protocol to web socket server with the \"auto\" value (\"ws\"): page errors 1`] = `[]`;\n\nexports[`allowed hosts should connect web socket client using \"file:\" protocol to web socket server with the \"auto\" value (\"sockjs\"): console messages 1`] = `\n[\n  \"[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.\",\n  \"[HMR] Waiting for update signal from WDS...\",\n  \"Hey.\",\n]\n`;\n\nexports[`allowed hosts should connect web socket client using \"file:\" protocol to web socket server with the \"auto\" value (\"sockjs\"): page errors 1`] = `[]`;\n\nexports[`allowed hosts should connect web socket client using \"file:\" protocol to web socket server with the \"auto\" value (\"ws\"): console messages 1`] = `\n[\n  \"[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.\",\n  \"[HMR] Waiting for update signal from WDS...\",\n  \"Hey.\",\n]\n`;\n\nexports[`allowed hosts should connect web socket client using \"file:\" protocol to web socket server with the \"auto\" value (\"ws\"): page errors 1`] = `[]`;\n\nexports[`allowed hosts should connect web socket client using \"localhost\" host to web socket server by default (\"sockjs\"): console messages 1`] = `\n[\n  \"[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.\",\n  \"[HMR] Waiting for update signal from WDS...\",\n  \"Hey.\",\n]\n`;\n\nexports[`allowed hosts should connect web socket client using \"localhost\" host to web socket server by default (\"sockjs\"): page errors 1`] = `[]`;\n\nexports[`allowed hosts should connect web socket client using \"localhost\" host to web socket server by default (\"ws\"): console messages 1`] = `\n[\n  \"[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.\",\n  \"[HMR] Waiting for update signal from WDS...\",\n  \"Hey.\",\n]\n`;\n\nexports[`allowed hosts should connect web socket client using \"localhost\" host to web socket server by default (\"ws\"): page errors 1`] = `[]`;\n\nexports[`allowed hosts should connect web socket client using custom hostname to web socket server with the \"all\" value (\"sockjs\"): console messages 1`] = `\n[\n  \"[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.\",\n  \"[HMR] Waiting for update signal from WDS...\",\n  \"Hey.\",\n]\n`;\n\nexports[`allowed hosts should connect web socket client using custom hostname to web socket server with the \"all\" value (\"sockjs\"): page errors 1`] = `[]`;\n\nexports[`allowed hosts should connect web socket client using custom hostname to web socket server with the \"all\" value (\"ws\"): console messages 1`] = `\n[\n  \"[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.\",\n  \"[HMR] Waiting for update signal from WDS...\",\n  \"Hey.\",\n]\n`;\n\nexports[`allowed hosts should connect web socket client using custom hostname to web socket server with the \"all\" value (\"ws\"): page errors 1`] = `[]`;\n\nexports[`allowed hosts should connect web socket client using custom hostname to web socket server with the \"all\" value in array (\"sockjs\"): console messages 1`] = `\n[\n  \"[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.\",\n  \"[HMR] Waiting for update signal from WDS...\",\n  \"Hey.\",\n]\n`;\n\nexports[`allowed hosts should connect web socket client using custom hostname to web socket server with the \"all\" value in array (\"sockjs\"): page errors 1`] = `[]`;\n\nexports[`allowed hosts should connect web socket client using custom hostname to web socket server with the \"all\" value in array (\"ws\"): console messages 1`] = `\n[\n  \"[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.\",\n  \"[HMR] Waiting for update signal from WDS...\",\n  \"Hey.\",\n]\n`;\n\nexports[`allowed hosts should connect web socket client using custom hostname to web socket server with the \"all\" value in array (\"ws\"): page errors 1`] = `[]`;\n\nexports[`allowed hosts should connect web socket client using custom hostname to web socket server with the custom hostname value (\"sockjs\"): console messages 1`] = `\n[\n  \"[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.\",\n  \"[HMR] Waiting for update signal from WDS...\",\n  \"Hey.\",\n]\n`;\n\nexports[`allowed hosts should connect web socket client using custom hostname to web socket server with the custom hostname value (\"sockjs\"): page errors 1`] = `[]`;\n\nexports[`allowed hosts should connect web socket client using custom hostname to web socket server with the custom hostname value (\"ws\"): console messages 1`] = `\n[\n  \"[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.\",\n  \"[HMR] Waiting for update signal from WDS...\",\n  \"Hey.\",\n]\n`;\n\nexports[`allowed hosts should connect web socket client using custom hostname to web socket server with the custom hostname value (\"ws\"): page errors 1`] = `[]`;\n\nexports[`allowed hosts should connect web socket client using custom hostname to web socket server with the custom hostname value starting with dot (\"sockjs\"): console messages 1`] = `\n[\n  \"[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.\",\n  \"[HMR] Waiting for update signal from WDS...\",\n  \"Hey.\",\n]\n`;\n\nexports[`allowed hosts should connect web socket client using custom hostname to web socket server with the custom hostname value starting with dot (\"sockjs\"): page errors 1`] = `[]`;\n\nexports[`allowed hosts should connect web socket client using custom hostname to web socket server with the custom hostname value starting with dot (\"ws\"): console messages 1`] = `\n[\n  \"[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.\",\n  \"[HMR] Waiting for update signal from WDS...\",\n  \"Hey.\",\n]\n`;\n\nexports[`allowed hosts should connect web socket client using custom hostname to web socket server with the custom hostname value starting with dot (\"ws\"): page errors 1`] = `[]`;\n\nexports[`allowed hosts should connect web socket client using custom hostname to web socket server with the multiple custom hostname values (\"sockjs\"): console messages 1`] = `\n[\n  \"[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.\",\n  \"[HMR] Waiting for update signal from WDS...\",\n  \"Hey.\",\n]\n`;\n\nexports[`allowed hosts should connect web socket client using custom hostname to web socket server with the multiple custom hostname values (\"sockjs\"): page errors 1`] = `[]`;\n\nexports[`allowed hosts should connect web socket client using custom hostname to web socket server with the multiple custom hostname values (\"ws\"): console messages 1`] = `\n[\n  \"[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.\",\n  \"[HMR] Waiting for update signal from WDS...\",\n  \"Hey.\",\n]\n`;\n\nexports[`allowed hosts should connect web socket client using custom hostname to web socket server with the multiple custom hostname values (\"ws\"): page errors 1`] = `[]`;\n\nexports[`allowed hosts should connect web socket client using custom sub hostname to web socket server with the custom hostname value (\"sockjs\"): console messages 1`] = `\n[\n  \"[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.\",\n  \"[HMR] Waiting for update signal from WDS...\",\n  \"Hey.\",\n]\n`;\n\nexports[`allowed hosts should connect web socket client using custom sub hostname to web socket server with the custom hostname value (\"sockjs\"): page errors 1`] = `[]`;\n\nexports[`allowed hosts should connect web socket client using custom sub hostname to web socket server with the custom hostname value (\"ws\"): console messages 1`] = `\n[\n  \"[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.\",\n  \"[HMR] Waiting for update signal from WDS...\",\n  \"Hey.\",\n]\n`;\n\nexports[`allowed hosts should connect web socket client using custom sub hostname to web socket server with the custom hostname value (\"ws\"): page errors 1`] = `[]`;\n\nexports[`allowed hosts should connect web socket client using localhost to web socket server with the \"auto\" value (\"sockjs\"): console messages 1`] = `\n[\n  \"[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.\",\n  \"[HMR] Waiting for update signal from WDS...\",\n  \"Hey.\",\n]\n`;\n\nexports[`allowed hosts should connect web socket client using localhost to web socket server with the \"auto\" value (\"sockjs\"): page errors 1`] = `[]`;\n\nexports[`allowed hosts should connect web socket client using localhost to web socket server with the \"auto\" value (\"ws\"): console messages 1`] = `\n[\n  \"[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.\",\n  \"[HMR] Waiting for update signal from WDS...\",\n  \"Hey.\",\n]\n`;\n\nexports[`allowed hosts should connect web socket client using localhost to web socket server with the \"auto\" value (\"ws\"): page errors 1`] = `[]`;\n\nexports[`allowed hosts should connect web socket client using origin header containing an IP address with the custom hostname value (\"sockjs\"): (work) console messages 1`] = `\n[\n  \"[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.\",\n  \"[HMR] Waiting for update signal from WDS...\",\n  \"Hey.\",\n]\n`;\n\nexports[`allowed hosts should connect web socket client using origin header containing an IP address with the custom hostname value (\"sockjs\"): (work) page errors 1`] = `[]`;\n\nexports[`allowed hosts should connect web socket client using origin header containing an IP address with the custom hostname value (\"ws\"): (work) console messages 1`] = `\n[\n  \"[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.\",\n  \"[HMR] Waiting for update signal from WDS...\",\n  \"Hey.\",\n]\n`;\n\nexports[`allowed hosts should connect web socket client using origin header containing an IP address with the custom hostname value (\"ws\"): (work) page errors 1`] = `[]`;\n\nexports[`allowed hosts should disconnect web client using localhost to web socket server with the \"auto\" value (\"sockjs\"): console messages 1`] = `\n[\n  \"Failed to load resource: the server responded with a status of 403 (Forbidden)\",\n]\n`;\n\nexports[`allowed hosts should disconnect web client using localhost to web socket server with the \"auto\" value (\"sockjs\"): html 1`] = `\"<html><head><meta name=\"color-scheme\" content=\"light dark\"></head><body><pre style=\"word-wrap: break-word; white-space: pre-wrap;\">Invalid Host header</pre></body></html>\"`;\n\nexports[`allowed hosts should disconnect web client using localhost to web socket server with the \"auto\" value (\"sockjs\"): page errors 1`] = `[]`;\n\nexports[`allowed hosts should disconnect web client using localhost to web socket server with the \"auto\" value (\"ws\"): console messages 1`] = `\n[\n  \"Failed to load resource: the server responded with a status of 403 (Forbidden)\",\n]\n`;\n\nexports[`allowed hosts should disconnect web client using localhost to web socket server with the \"auto\" value (\"ws\"): html 1`] = `\"<html><head><meta name=\"color-scheme\" content=\"light dark\"></head><body><pre style=\"word-wrap: break-word; white-space: pre-wrap;\">Invalid Host header</pre></body></html>\"`;\n\nexports[`allowed hosts should disconnect web client using localhost to web socket server with the \"auto\" value (\"ws\"): page errors 1`] = `[]`;\n\nexports[`allowed hosts should disconnect web client using origin header containing an IP address with the \"auto\" value (\"sockjs\"): (work) console messages 1`] = `\n[\n  \"[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.\",\n  \"[HMR] Waiting for update signal from WDS...\",\n  \"Hey.\",\n  \"[webpack-dev-server] Invalid Host/Origin header\",\n  \"[webpack-dev-server] Disconnected!\",\n  \"[webpack-dev-server] Trying to reconnect...\",\n]\n`;\n\nexports[`allowed hosts should disconnect web client using origin header containing an IP address with the \"auto\" value (\"sockjs\"): (work) page errors 1`] = `[]`;\n\nexports[`allowed hosts should disconnect web client using origin header containing an IP address with the \"auto\" value (\"ws\"): (work) console messages 1`] = `\n[\n  \"[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.\",\n  \"[HMR] Waiting for update signal from WDS...\",\n  \"Hey.\",\n  \"[webpack-dev-server] Invalid Host/Origin header\",\n  \"[webpack-dev-server] Disconnected!\",\n  \"[webpack-dev-server] Trying to reconnect...\",\n]\n`;\n\nexports[`allowed hosts should disconnect web client using origin header containing an IP address with the \"auto\" value (\"ws\"): (work) page errors 1`] = `[]`;\n\nexports[`allowed hosts should disconnect web socket client using custom hostname from web socket server with the \"auto\" value based on the \"host\" header (\"sockjs\"): console messages 1`] = `\n[\n  \"[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.\",\n  \"[HMR] Waiting for update signal from WDS...\",\n  \"Hey.\",\n  \"[webpack-dev-server] Invalid Host/Origin header\",\n  \"[webpack-dev-server] Disconnected!\",\n  \"[webpack-dev-server] Trying to reconnect...\",\n]\n`;\n\nexports[`allowed hosts should disconnect web socket client using custom hostname from web socket server with the \"auto\" value based on the \"host\" header (\"sockjs\"): page errors 1`] = `[]`;\n\nexports[`allowed hosts should disconnect web socket client using custom hostname from web socket server with the \"auto\" value based on the \"host\" header (\"ws\"): console messages 1`] = `\n[\n  \"[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.\",\n  \"[HMR] Waiting for update signal from WDS...\",\n  \"Hey.\",\n  \"[webpack-dev-server] Invalid Host/Origin header\",\n  \"[webpack-dev-server] Disconnected!\",\n  \"[webpack-dev-server] Trying to reconnect...\",\n]\n`;\n\nexports[`allowed hosts should disconnect web socket client using custom hostname from web socket server with the \"auto\" value based on the \"host\" header (\"ws\"): page errors 1`] = `[]`;\n\nexports[`allowed hosts should disconnect web socket client using custom hostname from web socket server with the \"auto\" value based on the \"host\" header when \"server: 'https'\" is enabled (\"sockjs\"): console messages 1`] = `\n[\n  \"[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.\",\n  \"[HMR] Waiting for update signal from WDS...\",\n  \"Hey.\",\n  \"[webpack-dev-server] Invalid Host/Origin header\",\n  \"[webpack-dev-server] Disconnected!\",\n  \"[webpack-dev-server] Trying to reconnect...\",\n]\n`;\n\nexports[`allowed hosts should disconnect web socket client using custom hostname from web socket server with the \"auto\" value based on the \"host\" header when \"server: 'https'\" is enabled (\"sockjs\"): page errors 1`] = `[]`;\n\nexports[`allowed hosts should disconnect web socket client using custom hostname from web socket server with the \"auto\" value based on the \"host\" header when \"server: 'https'\" is enabled (\"ws\"): console messages 1`] = `\n[\n  \"[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.\",\n  \"[HMR] Waiting for update signal from WDS...\",\n  \"Hey.\",\n  \"[webpack-dev-server] Invalid Host/Origin header\",\n  \"[webpack-dev-server] Disconnected!\",\n  \"[webpack-dev-server] Trying to reconnect...\",\n]\n`;\n\nexports[`allowed hosts should disconnect web socket client using custom hostname from web socket server with the \"auto\" value based on the \"host\" header when \"server: 'https'\" is enabled (\"ws\"): page errors 1`] = `[]`;\n\nexports[`allowed hosts should disconnect web socket client using custom hostname from web socket server with the \"auto\" value based on the \"origin\" header (\"sockjs\"): console messages 1`] = `\n[\n  \"[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.\",\n  \"[HMR] Waiting for update signal from WDS...\",\n  \"Hey.\",\n  \"[webpack-dev-server] Invalid Host/Origin header\",\n  \"[webpack-dev-server] Disconnected!\",\n  \"[webpack-dev-server] Trying to reconnect...\",\n]\n`;\n\nexports[`allowed hosts should disconnect web socket client using custom hostname from web socket server with the \"auto\" value based on the \"origin\" header (\"sockjs\"): page errors 1`] = `[]`;\n\nexports[`allowed hosts should disconnect web socket client using custom hostname from web socket server with the \"auto\" value based on the \"origin\" header (\"ws\"): console messages 1`] = `\n[\n  \"[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.\",\n  \"[HMR] Waiting for update signal from WDS...\",\n  \"Hey.\",\n  \"[webpack-dev-server] Invalid Host/Origin header\",\n  \"[webpack-dev-server] Disconnected!\",\n  \"[webpack-dev-server] Trying to reconnect...\",\n]\n`;\n\nexports[`allowed hosts should disconnect web socket client using custom hostname from web socket server with the \"auto\" value based on the \"origin\" header (\"ws\"): page errors 1`] = `[]`;\n"
  },
  {
    "path": "test/e2e/__snapshots__/api.test.js.snap.webpack5",
    "content": "// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing\n\nexports[`API Invalidate callback should use the default \\`noop\\` callback when invalidate is called without any callback: console messages 1`] = `\n[\n  \"[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.\",\n  \"[HMR] Waiting for update signal from WDS...\",\n  \"Hey.\",\n]\n`;\n\nexports[`API Invalidate callback should use the default \\`noop\\` callback when invalidate is called without any callback: page errors 1`] = `[]`;\n\nexports[`API Invalidate callback should use the default \\`noop\\` callback when invalidate is called without any callback: response status 1`] = `200`;\n\nexports[`API Invalidate callback should use the provided \\`callback\\` function: console messages 1`] = `\n[\n  \"[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.\",\n  \"[HMR] Waiting for update signal from WDS...\",\n  \"Hey.\",\n]\n`;\n\nexports[`API Invalidate callback should use the provided \\`callback\\` function: page errors 1`] = `[]`;\n\nexports[`API Invalidate callback should use the provided \\`callback\\` function: response status 1`] = `200`;\n\nexports[`API Server.checkHostHeader should allow URLs with scheme for checking origin when the \"option.client.webSocketURL\" is object: console messages 1`] = `\n[\n  \"[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.\",\n  \"[HMR] Waiting for update signal from WDS...\",\n  \"Hey.\",\n  \"WebSocket connection to 'ws://test.host:8158/ws' failed: Error in connection establishment: net::ERR_NAME_NOT_RESOLVED\",\n  \"[webpack-dev-server] JSHandle@object\",\n  \"[webpack-dev-server] Disconnected!\",\n  \"[webpack-dev-server] Trying to reconnect...\",\n]\n`;\n\nexports[`API Server.checkHostHeader should allow URLs with scheme for checking origin when the \"option.client.webSocketURL\" is object: page errors 1`] = `[]`;\n\nexports[`API Server.checkHostHeader should allow URLs with scheme for checking origin when the \"option.client.webSocketURL\" is object: response status 1`] = `200`;\n\nexports[`API Server.checkHostHeader should allow URLs with scheme for checking origin when the \"option.client.webSocketURL\" is object: web socket URL 1`] = `\"ws://test.host:8158/ws\"`;\n\nexports[`API Server.getFreePort should retry finding the port for up to defaultPortRetry times (number): console messages 1`] = `\n[\n  \"[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.\",\n  \"[HMR] Waiting for update signal from WDS...\",\n  \"Hey.\",\n]\n`;\n\nexports[`API Server.getFreePort should retry finding the port for up to defaultPortRetry times (number): page errors 1`] = `[]`;\n\nexports[`API Server.getFreePort should retry finding the port for up to defaultPortRetry times (number): response status 1`] = `200`;\n\nexports[`API Server.getFreePort should retry finding the port for up to defaultPortRetry times (string): console messages 1`] = `\n[\n  \"[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.\",\n  \"[HMR] Waiting for update signal from WDS...\",\n  \"Hey.\",\n]\n`;\n\nexports[`API Server.getFreePort should retry finding the port for up to defaultPortRetry times (string): page errors 1`] = `[]`;\n\nexports[`API Server.getFreePort should retry finding the port for up to defaultPortRetry times (string): response status 1`] = `200`;\n\nexports[`API Server.getFreePort should retry finding the port when serial ports are busy: console messages 1`] = `\n[\n  \"[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.\",\n  \"[HMR] Waiting for update signal from WDS...\",\n  \"Hey.\",\n]\n`;\n\nexports[`API Server.getFreePort should retry finding the port when serial ports are busy: page errors 1`] = `[]`;\n\nexports[`API Server.getFreePort should retry finding the port when serial ports are busy: response status 1`] = `200`;\n\nexports[`API Server.getFreePort should return the port when the port is \\`null\\`: console messages 1`] = `\n[\n  \"[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.\",\n  \"[HMR] Waiting for update signal from WDS...\",\n  \"Hey.\",\n]\n`;\n\nexports[`API Server.getFreePort should return the port when the port is \\`null\\`: page errors 1`] = `[]`;\n\nexports[`API Server.getFreePort should return the port when the port is \\`null\\`: response status 1`] = `200`;\n\nexports[`API Server.getFreePort should return the port when the port is undefined: console messages 1`] = `\n[\n  \"[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.\",\n  \"[HMR] Waiting for update signal from WDS...\",\n  \"Hey.\",\n]\n`;\n\nexports[`API Server.getFreePort should return the port when the port is undefined: page errors 1`] = `[]`;\n\nexports[`API Server.getFreePort should return the port when the port is undefined: response status 1`] = `200`;\n\nexports[`API Server.getFreePort should throw the error when the port isn't found 1`] = `\"busy\"`;\n\nexports[`API WEBPACK_SERVE environment variable should be present: console messages 1`] = `\n[\n  \"[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.\",\n  \"[HMR] Waiting for update signal from WDS...\",\n  \"Hey.\",\n]\n`;\n\nexports[`API WEBPACK_SERVE environment variable should be present: page errors 1`] = `[]`;\n\nexports[`API WEBPACK_SERVE environment variable should be present: response status 1`] = `200`;\n\nexports[`API latest async API should work and allow to rerun dev server multiple times: console messages 1`] = `\n[\n  \"[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.\",\n  \"[HMR] Waiting for update signal from WDS...\",\n  \"Hey.\",\n]\n`;\n\nexports[`API latest async API should work and allow to rerun dev server multiple times: console messages 2`] = `\n[\n  \"[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.\",\n  \"[HMR] Waiting for update signal from WDS...\",\n  \"Hey.\",\n]\n`;\n\nexports[`API latest async API should work and allow to rerun dev server multiple times: page errors 1`] = `[]`;\n\nexports[`API latest async API should work and allow to rerun dev server multiple times: page errors 2`] = `[]`;\n\nexports[`API latest async API should work when using configured manually: console messages 1`] = `\n[\n  \"[HMR] Waiting for update signal from WDS...\",\n  \"[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading disabled, Progress disabled, Overlay disabled.\",\n  \"Hey.\",\n]\n`;\n\nexports[`API latest async API should work when using configured manually: page errors 1`] = `[]`;\n\nexports[`API latest async API should work with async API: console messages 1`] = `\n[\n  \"[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.\",\n  \"[HMR] Waiting for update signal from WDS...\",\n  \"Hey.\",\n]\n`;\n\nexports[`API latest async API should work with async API: page errors 1`] = `[]`;\n\nexports[`API latest async API should work with callback API: console messages 1`] = `\n[\n  \"[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.\",\n  \"[HMR] Waiting for update signal from WDS...\",\n  \"Hey.\",\n]\n`;\n\nexports[`API latest async API should work with callback API: page errors 1`] = `[]`;\n"
  },
  {
    "path": "test/e2e/__snapshots__/bonjour.test.js.snap.webpack5",
    "content": "// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing\n\nexports[`bonjour option as object should apply bonjour options: console messages 1`] = `\n[\n  \"[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.\",\n  \"[HMR] Waiting for update signal from WDS...\",\n  \"Hey.\",\n]\n`;\n\nexports[`bonjour option as object should apply bonjour options: page errors 1`] = `[]`;\n\nexports[`bonjour option as object should apply bonjour options: response status 1`] = `200`;\n\nexports[`bonjour option as true should call bonjour with correct params: console messages 1`] = `\n[\n  \"[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.\",\n  \"[HMR] Waiting for update signal from WDS...\",\n  \"Hey.\",\n]\n`;\n\nexports[`bonjour option as true should call bonjour with correct params: page errors 1`] = `[]`;\n\nexports[`bonjour option as true should call bonjour with correct params: response status 1`] = `200`;\n\nexports[`bonjour option bonjour object and 'server' option should apply bonjour options: console messages 1`] = `\n[\n  \"[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.\",\n  \"[HMR] Waiting for update signal from WDS...\",\n  \"Hey.\",\n]\n`;\n\nexports[`bonjour option bonjour object and 'server' option should apply bonjour options: page errors 1`] = `[]`;\n\nexports[`bonjour option bonjour object and 'server' option should apply bonjour options: response status 1`] = `200`;\n\nexports[`bonjour option with 'server' option should call bonjour with 'https' type: console messages 1`] = `\n[\n  \"[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.\",\n  \"[HMR] Waiting for update signal from WDS...\",\n  \"Hey.\",\n]\n`;\n\nexports[`bonjour option with 'server' option should call bonjour with 'https' type: page errors 1`] = `[]`;\n\nexports[`bonjour option with 'server' option should call bonjour with 'https' type: response status 1`] = `200`;\n"
  },
  {
    "path": "test/e2e/__snapshots__/built-in-routes.test.js.snap.webpack5",
    "content": "// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing\n\nexports[`Built in routes with multi config should handle GET request to directory index and list all middleware directories: console messages 1`] = `[]`;\n\nexports[`Built in routes with multi config should handle GET request to directory index and list all middleware directories: directory list 1`] = `\n\"<!DOCTYPE html><html><head><meta charset=\"utf-8\"/></head><body><h1>Assets Report:</h1><div><h2>Compilation: unnamed[0]</h2><ul><li>\n              <strong><a href=\"/bundle1/foo.js\" target=\"_blank\">foo.js</a></strong>\n            </li><li>\n              <strong><a href=\"/bundle1/path/to/file.html\" target=\"_blank\">path/to/file.html</a></strong>\n            </li></ul></div><div><h2>Compilation: named</h2><ul><li>\n              <strong><a href=\"/bundle2/bar.js\" target=\"_blank\">bar.js</a></strong>\n            </li></ul></div><div><h2>Compilation: other</h2><ul><li>\n              <strong><a href=\"bar.js\" target=\"_blank\">bar.js</a></strong>\n            </li></ul></div></body></html>\"\n`;\n\nexports[`Built in routes with multi config should handle GET request to directory index and list all middleware directories: page errors 1`] = `[]`;\n\nexports[`Built in routes with multi config should handle GET request to directory index and list all middleware directories: response headers content-type 1`] = `\"text/html; charset=utf-8\"`;\n\nexports[`Built in routes with multi config should handle GET request to directory index and list all middleware directories: response status 1`] = `200`;\n\nexports[`Built in routes with simple config should handle GET request to directory index and list all middleware directories: console messages 1`] = `[]`;\n\nexports[`Built in routes with simple config should handle GET request to directory index and list all middleware directories: directory list 1`] = `\n\"<!DOCTYPE html><html><head><meta charset=\"utf-8\"/></head><body><h1>Assets Report:</h1><div><h2>Compilation: unnamed</h2><ul><li>\n              <strong><a href=\"main.js\" target=\"_blank\">main.js</a></strong>\n            </li><li>\n              <strong><a href=\"index.html\" target=\"_blank\">index.html</a></strong>\n            </li><li>\n              <strong><a href=\"test.html\" target=\"_blank\">test.html</a></strong>\n            </li></ul></div></body></html>\"\n`;\n\nexports[`Built in routes with simple config should handle GET request to directory index and list all middleware directories: page errors 1`] = `[]`;\n\nexports[`Built in routes with simple config should handle GET request to directory index and list all middleware directories: response headers content-type 1`] = `\"text/html; charset=utf-8\"`;\n\nexports[`Built in routes with simple config should handle GET request to directory index and list all middleware directories: response status 1`] = `200`;\n\nexports[`Built in routes with simple config should handle GET request to invalidate endpoint: console messages 1`] = `[]`;\n\nexports[`Built in routes with simple config should handle GET request to invalidate endpoint: page errors 1`] = `[]`;\n\nexports[`Built in routes with simple config should handle GET request to invalidate endpoint: response status 1`] = `200`;\n\nexports[`Built in routes with simple config should handle GET request to magic async chunk: console messages 1`] = `[]`;\n\nexports[`Built in routes with simple config should handle GET request to magic async chunk: response headers content-type 1`] = `\"text/javascript; charset=utf-8\"`;\n\nexports[`Built in routes with simple config should handle GET request to magic async chunk: response status 1`] = `200`;\n\nexports[`Built in routes with simple config should handle HEAD request to directory index: console messages 1`] = `[]`;\n\nexports[`Built in routes with simple config should handle HEAD request to directory index: directory list 1`] = `\"\"`;\n\nexports[`Built in routes with simple config should handle HEAD request to directory index: page errors 1`] = `[]`;\n\nexports[`Built in routes with simple config should handle HEAD request to directory index: response headers content-type 1`] = `\"text/html; charset=utf-8\"`;\n\nexports[`Built in routes with simple config should handle HEAD request to directory index: response status 1`] = `200`;\n\nexports[`Built in routes with simple config should handle HEAD request to magic async chunk: console messages 1`] = `[]`;\n\nexports[`Built in routes with simple config should handle HEAD request to magic async chunk: response headers content-type 1`] = `\"text/javascript; charset=utf-8\"`;\n\nexports[`Built in routes with simple config should handle HEAD request to magic async chunk: response status 1`] = `200`;\n\nexports[`Built in routes with simple config should handles GET request to sockjs bundle: console messages 1`] = `[]`;\n\nexports[`Built in routes with simple config should handles GET request to sockjs bundle: page errors 1`] = `[]`;\n\nexports[`Built in routes with simple config should handles GET request to sockjs bundle: response headers content-type 1`] = `\"application/javascript; charset=UTF-8\"`;\n\nexports[`Built in routes with simple config should handles GET request to sockjs bundle: response status 1`] = `200`;\n\nexports[`Built in routes with simple config should handles HEAD request to sockjs bundle: console messages 1`] = `[]`;\n\nexports[`Built in routes with simple config should handles HEAD request to sockjs bundle: page errors 1`] = `[]`;\n\nexports[`Built in routes with simple config should handles HEAD request to sockjs bundle: response headers content-type 1`] = `\"application/javascript; charset=UTF-8\"`;\n\nexports[`Built in routes with simple config should handles HEAD request to sockjs bundle: response status 1`] = `200`;\n"
  },
  {
    "path": "test/e2e/__snapshots__/client-reconnect.test.js.snap.webpack5",
    "content": "// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing\n\nexports[`client.reconnect option specified as false should not try to reconnect: console messages 1`] = `\n[\n  \"[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.\",\n  \"[HMR] Waiting for update signal from WDS...\",\n  \"Hey.\",\n  \"[webpack-dev-server] Disconnected!\",\n]\n`;\n\nexports[`client.reconnect option specified as false should not try to reconnect: page errors 1`] = `[]`;\n\nexports[`client.reconnect option specified as false should not try to reconnect: response status 1`] = `200`;\n\nexports[`client.reconnect option specified as number should try to reconnect 2 times: console messages 1`] = `\n[\n  \"[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.\",\n  \"[HMR] Waiting for update signal from WDS...\",\n  \"Hey.\",\n  \"[webpack-dev-server] Disconnected!\",\n  \"[webpack-dev-server] Trying to reconnect...\",\n  \"WebSocket connection to 'ws://localhost:8163/ws' failed: Error in connection establishment: net::ERR_CONNECTION_REFUSED\",\n  \"[webpack-dev-server] JSHandle@object\",\n  \"[webpack-dev-server] Trying to reconnect...\",\n  \"WebSocket connection to 'ws://localhost:8163/ws' failed: Error in connection establishment: net::ERR_CONNECTION_REFUSED\",\n  \"[webpack-dev-server] JSHandle@object\",\n]\n`;\n\nexports[`client.reconnect option specified as number should try to reconnect 2 times: page errors 1`] = `[]`;\n\nexports[`client.reconnect option specified as number should try to reconnect 2 times: response status 1`] = `200`;\n\nexports[`client.reconnect option specified as true should try to reconnect unlimited times: page errors 1`] = `[]`;\n\nexports[`client.reconnect option specified as true should try to reconnect unlimited times: response status 1`] = `200`;\n"
  },
  {
    "path": "test/e2e/__snapshots__/client.test.js.snap.webpack5",
    "content": "// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing\n\nexports[`client option configure client entry should disable client entry: console messages 1`] = `[]`;\n\nexports[`client option configure client entry should disable client entry: page errors 1`] = `[]`;\n\nexports[`client option configure client entry should disable client entry: response status 1`] = `200`;\n\nexports[`client option default behaviour responds with a 200 status code for /ws path: console messages 1`] = `[]`;\n\nexports[`client option default behaviour responds with a 200 status code for /ws path: page errors 1`] = `[]`;\n\nexports[`client option default behaviour responds with a 200 status code for /ws path: response status 1`] = `200`;\n\nexports[`client option override client entry should disable client entry: response status 1`] = `200`;\n\nexports[`client option should respect path option responds with a 200 status code for /foo/test/bar path: console messages 1`] = `[]`;\n\nexports[`client option should respect path option responds with a 200 status code for /foo/test/bar path: page errors 1`] = `[]`;\n\nexports[`client option should respect path option responds with a 200 status code for /foo/test/bar path: response status 1`] = `200`;\n"
  },
  {
    "path": "test/e2e/__snapshots__/compress.test.js.snap.webpack5",
    "content": "// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing\n\nexports[`compress option as false should handle GET request to bundle file: console messages 1`] = `[]`;\n\nexports[`compress option as false should handle GET request to bundle file: page errors 1`] = `[]`;\n\nexports[`compress option as false should handle GET request to bundle file: response headers content-encoding 1`] = `undefined`;\n\nexports[`compress option as false should handle GET request to bundle file: response status 1`] = `200`;\n\nexports[`compress option as true should handle GET request to bundle file: console messages 1`] = `[]`;\n\nexports[`compress option as true should handle GET request to bundle file: page errors 1`] = `[]`;\n\nexports[`compress option as true should handle GET request to bundle file: response headers content-encoding 1`] = `\"br\"`;\n\nexports[`compress option as true should handle GET request to bundle file: response status 1`] = `200`;\n\nexports[`compress option enabled by default when not specified should handle GET request to bundle file: console messages 1`] = `[]`;\n\nexports[`compress option enabled by default when not specified should handle GET request to bundle file: page errors 1`] = `[]`;\n\nexports[`compress option enabled by default when not specified should handle GET request to bundle file: response headers content-encoding 1`] = `\"br\"`;\n\nexports[`compress option enabled by default when not specified should handle GET request to bundle file: response status 1`] = `200`;\n"
  },
  {
    "path": "test/e2e/__snapshots__/entry.test.js.snap.webpack5",
    "content": "// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing\n\nexports[`entry should work with dynamic async entry: console messages 1`] = `\n[\n  \"[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.\",\n  \"[HMR] Waiting for update signal from WDS...\",\n  \"Hey.\",\n]\n`;\n\nexports[`entry should work with dynamic async entry: page errors 1`] = `[]`;\n\nexports[`entry should work with dynamic entry: console messages 1`] = `\n[\n  \"[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.\",\n  \"[HMR] Waiting for update signal from WDS...\",\n  \"Hey.\",\n]\n`;\n\nexports[`entry should work with dynamic entry: page errors 1`] = `[]`;\n\nexports[`entry should work with empty: console messages 1`] = `\n[\n  \"[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.\",\n  \"[HMR] Waiting for update signal from WDS...\",\n  \"Hey.\",\n]\n`;\n\nexports[`entry should work with empty: page errors 1`] = `[]`;\n\nexports[`entry should work with multiple entries #2: console messages 1`] = `\n[\n  \"[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.\",\n  \"[HMR] Waiting for update signal from WDS...\",\n  \"Bar.\",\n]\n`;\n\nexports[`entry should work with multiple entries #2: page errors 1`] = `[]`;\n\nexports[`entry should work with multiple entries and \"dependOn\": console messages 1`] = `\n[\n  \"[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.\",\n  \"[HMR] Waiting for update signal from WDS...\",\n  \"Bar.\",\n  \"Hey.\",\n]\n`;\n\nexports[`entry should work with multiple entries and \"dependOn\": page errors 1`] = `[]`;\n\nexports[`entry should work with multiple entries: console messages 1`] = `\n[\n  \"[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.\",\n  \"[HMR] Waiting for update signal from WDS...\",\n  \"Hey.\",\n]\n`;\n\nexports[`entry should work with multiple entries: page errors 1`] = `[]`;\n\nexports[`entry should work with object entry: console messages 1`] = `\n[\n  \"[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.\",\n  \"[HMR] Waiting for update signal from WDS...\",\n  \"Hey.\",\n]\n`;\n\nexports[`entry should work with object entry: page errors 1`] = `[]`;\n\nexports[`entry should work with single array entry: console messages 1`] = `\n[\n  \"[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.\",\n  \"[HMR] Waiting for update signal from WDS...\",\n  \"Hey.\",\n  \"Bar.\",\n]\n`;\n\nexports[`entry should work with single array entry: page errors 1`] = `[]`;\n\nexports[`entry should work with single entry: console messages 1`] = `\n[\n  \"[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.\",\n  \"[HMR] Waiting for update signal from WDS...\",\n  \"Hey.\",\n]\n`;\n\nexports[`entry should work with single entry: page errors 1`] = `[]`;\n"
  },
  {
    "path": "test/e2e/__snapshots__/headers.test.js.snap.webpack5",
    "content": "// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing\n\nexports[`headers option as a function returning an array should handle GET request with headers: console messages 1`] = `\n[\n  \"[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.\",\n  \"[HMR] Waiting for update signal from WDS...\",\n  \"Hey.\",\n]\n`;\n\nexports[`headers option as a function returning an array should handle GET request with headers: page errors 1`] = `[]`;\n\nexports[`headers option as a function returning an array should handle GET request with headers: response headers x-bar 1`] = `\"value2\"`;\n\nexports[`headers option as a function returning an array should handle GET request with headers: response headers x-foo 1`] = `\"value1\"`;\n\nexports[`headers option as a function returning an array should handle GET request with headers: response status 1`] = `200`;\n\nexports[`headers option as a function should handle GET request with headers as a function: console messages 1`] = `\n[\n  \"[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.\",\n  \"[HMR] Waiting for update signal from WDS...\",\n  \"Hey.\",\n]\n`;\n\nexports[`headers option as a function should handle GET request with headers as a function: page errors 1`] = `[]`;\n\nexports[`headers option as a function should handle GET request with headers as a function: response headers x-bar 1`] = `\n\"key1=value1\nkey2=value2\"\n`;\n\nexports[`headers option as a function should handle GET request with headers as a function: response status 1`] = `200`;\n\nexports[`headers option as a string and support HEAD request should handle HEAD request with headers: console messages 1`] = `\n[\n  \"[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.\",\n  \"[HMR] Waiting for update signal from WDS...\",\n  \"Hey.\",\n]\n`;\n\nexports[`headers option as a string and support HEAD request should handle HEAD request with headers: page errors 1`] = `[]`;\n\nexports[`headers option as a string and support HEAD request should handle HEAD request with headers: response headers x-foo 1`] = `\"dev-server headers\"`;\n\nexports[`headers option as a string and support HEAD request should handle HEAD request with headers: response status 1`] = `200`;\n\nexports[`headers option as a string should handle GET request with headers: console messages 1`] = `\n[\n  \"[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.\",\n  \"[HMR] Waiting for update signal from WDS...\",\n  \"Hey.\",\n]\n`;\n\nexports[`headers option as a string should handle GET request with headers: page errors 1`] = `[]`;\n\nexports[`headers option as a string should handle GET request with headers: response headers x-foo 1`] = `\"dev-server headers\"`;\n\nexports[`headers option as a string should handle GET request with headers: response status 1`] = `200`;\n\nexports[`headers option as an array of objects should handle GET request with headers: console messages 1`] = `\n[\n  \"[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.\",\n  \"[HMR] Waiting for update signal from WDS...\",\n  \"Hey.\",\n]\n`;\n\nexports[`headers option as an array of objects should handle GET request with headers: page errors 1`] = `[]`;\n\nexports[`headers option as an array of objects should handle GET request with headers: response headers x-bar 1`] = `\"value2\"`;\n\nexports[`headers option as an array of objects should handle GET request with headers: response headers x-foo 1`] = `\"value1\"`;\n\nexports[`headers option as an array of objects should handle GET request with headers: response status 1`] = `200`;\n\nexports[`headers option as an array should handle GET request with headers as an array: console messages 1`] = `\n[\n  \"[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.\",\n  \"[HMR] Waiting for update signal from WDS...\",\n  \"Hey.\",\n]\n`;\n\nexports[`headers option as an array should handle GET request with headers as an array: page errors 1`] = `[]`;\n\nexports[`headers option as an array should handle GET request with headers as an array: response headers x-bar 1`] = `\n\"key1=value1\nkey2=value2\"\n`;\n\nexports[`headers option as an array should handle GET request with headers as an array: response status 1`] = `200`;\n\nexports[`headers option dev middleware headers take precedence for dev middleware output files should handle GET request with headers as a function: console messages 1`] = `\n[\n  \"[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.\",\n  \"[HMR] Waiting for update signal from WDS...\",\n  \"Hey.\",\n]\n`;\n\nexports[`headers option dev middleware headers take precedence for dev middleware output files should handle GET request with headers as a function: page errors 1`] = `[]`;\n\nexports[`headers option dev middleware headers take precedence for dev middleware output files should handle GET request with headers as a function: response headers x-foo 1`] = `\"dev-middleware-headers\"`;\n\nexports[`headers option dev middleware headers take precedence for dev middleware output files should handle GET request with headers as a function: response status 1`] = `200`;\n"
  },
  {
    "path": "test/e2e/__snapshots__/history-api-fallback.test.js.snap.webpack5",
    "content": "// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing\n\nexports[`historyApiFallback option as boolean should handle GET request to directory: console messages 1`] = `[]`;\n\nexports[`historyApiFallback option as boolean should handle GET request to directory: page errors 1`] = `[]`;\n\nexports[`historyApiFallback option as boolean should handle GET request to directory: response headers content-type 1`] = `\"text/html; charset=utf-8\"`;\n\nexports[`historyApiFallback option as boolean should handle GET request to directory: response status 1`] = `200`;\n\nexports[`historyApiFallback option as boolean should handle GET request to directory: response text 1`] = `\n\"Heyyy\n\"\n`;\n\nexports[`historyApiFallback option as object should handle GET request to directory: console messages 1`] = `[]`;\n\nexports[`historyApiFallback option as object should handle GET request to directory: page errors 1`] = `[]`;\n\nexports[`historyApiFallback option as object should handle GET request to directory: response headers content-type 1`] = `\"text/html; charset=utf-8\"`;\n\nexports[`historyApiFallback option as object should handle GET request to directory: response status 1`] = `200`;\n\nexports[`historyApiFallback option as object should handle GET request to directory: response text 1`] = `\n\"Foobar\n\"\n`;\n\nexports[`historyApiFallback option as object with static and rewrites historyApiFallback respect any other specified rewrites: console messages 1`] = `[]`;\n\nexports[`historyApiFallback option as object with static and rewrites historyApiFallback respect any other specified rewrites: page errors 1`] = `[]`;\n\nexports[`historyApiFallback option as object with static and rewrites historyApiFallback respect any other specified rewrites: response headers content-type 1`] = `\"text/html; charset=UTF-8\"`;\n\nexports[`historyApiFallback option as object with static and rewrites historyApiFallback respect any other specified rewrites: response status 1`] = `200`;\n\nexports[`historyApiFallback option as object with static and rewrites historyApiFallback respect any other specified rewrites: response text 1`] = `\n\"Other file\n\"\n`;\n\nexports[`historyApiFallback option as object with static and rewrites historyApiFallback respect rewrites and shows index for unknown urls: console messages 1`] = `[]`;\n\nexports[`historyApiFallback option as object with static and rewrites historyApiFallback respect rewrites and shows index for unknown urls: page errors 1`] = `[]`;\n\nexports[`historyApiFallback option as object with static and rewrites historyApiFallback respect rewrites and shows index for unknown urls: response headers content-type 1`] = `\"text/html; charset=UTF-8\"`;\n\nexports[`historyApiFallback option as object with static and rewrites historyApiFallback respect rewrites and shows index for unknown urls: response status 1`] = `200`;\n\nexports[`historyApiFallback option as object with static and rewrites historyApiFallback respect rewrites and shows index for unknown urls: response text 1`] = `\n\"Foobar\n\"\n`;\n\nexports[`historyApiFallback option as object with static and rewrites historyApiFallback respect rewrites for index: console messages 1`] = `[]`;\n\nexports[`historyApiFallback option as object with static and rewrites historyApiFallback respect rewrites for index: page errors 1`] = `[]`;\n\nexports[`historyApiFallback option as object with static and rewrites historyApiFallback respect rewrites for index: response headers content-type 1`] = `\"text/html; charset=UTF-8\"`;\n\nexports[`historyApiFallback option as object with static and rewrites historyApiFallback respect rewrites for index: response status 1`] = `200`;\n\nexports[`historyApiFallback option as object with static and rewrites historyApiFallback respect rewrites for index: response text 1`] = `\n\"Foobar\n\"\n`;\n\nexports[`historyApiFallback option as object with static set to false historyApiFallback should work and ignore static content: console messages 1`] = `[]`;\n\nexports[`historyApiFallback option as object with static set to false historyApiFallback should work and ignore static content: page errors 1`] = `[]`;\n\nexports[`historyApiFallback option as object with static set to false historyApiFallback should work and ignore static content: response headers content-type 1`] = `\"text/html; charset=utf-8\"`;\n\nexports[`historyApiFallback option as object with static set to false historyApiFallback should work and ignore static content: response status 1`] = `200`;\n\nexports[`historyApiFallback option as object with static set to false historyApiFallback should work and ignore static content: response text 1`] = `\n\"In-memory file\n\"\n`;\n\nexports[`historyApiFallback option as object with static should handle GET request to directory: console messages 1`] = `[]`;\n\nexports[`historyApiFallback option as object with static should handle GET request to directory: page errors 1`] = `[]`;\n\nexports[`historyApiFallback option as object with static should handle GET request to directory: response headers content-type 1`] = `\"text/html; charset=UTF-8\"`;\n\nexports[`historyApiFallback option as object with static should handle GET request to directory: response status 1`] = `200`;\n\nexports[`historyApiFallback option as object with static should handle GET request to directory: response text 1`] = `\n\"Foobar\n\"\n`;\n\nexports[`historyApiFallback option as object with static should prefer static file over historyApiFallback: console messages 1`] = `[]`;\n\nexports[`historyApiFallback option as object with static should prefer static file over historyApiFallback: page errors 1`] = `[]`;\n\nexports[`historyApiFallback option as object with static should prefer static file over historyApiFallback: response headers content-type 1`] = `\"text/plain; charset=UTF-8\"`;\n\nexports[`historyApiFallback option as object with static should prefer static file over historyApiFallback: response status 1`] = `200`;\n\nexports[`historyApiFallback option as object with static should prefer static file over historyApiFallback: response text 1`] = `\n\"Random file\n\"\n`;\n\nexports[`historyApiFallback option as object with the \"logger\" option request to directory and log: console messages 1`] = `[]`;\n\nexports[`historyApiFallback option as object with the \"logger\" option request to directory and log: page errors 1`] = `[]`;\n\nexports[`historyApiFallback option as object with the \"logger\" option request to directory and log: response headers content-type 1`] = `\"text/html; charset=utf-8\"`;\n\nexports[`historyApiFallback option as object with the \"logger\" option request to directory and log: response status 1`] = `200`;\n\nexports[`historyApiFallback option as object with the \"logger\" option request to directory and log: response text 1`] = `\n\"Foobar\n\"\n`;\n\nexports[`historyApiFallback option as object with the \"verbose\" option request to directory and log: console messages 1`] = `[]`;\n\nexports[`historyApiFallback option as object with the \"verbose\" option request to directory and log: page errors 1`] = `[]`;\n\nexports[`historyApiFallback option as object with the \"verbose\" option request to directory and log: response headers content-type 1`] = `\"text/html; charset=utf-8\"`;\n\nexports[`historyApiFallback option as object with the \"verbose\" option request to directory and log: response status 1`] = `200`;\n\nexports[`historyApiFallback option as object with the \"verbose\" option request to directory and log: response text 1`] = `\n\"Foobar\n\"\n`;\n\nexports[`historyApiFallback option in-memory files should perform HEAD request in same way as GET: response headers content-type 1`] = `\"text/html; charset=utf-8\"`;\n\nexports[`historyApiFallback option in-memory files should perform HEAD request in same way as GET: response status 1`] = `\"OK\"`;\n\nexports[`historyApiFallback option in-memory files should perform HEAD request in same way as GET: response text 1`] = `\n\"In-memory file\n\"\n`;\n\nexports[`historyApiFallback option in-memory files should take precedence over static files: console messages 1`] = `[]`;\n\nexports[`historyApiFallback option in-memory files should take precedence over static files: page errors 1`] = `[]`;\n\nexports[`historyApiFallback option in-memory files should take precedence over static files: response headers content-type 1`] = `\"text/html; charset=utf-8\"`;\n\nexports[`historyApiFallback option in-memory files should take precedence over static files: response status 1`] = `200`;\n\nexports[`historyApiFallback option in-memory files should take precedence over static files: response text 1`] = `\n\"In-memory file\n\"\n`;\n"
  },
  {
    "path": "test/e2e/__snapshots__/host.test.js.snap.webpack5",
    "content": "// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing\n\nexports[`host should work using \"::\" host and \"auto\" port: console messages 1`] = `\n[\n  \"[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.\",\n  \"[HMR] Waiting for update signal from WDS...\",\n  \"Hey.\",\n]\n`;\n\nexports[`host should work using \"::\" host and \"auto\" port: page errors 1`] = `[]`;\n\nexports[`host should work using \"::\" host and port as number: console messages 1`] = `\n[\n  \"[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.\",\n  \"[HMR] Waiting for update signal from WDS...\",\n  \"Hey.\",\n]\n`;\n\nexports[`host should work using \"::\" host and port as number: page errors 1`] = `[]`;\n\nexports[`host should work using \"::\" host and port as string: console messages 1`] = `\n[\n  \"[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.\",\n  \"[HMR] Waiting for update signal from WDS...\",\n  \"Hey.\",\n]\n`;\n\nexports[`host should work using \"::\" host and port as string: page errors 1`] = `[]`;\n\nexports[`host should work using \"::1\" host and \"auto\" port: console messages 1`] = `\n[\n  \"[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.\",\n  \"[HMR] Waiting for update signal from WDS...\",\n  \"Hey.\",\n]\n`;\n\nexports[`host should work using \"::1\" host and \"auto\" port: page errors 1`] = `[]`;\n\nexports[`host should work using \"::1\" host and port as number: console messages 1`] = `\n[\n  \"[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.\",\n  \"[HMR] Waiting for update signal from WDS...\",\n  \"Hey.\",\n]\n`;\n\nexports[`host should work using \"::1\" host and port as number: page errors 1`] = `[]`;\n\nexports[`host should work using \"::1\" host and port as string: console messages 1`] = `\n[\n  \"[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.\",\n  \"[HMR] Waiting for update signal from WDS...\",\n  \"Hey.\",\n]\n`;\n\nexports[`host should work using \"::1\" host and port as string: page errors 1`] = `[]`;\n\nexports[`host should work using \"<not-specified>\" host and \"auto\" port: console messages 1`] = `\n[\n  \"[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.\",\n  \"[HMR] Waiting for update signal from WDS...\",\n  \"Hey.\",\n]\n`;\n\nexports[`host should work using \"<not-specified>\" host and \"auto\" port: page errors 1`] = `[]`;\n\nexports[`host should work using \"<not-specified>\" host and port as number: console messages 1`] = `\n[\n  \"[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.\",\n  \"[HMR] Waiting for update signal from WDS...\",\n  \"Hey.\",\n]\n`;\n\nexports[`host should work using \"<not-specified>\" host and port as number: page errors 1`] = `[]`;\n\nexports[`host should work using \"<not-specified>\" host and port as string: console messages 1`] = `\n[\n  \"[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.\",\n  \"[HMR] Waiting for update signal from WDS...\",\n  \"Hey.\",\n]\n`;\n\nexports[`host should work using \"<not-specified>\" host and port as string: page errors 1`] = `[]`;\n\nexports[`host should work using \"0.0.0.0\" host and \"auto\" port: console messages 1`] = `\n[\n  \"[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.\",\n  \"[HMR] Waiting for update signal from WDS...\",\n  \"Hey.\",\n]\n`;\n\nexports[`host should work using \"0.0.0.0\" host and \"auto\" port: page errors 1`] = `[]`;\n\nexports[`host should work using \"0.0.0.0\" host and port as number: console messages 1`] = `\n[\n  \"[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.\",\n  \"[HMR] Waiting for update signal from WDS...\",\n  \"Hey.\",\n]\n`;\n\nexports[`host should work using \"0.0.0.0\" host and port as number: page errors 1`] = `[]`;\n\nexports[`host should work using \"0.0.0.0\" host and port as string: console messages 1`] = `\n[\n  \"[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.\",\n  \"[HMR] Waiting for update signal from WDS...\",\n  \"Hey.\",\n]\n`;\n\nexports[`host should work using \"0.0.0.0\" host and port as string: page errors 1`] = `[]`;\n\nexports[`host should work using \"127.0.0.1\" host and \"auto\" port: console messages 1`] = `\n[\n  \"[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.\",\n  \"[HMR] Waiting for update signal from WDS...\",\n  \"Hey.\",\n]\n`;\n\nexports[`host should work using \"127.0.0.1\" host and \"auto\" port: page errors 1`] = `[]`;\n\nexports[`host should work using \"127.0.0.1\" host and port as number: console messages 1`] = `\n[\n  \"[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.\",\n  \"[HMR] Waiting for update signal from WDS...\",\n  \"Hey.\",\n]\n`;\n\nexports[`host should work using \"127.0.0.1\" host and port as number: page errors 1`] = `[]`;\n\nexports[`host should work using \"127.0.0.1\" host and port as string: console messages 1`] = `\n[\n  \"[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.\",\n  \"[HMR] Waiting for update signal from WDS...\",\n  \"Hey.\",\n]\n`;\n\nexports[`host should work using \"127.0.0.1\" host and port as string: page errors 1`] = `[]`;\n\nexports[`host should work using \"local-ip\" host and \"auto\" port: console messages 1`] = `\n[\n  \"[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.\",\n  \"[HMR] Waiting for update signal from WDS...\",\n  \"Hey.\",\n]\n`;\n\nexports[`host should work using \"local-ip\" host and \"auto\" port: page errors 1`] = `[]`;\n\nexports[`host should work using \"local-ip\" host and port as number: console messages 1`] = `\n[\n  \"[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.\",\n  \"[HMR] Waiting for update signal from WDS...\",\n  \"Hey.\",\n]\n`;\n\nexports[`host should work using \"local-ip\" host and port as number: page errors 1`] = `[]`;\n\nexports[`host should work using \"local-ip\" host and port as string: console messages 1`] = `\n[\n  \"[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.\",\n  \"[HMR] Waiting for update signal from WDS...\",\n  \"Hey.\",\n]\n`;\n\nexports[`host should work using \"local-ip\" host and port as string: page errors 1`] = `[]`;\n\nexports[`host should work using \"local-ipv4\" host and \"auto\" port: console messages 1`] = `\n[\n  \"[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.\",\n  \"[HMR] Waiting for update signal from WDS...\",\n  \"Hey.\",\n]\n`;\n\nexports[`host should work using \"local-ipv4\" host and \"auto\" port: page errors 1`] = `[]`;\n\nexports[`host should work using \"local-ipv4\" host and port as number: console messages 1`] = `\n[\n  \"[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.\",\n  \"[HMR] Waiting for update signal from WDS...\",\n  \"Hey.\",\n]\n`;\n\nexports[`host should work using \"local-ipv4\" host and port as number: page errors 1`] = `[]`;\n\nexports[`host should work using \"local-ipv4\" host and port as string: console messages 1`] = `\n[\n  \"[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.\",\n  \"[HMR] Waiting for update signal from WDS...\",\n  \"Hey.\",\n]\n`;\n\nexports[`host should work using \"local-ipv4\" host and port as string: page errors 1`] = `[]`;\n\nexports[`host should work using \"local-ipv6\" host and \"auto\" port: console messages 1`] = `\n[\n  \"[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.\",\n  \"[HMR] Waiting for update signal from WDS...\",\n  \"Hey.\",\n]\n`;\n\nexports[`host should work using \"local-ipv6\" host and \"auto\" port: page errors 1`] = `[]`;\n\nexports[`host should work using \"local-ipv6\" host and port as number: console messages 1`] = `\n[\n  \"[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.\",\n  \"[HMR] Waiting for update signal from WDS...\",\n  \"Hey.\",\n]\n`;\n\nexports[`host should work using \"local-ipv6\" host and port as number: page errors 1`] = `[]`;\n\nexports[`host should work using \"local-ipv6\" host and port as string: console messages 1`] = `\n[\n  \"[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.\",\n  \"[HMR] Waiting for update signal from WDS...\",\n  \"Hey.\",\n]\n`;\n\nexports[`host should work using \"local-ipv6\" host and port as string: page errors 1`] = `[]`;\n\nexports[`host should work using \"localhost\" host and \"auto\" port: console messages 1`] = `\n[\n  \"[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.\",\n  \"[HMR] Waiting for update signal from WDS...\",\n  \"Hey.\",\n]\n`;\n\nexports[`host should work using \"localhost\" host and \"auto\" port: page errors 1`] = `[]`;\n\nexports[`host should work using \"localhost\" host and port as number: console messages 1`] = `\n[\n  \"[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.\",\n  \"[HMR] Waiting for update signal from WDS...\",\n  \"Hey.\",\n]\n`;\n\nexports[`host should work using \"localhost\" host and port as number: page errors 1`] = `[]`;\n\nexports[`host should work using \"localhost\" host and port as string: console messages 1`] = `\n[\n  \"[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.\",\n  \"[HMR] Waiting for update signal from WDS...\",\n  \"Hey.\",\n]\n`;\n\nexports[`host should work using \"localhost\" host and port as string: page errors 1`] = `[]`;\n\nexports[`host should work using \"undefined\" host and \"auto\" port: console messages 1`] = `\n[\n  \"[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.\",\n  \"[HMR] Waiting for update signal from WDS...\",\n  \"Hey.\",\n]\n`;\n\nexports[`host should work using \"undefined\" host and \"auto\" port: page errors 1`] = `[]`;\n\nexports[`host should work using \"undefined\" host and port as number: console messages 1`] = `\n[\n  \"[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.\",\n  \"[HMR] Waiting for update signal from WDS...\",\n  \"Hey.\",\n]\n`;\n\nexports[`host should work using \"undefined\" host and port as number: page errors 1`] = `[]`;\n\nexports[`host should work using \"undefined\" host and port as string: console messages 1`] = `\n[\n  \"[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.\",\n  \"[HMR] Waiting for update signal from WDS...\",\n  \"Hey.\",\n]\n`;\n\nexports[`host should work using \"undefined\" host and port as string: page errors 1`] = `[]`;\n"
  },
  {
    "path": "test/e2e/__snapshots__/hot-and-live-reload.test.js.snap.webpack5",
    "content": "// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing\n\nexports[`hot and live reload should not refresh content when hot and no live reload disabled (default): console messages 1`] = `\n[\n  \"[webpack-dev-server] Server started: Hot Module Replacement disabled, Live Reloading disabled, Progress disabled, Overlay enabled.\",\n  \"[webpack-dev-server] App updated. Recompiling...\",\n]\n`;\n\nexports[`hot and live reload should not refresh content when hot and no live reload disabled (default): page errors 1`] = `[]`;\n\nexports[`hot and live reload should not refresh content when hot and no live reload disabled (sockjs): console messages 1`] = `\n[\n  \"[webpack-dev-server] Server started: Hot Module Replacement disabled, Live Reloading disabled, Progress disabled, Overlay enabled.\",\n  \"[webpack-dev-server] App updated. Recompiling...\",\n]\n`;\n\nexports[`hot and live reload should not refresh content when hot and no live reload disabled (sockjs): page errors 1`] = `[]`;\n\nexports[`hot and live reload should not refresh content when hot and no live reload disabled (ws): console messages 1`] = `\n[\n  \"[webpack-dev-server] Server started: Hot Module Replacement disabled, Live Reloading disabled, Progress disabled, Overlay enabled.\",\n  \"[webpack-dev-server] App updated. Recompiling...\",\n]\n`;\n\nexports[`hot and live reload should not refresh content when hot and no live reload disabled (ws): page errors 1`] = `[]`;\n\nexports[`hot and live reload should work and allow to disable hot module replacement and live reload using the \"webpack-dev-server-hot=false&webpack-dev-server-live-reload=false\" (default): console messages 1`] = `\n[\n  \"[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.\",\n  \"[HMR] Waiting for update signal from WDS...\",\n  \"[webpack-dev-server] App updated. Recompiling...\",\n]\n`;\n\nexports[`hot and live reload should work and allow to disable hot module replacement and live reload using the \"webpack-dev-server-hot=false&webpack-dev-server-live-reload=false\" (default): page errors 1`] = `[]`;\n\nexports[`hot and live reload should work and allow to disable hot module replacement using the \"webpack-dev-server-hot=false\" (default): console messages 1`] = `\n[\n  \"[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.\",\n  \"[HMR] Waiting for update signal from WDS...\",\n  \"[webpack-dev-server] App updated. Recompiling...\",\n  \"[webpack-dev-server] App updated. Reloading...\",\n  \"[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.\",\n  \"[HMR] Waiting for update signal from WDS...\",\n]\n`;\n\nexports[`hot and live reload should work and allow to disable hot module replacement using the \"webpack-dev-server-hot=false\" (default): page errors 1`] = `[]`;\n\nexports[`hot and live reload should work and allow to disable live reload using the \"webpack-dev-server-live-reload=false\" (default): console messages 1`] = `\n[\n  \"[webpack-dev-server] Server started: Hot Module Replacement disabled, Live Reloading enabled, Progress disabled, Overlay enabled.\",\n  \"[webpack-dev-server] App updated. Recompiling...\",\n]\n`;\n\nexports[`hot and live reload should work and allow to disable live reload using the \"webpack-dev-server-live-reload=false\" (default): page errors 1`] = `[]`;\n\nexports[`hot and live reload should work and do nothing when web socket server disabled (default): console messages 1`] = `[]`;\n\nexports[`hot and live reload should work and do nothing when web socket server disabled (default): page errors 1`] = `[]`;\n\nexports[`hot and live reload should work and refresh content using hot module replacement (default): console messages 1`] = `\n[\n  \"[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.\",\n  \"[HMR] Waiting for update signal from WDS...\",\n  \"[webpack-dev-server] App updated. Recompiling...\",\n  \"[webpack-dev-server] App hot update...\",\n  \"[HMR] Checking for updates on the server...\",\n  \"[HMR] Updated modules:\",\n  \"[HMR]  - ./main.css\",\n  \"[HMR]  - ../../../node_modules/css-loader/dist/cjs.js!./main.css\",\n  \"\",\n  \"[HMR] App is up to date.\",\n]\n`;\n\nexports[`hot and live reload should work and refresh content using hot module replacement (default): page errors 1`] = `[]`;\n\nexports[`hot and live reload should work and refresh content using hot module replacement when hot enabled (default): console messages 1`] = `\n[\n  \"[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.\",\n  \"[HMR] Waiting for update signal from WDS...\",\n  \"[webpack-dev-server] App updated. Recompiling...\",\n  \"[webpack-dev-server] App hot update...\",\n  \"[HMR] Checking for updates on the server...\",\n  \"[HMR] Updated modules:\",\n  \"[HMR]  - ./main.css\",\n  \"[HMR]  - ../../../node_modules/css-loader/dist/cjs.js!./main.css\",\n  \"\",\n  \"[HMR] App is up to date.\",\n]\n`;\n\nexports[`hot and live reload should work and refresh content using hot module replacement when hot enabled (default): page errors 1`] = `[]`;\n\nexports[`hot and live reload should work and refresh content using hot module replacement when hot enabled (sockjs): console messages 1`] = `\n[\n  \"[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.\",\n  \"[HMR] Waiting for update signal from WDS...\",\n  \"[webpack-dev-server] App updated. Recompiling...\",\n  \"[webpack-dev-server] App hot update...\",\n  \"[HMR] Checking for updates on the server...\",\n  \"[HMR] Updated modules:\",\n  \"[HMR]  - ./main.css\",\n  \"[HMR]  - ../../../node_modules/css-loader/dist/cjs.js!./main.css\",\n  \"\",\n  \"[HMR] App is up to date.\",\n]\n`;\n\nexports[`hot and live reload should work and refresh content using hot module replacement when hot enabled (sockjs): page errors 1`] = `[]`;\n\nexports[`hot and live reload should work and refresh content using hot module replacement when hot enabled (ws): console messages 1`] = `\n[\n  \"[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.\",\n  \"[HMR] Waiting for update signal from WDS...\",\n  \"[webpack-dev-server] App updated. Recompiling...\",\n  \"[webpack-dev-server] App hot update...\",\n  \"[HMR] Checking for updates on the server...\",\n  \"[HMR] Updated modules:\",\n  \"[HMR]  - ./main.css\",\n  \"[HMR]  - ../../../node_modules/css-loader/dist/cjs.js!./main.css\",\n  \"\",\n  \"[HMR] App is up to date.\",\n]\n`;\n\nexports[`hot and live reload should work and refresh content using hot module replacement when hot enabled (ws): page errors 1`] = `[]`;\n\nexports[`hot and live reload should work and refresh content using hot module replacement when live reload and hot enabled (sockjs): console messages 1`] = `\n[\n  \"[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.\",\n  \"[HMR] Waiting for update signal from WDS...\",\n  \"[webpack-dev-server] App updated. Recompiling...\",\n  \"[webpack-dev-server] App hot update...\",\n  \"[HMR] Checking for updates on the server...\",\n  \"[HMR] Updated modules:\",\n  \"[HMR]  - ./main.css\",\n  \"[HMR]  - ../../../node_modules/css-loader/dist/cjs.js!./main.css\",\n  \"\",\n  \"[HMR] App is up to date.\",\n]\n`;\n\nexports[`hot and live reload should work and refresh content using hot module replacement when live reload and hot enabled (sockjs): page errors 1`] = `[]`;\n\nexports[`hot and live reload should work and refresh content using hot module replacement when live reload and hot enabled (ws): console messages 1`] = `\n[\n  \"[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.\",\n  \"[HMR] Waiting for update signal from WDS...\",\n  \"[webpack-dev-server] App updated. Recompiling...\",\n  \"[webpack-dev-server] App hot update...\",\n  \"[HMR] Checking for updates on the server...\",\n  \"[HMR] Updated modules:\",\n  \"[HMR]  - ./main.css\",\n  \"[HMR]  - ../../../node_modules/css-loader/dist/cjs.js!./main.css\",\n  \"\",\n  \"[HMR] App is up to date.\",\n]\n`;\n\nexports[`hot and live reload should work and refresh content using hot module replacement when live reload and hot enabled (ws): page errors 1`] = `[]`;\n\nexports[`hot and live reload should work and refresh content using hot module replacement when live reload disabled and hot enabled (default): console messages 1`] = `\n[\n  \"[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading disabled, Progress disabled, Overlay enabled.\",\n  \"[HMR] Waiting for update signal from WDS...\",\n  \"[webpack-dev-server] App updated. Recompiling...\",\n  \"[webpack-dev-server] App hot update...\",\n  \"[HMR] Checking for updates on the server...\",\n  \"[HMR] Updated modules:\",\n  \"[HMR]  - ./main.css\",\n  \"[HMR]  - ../../../node_modules/css-loader/dist/cjs.js!./main.css\",\n  \"\",\n  \"[HMR] App is up to date.\",\n]\n`;\n\nexports[`hot and live reload should work and refresh content using hot module replacement when live reload disabled and hot enabled (default): page errors 1`] = `[]`;\n\nexports[`hot and live reload should work and refresh content using hot module replacement when live reload disabled and hot enabled (sockjs): console messages 1`] = `\n[\n  \"[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading disabled, Progress disabled, Overlay enabled.\",\n  \"[HMR] Waiting for update signal from WDS...\",\n  \"[webpack-dev-server] App updated. Recompiling...\",\n  \"[webpack-dev-server] App hot update...\",\n  \"[HMR] Checking for updates on the server...\",\n  \"[HMR] Updated modules:\",\n  \"[HMR]  - ./main.css\",\n  \"[HMR]  - ../../../node_modules/css-loader/dist/cjs.js!./main.css\",\n  \"\",\n  \"[HMR] App is up to date.\",\n]\n`;\n\nexports[`hot and live reload should work and refresh content using hot module replacement when live reload disabled and hot enabled (sockjs): page errors 1`] = `[]`;\n\nexports[`hot and live reload should work and refresh content using hot module replacement when live reload disabled and hot enabled (ws): console messages 1`] = `\n[\n  \"[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading disabled, Progress disabled, Overlay enabled.\",\n  \"[HMR] Waiting for update signal from WDS...\",\n  \"[webpack-dev-server] App updated. Recompiling...\",\n  \"[webpack-dev-server] App hot update...\",\n  \"[HMR] Checking for updates on the server...\",\n  \"[HMR] Updated modules:\",\n  \"[HMR]  - ./main.css\",\n  \"[HMR]  - ../../../node_modules/css-loader/dist/cjs.js!./main.css\",\n  \"\",\n  \"[HMR] App is up to date.\",\n]\n`;\n\nexports[`hot and live reload should work and refresh content using hot module replacement when live reload disabled and hot enabled (ws): page errors 1`] = `[]`;\n\nexports[`hot and live reload should work and refresh content using hot module replacement when live reload enabled (default): console messages 1`] = `\n[\n  \"[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.\",\n  \"[HMR] Waiting for update signal from WDS...\",\n  \"[webpack-dev-server] App updated. Recompiling...\",\n  \"[webpack-dev-server] App hot update...\",\n  \"[HMR] Checking for updates on the server...\",\n  \"[HMR] Updated modules:\",\n  \"[HMR]  - ./main.css\",\n  \"[HMR]  - ../../../node_modules/css-loader/dist/cjs.js!./main.css\",\n  \"\",\n  \"[HMR] App is up to date.\",\n]\n`;\n\nexports[`hot and live reload should work and refresh content using hot module replacement when live reload enabled (default): page errors 1`] = `[]`;\n\nexports[`hot and live reload should work and refresh content using hot module replacement when live reload enabled (sockjs): console messages 1`] = `\n[\n  \"[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.\",\n  \"[HMR] Waiting for update signal from WDS...\",\n  \"[webpack-dev-server] App updated. Recompiling...\",\n  \"[webpack-dev-server] App hot update...\",\n  \"[HMR] Checking for updates on the server...\",\n  \"[HMR] Updated modules:\",\n  \"[HMR]  - ./main.css\",\n  \"[HMR]  - ../../../node_modules/css-loader/dist/cjs.js!./main.css\",\n  \"\",\n  \"[HMR] App is up to date.\",\n]\n`;\n\nexports[`hot and live reload should work and refresh content using hot module replacement when live reload enabled (sockjs): page errors 1`] = `[]`;\n\nexports[`hot and live reload should work and refresh content using hot module replacement when live reload enabled (ws): console messages 1`] = `\n[\n  \"[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.\",\n  \"[HMR] Waiting for update signal from WDS...\",\n  \"[webpack-dev-server] App updated. Recompiling...\",\n  \"[webpack-dev-server] App hot update...\",\n  \"[HMR] Checking for updates on the server...\",\n  \"[HMR] Updated modules:\",\n  \"[HMR]  - ./main.css\",\n  \"[HMR]  - ../../../node_modules/css-loader/dist/cjs.js!./main.css\",\n  \"\",\n  \"[HMR] App is up to date.\",\n]\n`;\n\nexports[`hot and live reload should work and refresh content using hot module replacement when live reload enabled (ws): page errors 1`] = `[]`;\n\nexports[`hot and live reload should work and refresh content using hot module replacement when live reload enabled and hot disabled (default): console messages 1`] = `\n[\n  \"[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.\",\n  \"[HMR] Waiting for update signal from WDS...\",\n  \"[webpack-dev-server] App updated. Recompiling...\",\n  \"[webpack-dev-server] App hot update...\",\n  \"[HMR] Checking for updates on the server...\",\n  \"[HMR] Updated modules:\",\n  \"[HMR]  - ./main.css\",\n  \"[HMR]  - ../../../node_modules/css-loader/dist/cjs.js!./main.css\",\n  \"\",\n  \"[HMR] App is up to date.\",\n]\n`;\n\nexports[`hot and live reload should work and refresh content using hot module replacement when live reload enabled and hot disabled (default): page errors 1`] = `[]`;\n\nexports[`hot and live reload should work and refresh content using live reload (default): console messages 1`] = `\n[\n  \"[webpack-dev-server] Server started: Hot Module Replacement disabled, Live Reloading enabled, Progress disabled, Overlay enabled.\",\n  \"[webpack-dev-server] App updated. Recompiling...\",\n  \"[webpack-dev-server] App updated. Reloading...\",\n  \"[webpack-dev-server] Server started: Hot Module Replacement disabled, Live Reloading enabled, Progress disabled, Overlay enabled.\",\n]\n`;\n\nexports[`hot and live reload should work and refresh content using live reload (default): page errors 1`] = `[]`;\n\nexports[`hot and live reload should work and refresh content using live reload when live reload disabled and hot enabled (sockjs): console messages 1`] = `\n[\n  \"[webpack-dev-server] Server started: Hot Module Replacement disabled, Live Reloading enabled, Progress disabled, Overlay enabled.\",\n  \"[webpack-dev-server] App updated. Recompiling...\",\n  \"[webpack-dev-server] App updated. Reloading...\",\n  \"[webpack-dev-server] Server started: Hot Module Replacement disabled, Live Reloading enabled, Progress disabled, Overlay enabled.\",\n]\n`;\n\nexports[`hot and live reload should work and refresh content using live reload when live reload disabled and hot enabled (sockjs): page errors 1`] = `[]`;\n\nexports[`hot and live reload should work and refresh content using live reload when live reload enabled and hot disabled (ws): console messages 1`] = `\n[\n  \"[webpack-dev-server] Server started: Hot Module Replacement disabled, Live Reloading enabled, Progress disabled, Overlay enabled.\",\n  \"[webpack-dev-server] App updated. Recompiling...\",\n  \"[webpack-dev-server] App updated. Reloading...\",\n  \"[webpack-dev-server] Server started: Hot Module Replacement disabled, Live Reloading enabled, Progress disabled, Overlay enabled.\",\n]\n`;\n\nexports[`hot and live reload should work and refresh content using live reload when live reload enabled and hot disabled (ws): page errors 1`] = `[]`;\n\nexports[`hot and live reload should work with manual client setup (default): console messages 1`] = `\n[\n  \"[HMR] Waiting for update signal from WDS...\",\n  \"[webpack-dev-server] Server started: Hot Module Replacement disabled, Live Reloading disabled, Progress disabled, Overlay disabled.\",\n  \"[webpack-dev-server] App updated. Recompiling...\",\n  \"[webpack-dev-server] App hot update...\",\n  \"[HMR] Checking for updates on the server...\",\n  \"[HMR] Updated modules:\",\n  \"[HMR]  - ./main.css\",\n  \"[HMR]  - ../../../node_modules/css-loader/dist/cjs.js!./main.css\",\n  \"\",\n  \"[HMR] App is up to date.\",\n]\n`;\n\nexports[`hot and live reload should work with manual client setup (default): page errors 1`] = `[]`;\n\nexports[`hot and live reload should work with manual client setup and allow to disable hot module replacement (default): console messages 1`] = `\n[\n  \"[HMR] Waiting for update signal from WDS...\",\n  \"[webpack-dev-server] Server started: Hot Module Replacement disabled, Live Reloading disabled, Progress disabled, Overlay disabled.\",\n  \"[webpack-dev-server] App updated. Recompiling...\",\n  \"[webpack-dev-server] App updated. Reloading...\",\n  \"[HMR] Waiting for update signal from WDS...\",\n  \"[webpack-dev-server] Server started: Hot Module Replacement disabled, Live Reloading disabled, Progress disabled, Overlay disabled.\",\n]\n`;\n\nexports[`hot and live reload should work with manual client setup and allow to disable hot module replacement (default): page errors 1`] = `[]`;\n\nexports[`hot and live reload should work with manual client setup and allow to disable live reload (default): console messages 1`] = `\n[\n  \"[webpack-dev-server] Server started: Hot Module Replacement disabled, Live Reloading disabled, Progress disabled, Overlay disabled.\",\n  \"[webpack-dev-server] App updated. Recompiling...\",\n]\n`;\n\nexports[`hot and live reload should work with manual client setup and allow to disable live reload (default): page errors 1`] = `[]`;\n\nexports[`hot and live reload should work with manual client setup and allow to enable hot module replacement (default): console messages 1`] = `\n[\n  \"[HMR] Waiting for update signal from WDS...\",\n  \"[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading disabled, Progress disabled, Overlay disabled.\",\n  \"[webpack-dev-server] App updated. Recompiling...\",\n  \"[webpack-dev-server] App hot update...\",\n  \"[HMR] Checking for updates on the server...\",\n  \"[HMR] Updated modules:\",\n  \"[HMR]  - ./main.css\",\n  \"[HMR]  - ../../../node_modules/css-loader/dist/cjs.js!./main.css\",\n  \"\",\n  \"[HMR] App is up to date.\",\n]\n`;\n\nexports[`hot and live reload should work with manual client setup and allow to enable hot module replacement (default): page errors 1`] = `[]`;\n\nexports[`hot and live reload should work with manual client setup and allow to enable live reload (default): console messages 1`] = `\n[\n  \"[webpack-dev-server] Server started: Hot Module Replacement disabled, Live Reloading enabled, Progress disabled, Overlay disabled.\",\n  \"[webpack-dev-server] App updated. Recompiling...\",\n  \"[webpack-dev-server] App updated. Reloading...\",\n  \"[webpack-dev-server] Server started: Hot Module Replacement disabled, Live Reloading enabled, Progress disabled, Overlay disabled.\",\n]\n`;\n\nexports[`hot and live reload should work with manual client setup and allow to enable live reload (default): page errors 1`] = `[]`;\n\nexports[`hot disabled HMR plugin should NOT register the HMR plugin before compilation is complete: console messages 1`] = `\n[\n  \"[webpack-dev-server] Server started: Hot Module Replacement disabled, Live Reloading enabled, Progress disabled, Overlay enabled.\",\n  \"Hey.\",\n]\n`;\n\nexports[`hot disabled HMR plugin should NOT register the HMR plugin before compilation is complete: page errors 1`] = `[]`;\n\nexports[`hot disabled HMR plugin should NOT register the HMR plugin before compilation is complete: response status 1`] = `200`;\n\nexports[`multi compiler hot config HMR plugin should register the HMR plugin before compilation is complete: console messages 1`] = `\n[\n  \"[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.\",\n  \"[HMR] Waiting for update signal from WDS...\",\n  \"Hey.\",\n]\n`;\n\nexports[`multi compiler hot config HMR plugin should register the HMR plugin before compilation is complete: page errors 1`] = `[]`;\n\nexports[`multi compiler hot config HMR plugin should register the HMR plugin before compilation is complete: response status 1`] = `200`;\n\nexports[`simple hot config HMR plugin should register the HMR plugin before compilation is complete: console messages 1`] = `\n[\n  \"[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.\",\n  \"[HMR] Waiting for update signal from WDS...\",\n  \"Hey.\",\n]\n`;\n\nexports[`simple hot config HMR plugin should register the HMR plugin before compilation is complete: page errors 1`] = `[]`;\n\nexports[`simple hot config HMR plugin should register the HMR plugin before compilation is complete: response status 1`] = `200`;\n\nexports[`simple hot config HMR plugin with already added HMR plugin should register the HMR plugin before compilation is complete: console messages 1`] = `\n[\n  \"[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.\",\n  \"[HMR] Waiting for update signal from WDS...\",\n  \"Hey.\",\n]\n`;\n\nexports[`simple hot config HMR plugin with already added HMR plugin should register the HMR plugin before compilation is complete: page errors 1`] = `[]`;\n\nexports[`simple hot config HMR plugin with already added HMR plugin should register the HMR plugin before compilation is complete: response status 1`] = `200`;\n"
  },
  {
    "path": "test/e2e/__snapshots__/ipc.test.js.snap.webpack5",
    "content": "// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing\n\nexports[`web socket server URL should work with the \"ipc\" option using \"string\" value (\"sockjs\"): console messages 1`] = `\n[\n  \"[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.\",\n  \"[HMR] Waiting for update signal from WDS...\",\n  \"Hey.\",\n]\n`;\n\nexports[`web socket server URL should work with the \"ipc\" option using \"string\" value (\"sockjs\"): page errors 1`] = `[]`;\n\nexports[`web socket server URL should work with the \"ipc\" option using \"string\" value (\"ws\"): console messages 1`] = `\n[\n  \"[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.\",\n  \"[HMR] Waiting for update signal from WDS...\",\n  \"Hey.\",\n]\n`;\n\nexports[`web socket server URL should work with the \"ipc\" option using \"string\" value (\"ws\"): page errors 1`] = `[]`;\n\nexports[`web socket server URL should work with the \"ipc\" option using \"true\" value (\"sockjs\"): console messages 1`] = `\n[\n  \"[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.\",\n  \"[HMR] Waiting for update signal from WDS...\",\n  \"Hey.\",\n]\n`;\n\nexports[`web socket server URL should work with the \"ipc\" option using \"true\" value (\"sockjs\"): page errors 1`] = `[]`;\n\nexports[`web socket server URL should work with the \"ipc\" option using \"true\" value (\"ws\"): console messages 1`] = `\n[\n  \"[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.\",\n  \"[HMR] Waiting for update signal from WDS...\",\n  \"Hey.\",\n]\n`;\n\nexports[`web socket server URL should work with the \"ipc\" option using \"true\" value (\"ws\"): page errors 1`] = `[]`;\n"
  },
  {
    "path": "test/e2e/__snapshots__/logging.test.js.snap.webpack5",
    "content": "// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing\n\nexports[`logging should work and do not log messages about hot and live reloading is enabled (sockjs) 1`] = `\n[\n  \"[webpack-dev-server] Server started: Hot Module Replacement disabled, Live Reloading disabled, Progress disabled, Overlay enabled.\",\n  \"Hey.\",\n]\n`;\n\nexports[`logging should work and do not log messages about hot and live reloading is enabled (ws) 1`] = `\n[\n  \"[webpack-dev-server] Server started: Hot Module Replacement disabled, Live Reloading disabled, Progress disabled, Overlay enabled.\",\n  \"Hey.\",\n]\n`;\n\nexports[`logging should work and log errors by default (sockjs) 1`] = `\n[\n  \"[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.\",\n  \"[HMR] Waiting for update signal from WDS...\",\n  \"Hey.\",\n  \"[webpack-dev-server] Errors while compiling. Reload prevented.\",\n  \"[webpack-dev-server] ERROR\nError from compilation\",\n]\n`;\n\nexports[`logging should work and log errors by default (ws) 1`] = `\n[\n  \"[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.\",\n  \"[HMR] Waiting for update signal from WDS...\",\n  \"Hey.\",\n  \"[webpack-dev-server] Errors while compiling. Reload prevented.\",\n  \"[webpack-dev-server] ERROR\nError from compilation\",\n]\n`;\n\nexports[`logging should work and log message about live reloading is enabled (sockjs) 1`] = `\n[\n  \"[webpack-dev-server] Server started: Hot Module Replacement disabled, Live Reloading enabled, Progress disabled, Overlay enabled.\",\n  \"Hey.\",\n]\n`;\n\nexports[`logging should work and log message about live reloading is enabled (ws) 1`] = `\n[\n  \"[webpack-dev-server] Server started: Hot Module Replacement disabled, Live Reloading enabled, Progress disabled, Overlay enabled.\",\n  \"Hey.\",\n]\n`;\n\nexports[`logging should work and log messages about hot and live reloading is enabled (sockjs) 1`] = `\n[\n  \"[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.\",\n  \"[HMR] Waiting for update signal from WDS...\",\n  \"Hey.\",\n]\n`;\n\nexports[`logging should work and log messages about hot and live reloading is enabled (sockjs) 2`] = `\n[\n  \"[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.\",\n  \"[HMR] Waiting for update signal from WDS...\",\n  \"Hey.\",\n]\n`;\n\nexports[`logging should work and log messages about hot and live reloading is enabled (sockjs) 3`] = `\n[\n  \"[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.\",\n  \"[HMR] Waiting for update signal from WDS...\",\n  \"Hey.\",\n]\n`;\n\nexports[`logging should work and log messages about hot and live reloading is enabled (ws) 1`] = `\n[\n  \"[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.\",\n  \"[HMR] Waiting for update signal from WDS...\",\n  \"Hey.\",\n]\n`;\n\nexports[`logging should work and log messages about hot and live reloading is enabled (ws) 2`] = `\n[\n  \"[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.\",\n  \"[HMR] Waiting for update signal from WDS...\",\n  \"Hey.\",\n]\n`;\n\nexports[`logging should work and log messages about hot and live reloading is enabled (ws) 3`] = `\n[\n  \"[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.\",\n  \"[HMR] Waiting for update signal from WDS...\",\n  \"Hey.\",\n]\n`;\n\nexports[`logging should work and log messages about hot is enabled (sockjs) 1`] = `\n[\n  \"[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading disabled, Progress disabled, Overlay enabled.\",\n  \"[HMR] Waiting for update signal from WDS...\",\n  \"Hey.\",\n]\n`;\n\nexports[`logging should work and log messages about hot is enabled (ws) 1`] = `\n[\n  \"[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading disabled, Progress disabled, Overlay enabled.\",\n  \"[HMR] Waiting for update signal from WDS...\",\n  \"Hey.\",\n]\n`;\n\nexports[`logging should work and log only error (sockjs) 1`] = `\n[\n  \"Hey.\",\n  \"[webpack-dev-server] Errors while compiling. Reload prevented.\",\n  \"[webpack-dev-server] ERROR\nError from compilation\",\n]\n`;\n\nexports[`logging should work and log only error (ws) 1`] = `\n[\n  \"Hey.\",\n  \"[webpack-dev-server] Errors while compiling. Reload prevented.\",\n  \"[webpack-dev-server] ERROR\nError from compilation\",\n]\n`;\n\nexports[`logging should work and log static changes (sockjs) 1`] = `\n[\n  \"[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.\",\n  \"[HMR] Waiting for update signal from WDS...\",\n  \"Hey.\",\n  \"[webpack-dev-server] \"<cwd>/test/fixtures/client-config/static/foo.txt\" from static directory was changed. Reloading...\",\n  \"[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.\",\n  \"[HMR] Waiting for update signal from WDS...\",\n  \"Hey.\",\n]\n`;\n\nexports[`logging should work and log static changes (ws) 1`] = `\n[\n  \"[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.\",\n  \"[HMR] Waiting for update signal from WDS...\",\n  \"Hey.\",\n  \"[webpack-dev-server] \"<cwd>/test/fixtures/client-config/static/foo.txt\" from static directory was changed. Reloading...\",\n  \"[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.\",\n  \"[HMR] Waiting for update signal from WDS...\",\n  \"Hey.\",\n]\n`;\n\nexports[`logging should work and log warning and errors (sockjs) 1`] = `\n[\n  \"Hey.\",\n  \"[webpack-dev-server] Warnings while compiling.\",\n  \"[webpack-dev-server] WARNING\nWarning from compilation\",\n  \"[webpack-dev-server] Errors while compiling. Reload prevented.\",\n  \"[webpack-dev-server] ERROR\nError from compilation\",\n]\n`;\n\nexports[`logging should work and log warning and errors (ws) 1`] = `\n[\n  \"Hey.\",\n  \"[webpack-dev-server] Warnings while compiling.\",\n  \"[webpack-dev-server] WARNING\nWarning from compilation\",\n  \"[webpack-dev-server] Errors while compiling. Reload prevented.\",\n  \"[webpack-dev-server] ERROR\nError from compilation\",\n]\n`;\n\nexports[`logging should work and log warnings by default (sockjs) 1`] = `\n[\n  \"[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.\",\n  \"[HMR] Waiting for update signal from WDS...\",\n  \"Hey.\",\n  \"[webpack-dev-server] Warnings while compiling.\",\n  \"[webpack-dev-server] WARNING\nWarning from compilation\",\n]\n`;\n\nexports[`logging should work and log warnings by default (ws) 1`] = `\n[\n  \"[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.\",\n  \"[HMR] Waiting for update signal from WDS...\",\n  \"Hey.\",\n  \"[webpack-dev-server] Warnings while compiling.\",\n  \"[webpack-dev-server] WARNING\nWarning from compilation\",\n]\n`;\n\nexports[`logging should work when the \"client.logging\" is \"info\" (sockjs) 1`] = `\n[\n  \"[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.\",\n  \"[HMR] Waiting for update signal from WDS...\",\n  \"Hey.\",\n]\n`;\n\nexports[`logging should work when the \"client.logging\" is \"info\" (ws) 1`] = `\n[\n  \"[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.\",\n  \"[HMR] Waiting for update signal from WDS...\",\n  \"Hey.\",\n]\n`;\n\nexports[`logging should work when the \"client.logging\" is \"log\" (sockjs) 1`] = `\n[\n  \"[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.\",\n  \"[HMR] Waiting for update signal from WDS...\",\n  \"Hey.\",\n]\n`;\n\nexports[`logging should work when the \"client.logging\" is \"log\" (ws) 1`] = `\n[\n  \"[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.\",\n  \"[HMR] Waiting for update signal from WDS...\",\n  \"Hey.\",\n]\n`;\n\nexports[`logging should work when the \"client.logging\" is \"none\" (sockjs) 1`] = `\n[\n  \"Hey.\",\n]\n`;\n\nexports[`logging should work when the \"client.logging\" is \"none\" (ws) 1`] = `\n[\n  \"Hey.\",\n]\n`;\n\nexports[`logging should work when the \"client.logging\" is \"verbose\" (sockjs) 1`] = `\n[\n  \"[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.\",\n  \"[HMR] Waiting for update signal from WDS...\",\n  \"Hey.\",\n]\n`;\n\nexports[`logging should work when the \"client.logging\" is \"verbose\" (ws) 1`] = `\n[\n  \"[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.\",\n  \"[HMR] Waiting for update signal from WDS...\",\n  \"Hey.\",\n]\n`;\n"
  },
  {
    "path": "test/e2e/__snapshots__/mime-types.test.js.snap.webpack5",
    "content": "// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing\n\nexports[`mimeTypes option as an object with a custom type should request file with different js mime type: console messages 1`] = `[]`;\n\nexports[`mimeTypes option as an object with a custom type should request file with different js mime type: page errors 1`] = `[]`;\n\nexports[`mimeTypes option as an object with a custom type should request file with different js mime type: response headers content-type 1`] = `\"text/html; charset=utf-8\"`;\n\nexports[`mimeTypes option as an object with a custom type should request file with different js mime type: response status 1`] = `200`;\n\nexports[`mimeTypes option as an object with a remapped type should request file with different js mime type: console messages 1`] = `[]`;\n\nexports[`mimeTypes option as an object with a remapped type should request file with different js mime type: page errors 1`] = `[]`;\n\nexports[`mimeTypes option as an object with a remapped type should request file with different js mime type: response headers content-type 1`] = `\"text/plain; charset=utf-8\"`;\n\nexports[`mimeTypes option as an object with a remapped type should request file with different js mime type: response status 1`] = `200`;\n"
  },
  {
    "path": "test/e2e/__snapshots__/module-federation.test.js.snap.webpack5",
    "content": "// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing\n\nexports[`Module federation should use plugin should contain hot script in main.js: console messages 1`] = `[]`;\n\nexports[`Module federation should use plugin should contain hot script in main.js: page errors 1`] = `[]`;\n\nexports[`Module federation should use plugin should contain hot script in remoteEntry.js: console messages 1`] = `[]`;\n\nexports[`Module federation should use plugin should contain hot script in remoteEntry.js: page errors 1`] = `[]`;\n\nexports[`Module federation should work with multi compiler config should use the last entry export: console messages 1`] = `[]`;\n\nexports[`Module federation should work with multi compiler config should use the last entry export: page errors 1`] = `[]`;\n\nexports[`Module federation should work with object multi-entry config should support the named entry export: console messages 1`] = `[]`;\n\nexports[`Module federation should work with object multi-entry config should support the named entry export: page errors 1`] = `[]`;\n\nexports[`Module federation should work with object multi-entry config should use the last entry export: console messages 1`] = `[]`;\n\nexports[`Module federation should work with object multi-entry config should use the last entry export: page errors 1`] = `[]`;\n\nexports[`Module federation should work with simple multi-entry config should use the last entry export: console messages 1`] = `[]`;\n\nexports[`Module federation should work with simple multi-entry config should use the last entry export: page errors 1`] = `[]`;\n"
  },
  {
    "path": "test/e2e/__snapshots__/multi-compiler.test.js.snap.webpack5",
    "content": "// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing\n\nexports[`multi compiler should work with one web target configuration and do nothing: console messages 1`] = `\n[\n  \"[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.\",\n  \"[HMR] Waiting for update signal from WDS...\",\n  \"Hey.\",\n]\n`;\n\nexports[`multi compiler should work with one web target configuration and do nothing: page errors 1`] = `[]`;\n\nexports[`multi compiler should work with universal configuration and do nothing: console messages 1`] = `\n[\n  \"[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.\",\n  \"[HMR] Waiting for update signal from WDS...\",\n  \"Hello from the browser\",\n]\n`;\n\nexports[`multi compiler should work with universal configuration and do nothing: page errors 1`] = `[]`;\n\nexports[`multi compiler should work with universal configuration when hot and live reloads are enabled, and do hot reload for browser compiler by default when browser entry changed: console messages 1`] = `\n[\n  \"[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.\",\n  \"[HMR] Waiting for update signal from WDS...\",\n  \"Hello from the browser\",\n  \"[webpack-dev-server] App updated. Recompiling...\",\n  \"[webpack-dev-server] App hot update...\",\n  \"[HMR] Checking for updates on the server...\",\n  \"[HMR] Cannot apply update. Need to do a full reload!\",\n  \"[HMR] Error: Aborted because ./browser.js is not accepted\nUpdate propagation: ./browser.js\n    <stack>\",\n  \"[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.\",\n  \"[HMR] Waiting for update signal from WDS...\",\n  \"Hello from the browser\",\n]\n`;\n\nexports[`multi compiler should work with universal configuration when hot and live reloads are enabled, and do hot reload for browser compiler by default when browser entry changed: page errors 1`] = `[]`;\n\nexports[`multi compiler should work with universal configuration when only hot reload is enabled, and do hot reload for browser compiler when browser entry changed: console messages 1`] = `\n[\n  \"[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading disabled, Progress disabled, Overlay enabled.\",\n  \"[HMR] Waiting for update signal from WDS...\",\n  \"Hello from the browser\",\n  \"[webpack-dev-server] App updated. Recompiling...\",\n  \"[webpack-dev-server] App hot update...\",\n  \"[HMR] Checking for updates on the server...\",\n  \"[HMR] Cannot apply update. Need to do a full reload!\",\n  \"[HMR] Error: Aborted because ./browser.js is not accepted\nUpdate propagation: ./browser.js\n    <stack>\",\n  \"[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading disabled, Progress disabled, Overlay enabled.\",\n  \"[HMR] Waiting for update signal from WDS...\",\n  \"Hello from the browser\",\n]\n`;\n\nexports[`multi compiler should work with universal configuration when only hot reload is enabled, and do hot reload for browser compiler when browser entry changed: page errors 1`] = `[]`;\n\nexports[`multi compiler should work with universal configuration when only live reload is enabled, and do live reload for browser compiler when changing browser and server entries: console messages 1`] = `\n[\n  \"[webpack-dev-server] Server started: Hot Module Replacement disabled, Live Reloading enabled, Progress disabled, Overlay enabled.\",\n  \"Hello from the browser\",\n  \"[webpack-dev-server] App updated. Recompiling...\",\n  \"[webpack-dev-server] App updated. Reloading...\",\n  \"[webpack-dev-server] Server started: Hot Module Replacement disabled, Live Reloading enabled, Progress disabled, Overlay enabled.\",\n  \"Hello from the browser\",\n]\n`;\n\nexports[`multi compiler should work with universal configuration when only live reload is enabled, and do live reload for browser compiler when changing browser and server entries: console messages 2`] = `\n[\n  \"[webpack-dev-server] Server started: Hot Module Replacement disabled, Live Reloading enabled, Progress disabled, Overlay enabled.\",\n  \"Hello from the browser\",\n  \"[webpack-dev-server] App updated. Recompiling...\",\n  \"[webpack-dev-server] App updated. Reloading...\",\n  \"[webpack-dev-server] Server started: Hot Module Replacement disabled, Live Reloading enabled, Progress disabled, Overlay enabled.\",\n  \"Hello from the browser\",\n]\n`;\n\nexports[`multi compiler should work with universal configuration when only live reload is enabled, and do live reload for browser compiler when changing browser and server entries: page errors 1`] = `[]`;\n\nexports[`multi compiler should work with universal configuration when only live reload is enabled, and do live reload for browser compiler when changing browser and server entries: page errors 2`] = `[]`;\n\nexports[`multi compiler should work with universal configuration when only live reload is enabled, and do live reload for browser compiler when changing server and browser entries: console messages 1`] = `\n[\n  \"[webpack-dev-server] Server started: Hot Module Replacement disabled, Live Reloading enabled, Progress disabled, Overlay enabled.\",\n  \"Hello from the browser\",\n  \"[webpack-dev-server] App updated. Recompiling...\",\n  \"[webpack-dev-server] App updated. Reloading...\",\n  \"[webpack-dev-server] Server started: Hot Module Replacement disabled, Live Reloading enabled, Progress disabled, Overlay enabled.\",\n  \"Hello from the browser\",\n]\n`;\n\nexports[`multi compiler should work with universal configuration when only live reload is enabled, and do live reload for browser compiler when changing server and browser entries: console messages 2`] = `\n[\n  \"[webpack-dev-server] Server started: Hot Module Replacement disabled, Live Reloading enabled, Progress disabled, Overlay enabled.\",\n  \"Hello from the browser\",\n  \"[webpack-dev-server] App updated. Recompiling...\",\n  \"[webpack-dev-server] App updated. Reloading...\",\n  \"[webpack-dev-server] Server started: Hot Module Replacement disabled, Live Reloading enabled, Progress disabled, Overlay enabled.\",\n  \"Hello from the browser\",\n]\n`;\n\nexports[`multi compiler should work with universal configuration when only live reload is enabled, and do live reload for browser compiler when changing server and browser entries: page errors 1`] = `[]`;\n\nexports[`multi compiler should work with universal configuration when only live reload is enabled, and do live reload for browser compiler when changing server and browser entries: page errors 2`] = `[]`;\n\nexports[`multi compiler should work with web target configurations and do nothing: console messages 1`] = `\n[\n  \"[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.\",\n  \"[HMR] Waiting for update signal from WDS...\",\n  \"one\",\n]\n`;\n\nexports[`multi compiler should work with web target configurations and do nothing: console messages 2`] = `\n[\n  \"[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.\",\n  \"[HMR] Waiting for update signal from WDS...\",\n  \"two\",\n]\n`;\n\nexports[`multi compiler should work with web target configurations and do nothing: page errors 1`] = `[]`;\n\nexports[`multi compiler should work with web target configurations and do nothing: page errors 2`] = `[]`;\n\nexports[`multi compiler should work with web target configurations when hot and live reloads are enabled, and do hot reload by default when changing own entries: console messages 1`] = `\n[\n  \"[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.\",\n  \"[HMR] Waiting for update signal from WDS...\",\n  \"one\",\n  \"[webpack-dev-server] App updated. Recompiling...\",\n  \"[webpack-dev-server] App hot update...\",\n  \"[HMR] Checking for updates on the server...\",\n  \"[HMR] Cannot apply update. Need to do a full reload!\",\n  \"[HMR] Error: Aborted because ./one.js is not accepted\nUpdate propagation: ./one.js\n    <stack>\",\n  \"[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.\",\n  \"[HMR] Waiting for update signal from WDS...\",\n  \"one\",\n]\n`;\n\nexports[`multi compiler should work with web target configurations when hot and live reloads are enabled, and do hot reload by default when changing own entries: console messages 2`] = `\n[\n  \"[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.\",\n  \"[HMR] Waiting for update signal from WDS...\",\n  \"two\",\n  \"[webpack-dev-server] App updated. Recompiling...\",\n  \"[webpack-dev-server] App hot update...\",\n  \"[HMR] Checking for updates on the server...\",\n  \"[HMR] Cannot apply update. Need to do a full reload!\",\n  \"[HMR] Error: Aborted because ./two.js is not accepted\nUpdate propagation: ./two.js\n    <stack>\",\n  \"[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.\",\n  \"[HMR] Waiting for update signal from WDS...\",\n  \"two\",\n]\n`;\n\nexports[`multi compiler should work with web target configurations when hot and live reloads are enabled, and do hot reload by default when changing own entries: page errors 1`] = `[]`;\n\nexports[`multi compiler should work with web target configurations when hot and live reloads are enabled, and do hot reload by default when changing own entries: page errors 2`] = `[]`;\n\nexports[`multi compiler should work with web target configurations when only hot reload is enabled, and do hot reload when changing own entries: console messages 1`] = `\n[\n  \"[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading disabled, Progress disabled, Overlay enabled.\",\n  \"[HMR] Waiting for update signal from WDS...\",\n  \"one\",\n  \"[webpack-dev-server] App updated. Recompiling...\",\n  \"[webpack-dev-server] App hot update...\",\n  \"[HMR] Checking for updates on the server...\",\n  \"[HMR] Cannot apply update. Need to do a full reload!\",\n  \"[HMR] Error: Aborted because ./one.js is not accepted\nUpdate propagation: ./one.js\n    <stack>\",\n  \"[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading disabled, Progress disabled, Overlay enabled.\",\n  \"[HMR] Waiting for update signal from WDS...\",\n  \"one\",\n]\n`;\n\nexports[`multi compiler should work with web target configurations when only hot reload is enabled, and do hot reload when changing own entries: console messages 2`] = `\n[\n  \"[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading disabled, Progress disabled, Overlay enabled.\",\n  \"[HMR] Waiting for update signal from WDS...\",\n  \"two\",\n  \"[webpack-dev-server] App updated. Recompiling...\",\n  \"[webpack-dev-server] App hot update...\",\n  \"[HMR] Checking for updates on the server...\",\n  \"[HMR] Cannot apply update. Need to do a full reload!\",\n  \"[HMR] Error: Aborted because ./two.js is not accepted\nUpdate propagation: ./two.js\n    <stack>\",\n  \"[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading disabled, Progress disabled, Overlay enabled.\",\n  \"[HMR] Waiting for update signal from WDS...\",\n  \"two\",\n]\n`;\n\nexports[`multi compiler should work with web target configurations when only hot reload is enabled, and do hot reload when changing own entries: page errors 1`] = `[]`;\n\nexports[`multi compiler should work with web target configurations when only hot reload is enabled, and do hot reload when changing own entries: page errors 2`] = `[]`;\n\nexports[`multi compiler should work with web target configurations when only live reload is enabled and do live reload when changing other entries: console messages 1`] = `\n[\n  \"[webpack-dev-server] Server started: Hot Module Replacement disabled, Live Reloading enabled, Progress disabled, Overlay enabled.\",\n  \"one\",\n  \"[webpack-dev-server] App updated. Recompiling...\",\n  \"[webpack-dev-server] App updated. Reloading...\",\n  \"[webpack-dev-server] Server started: Hot Module Replacement disabled, Live Reloading enabled, Progress disabled, Overlay enabled.\",\n  \"one\",\n]\n`;\n\nexports[`multi compiler should work with web target configurations when only live reload is enabled and do live reload when changing other entries: console messages 2`] = `\n[\n  \"[webpack-dev-server] Server started: Hot Module Replacement disabled, Live Reloading enabled, Progress disabled, Overlay enabled.\",\n  \"two\",\n  \"[webpack-dev-server] App updated. Recompiling...\",\n  \"[webpack-dev-server] App updated. Reloading...\",\n  \"[webpack-dev-server] Server started: Hot Module Replacement disabled, Live Reloading enabled, Progress disabled, Overlay enabled.\",\n  \"two\",\n]\n`;\n\nexports[`multi compiler should work with web target configurations when only live reload is enabled and do live reload when changing other entries: page errors 1`] = `[]`;\n\nexports[`multi compiler should work with web target configurations when only live reload is enabled and do live reload when changing other entries: page errors 2`] = `[]`;\n\nexports[`multi compiler should work with web target configurations when only live reload is enabled, and do live reload when changing own entries: console messages 1`] = `\n[\n  \"[webpack-dev-server] Server started: Hot Module Replacement disabled, Live Reloading enabled, Progress disabled, Overlay enabled.\",\n  \"one\",\n  \"[webpack-dev-server] App updated. Recompiling...\",\n  \"[webpack-dev-server] App updated. Reloading...\",\n  \"[webpack-dev-server] Server started: Hot Module Replacement disabled, Live Reloading enabled, Progress disabled, Overlay enabled.\",\n  \"one\",\n]\n`;\n\nexports[`multi compiler should work with web target configurations when only live reload is enabled, and do live reload when changing own entries: console messages 2`] = `\n[\n  \"[webpack-dev-server] Server started: Hot Module Replacement disabled, Live Reloading enabled, Progress disabled, Overlay enabled.\",\n  \"two\",\n  \"[webpack-dev-server] App updated. Recompiling...\",\n  \"[webpack-dev-server] App updated. Reloading...\",\n  \"[webpack-dev-server] Server started: Hot Module Replacement disabled, Live Reloading enabled, Progress disabled, Overlay enabled.\",\n  \"two\",\n]\n`;\n\nexports[`multi compiler should work with web target configurations when only live reload is enabled, and do live reload when changing own entries: page errors 1`] = `[]`;\n\nexports[`multi compiler should work with web target configurations when only live reload is enabled, and do live reload when changing own entries: page errors 2`] = `[]`;\n"
  },
  {
    "path": "test/e2e/__snapshots__/on-listening.test.js.snap.webpack5",
    "content": "// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing\n\nexports[`onListening option should handle GET request to /listening/some/path route: console messages 1`] = `[]`;\n\nexports[`onListening option should handle GET request to /listening/some/path route: page errors 1`] = `[]`;\n\nexports[`onListening option should handle GET request to /listening/some/path route: response headers content-type 1`] = `\"text/html; charset=utf-8\"`;\n\nexports[`onListening option should handle GET request to /listening/some/path route: response status 1`] = `200`;\n\nexports[`onListening option should handle GET request to /listening/some/path route: response text 1`] = `\"listening\"`;\n\nexports[`onListening option should handle POST request to /listening/some/path route: console messages 1`] = `[]`;\n\nexports[`onListening option should handle POST request to /listening/some/path route: page errors 1`] = `[]`;\n\nexports[`onListening option should handle POST request to /listening/some/path route: response headers content-type 1`] = `\"text/html; charset=utf-8\"`;\n\nexports[`onListening option should handle POST request to /listening/some/path route: response status 1`] = `200`;\n\nexports[`onListening option should handle POST request to /listening/some/path route: response text 1`] = `\"listening POST\"`;\n"
  },
  {
    "path": "test/e2e/__snapshots__/overlay.test.js.snap.webpack5",
    "content": "// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing\n\nexports[`overlay should not show a warning when \"client.overlay\" is \"false\": page html 1`] = `\n\"<body>\n  <h1>webpack-dev-server is running...</h1>\n  <script type=\"text/javascript\" charset=\"utf-8\" src=\"/main.js\"></script>\n</body>\n\"\n`;\n\nexports[`overlay should not show a warning when \"client.overlay.warnings\" is \"false\": page html 1`] = `\n\"<body>\n  <h1>webpack-dev-server is running...</h1>\n  <script type=\"text/javascript\" charset=\"utf-8\" src=\"/main.js\"></script>\n</body>\n\"\n`;\n\nexports[`overlay should not show an error when \"client.overlay\" is \"false\": page html 1`] = `\n\"<body>\n  <h1>webpack-dev-server is running...</h1>\n  <script type=\"text/javascript\" charset=\"utf-8\" src=\"/main.js\"></script>\n</body>\n\"\n`;\n\nexports[`overlay should not show an error when \"client.overlay.errors\" is \"false\": page html 1`] = `\n\"<body>\n  <h1>webpack-dev-server is running...</h1>\n  <script type=\"text/javascript\" charset=\"utf-8\" src=\"/main.js\"></script>\n</body>\n\"\n`;\n\nexports[`overlay should not show initially, then show on an error and allow to close: overlay html 1`] = `\n\"<body>\n  <div\n    id=\"webpack-dev-server-client-overlay-div\"\n    style=\"\n      position: fixed;\n      box-sizing: border-box;\n      inset: 0px;\n      width: 100vw;\n      height: 100vh;\n      font-size: large;\n      padding: 2rem 2rem 4rem;\n      line-height: 1.2;\n      white-space: pre-wrap;\n      overflow: auto;\n      background-color: rgba(0, 0, 0, 0.9);\n      color: white;\n    \"\n  >\n    <div\n      style=\"\n        color: rgb(232, 59, 70);\n        font-size: 2em;\n        white-space: pre-wrap;\n        font-family: sans-serif;\n        margin: 0px 2rem 2rem 0px;\n        flex: 0 0 auto;\n        max-height: 50%;\n        overflow: auto;\n      \"\n    >\n      Compiled with problems:\n    </div>\n    <button\n      aria-label=\"Dismiss\"\n      style=\"\n        color: rgb(255, 255, 255);\n        line-height: 1rem;\n        font-size: 1.5rem;\n        padding: 1rem;\n        cursor: pointer;\n        position: absolute;\n        right: 0px;\n        top: 0px;\n        background-color: transparent;\n        border: none;\n      \"\n    >\n      ×\n    </button>\n    <div>\n      <div\n        style=\"\n          background-color: rgba(206, 17, 38, 0.1);\n          color: rgb(252, 207, 207);\n          padding: 1rem 1rem 1.5rem;\n        \"\n      >\n        <div\n          data-can-open=\"true\"\n          style=\"\n            color: rgb(232, 59, 70);\n            font-size: 1.2em;\n            margin-bottom: 1rem;\n            font-family: sans-serif;\n            cursor: pointer;\n          \"\n        >\n          ERROR in ./foo.js 1:1\n        </div>\n        <div\n          style=\"\n            line-height: 1.5;\n            font-size: 1rem;\n            font-family: Menlo, Consolas, monospace;\n          \"\n        >\n          Module parse failed: Unterminated template (1:1) You may need an\n          appropriate loader to handle this file type, currently no loaders are\n          configured to process this file. See\n          https://webpack.js.org/concepts#loaders &gt; \\`;\n        </div>\n      </div>\n    </div>\n  </div>\n</body>\n\"\n`;\n\nexports[`overlay should not show initially, then show on an error and allow to close: page html after close 1`] = `\n\"<body>\n  <h1>webpack-dev-server is running...</h1>\n  <script type=\"text/javascript\" charset=\"utf-8\" src=\"/main.js\"></script>\n</body>\n\"\n`;\n\nexports[`overlay should not show initially, then show on an error and allow to close: page html initial 1`] = `\n\"<body>\n  <h1>webpack-dev-server is running...</h1>\n  <script type=\"text/javascript\" charset=\"utf-8\" src=\"/main.js\"></script>\n</body>\n\"\n`;\n\nexports[`overlay should not show initially, then show on an error and allow to close: page html with error 1`] = `\n\"<body>\n  <h1>webpack-dev-server is running...</h1>\n  <script type=\"text/javascript\" charset=\"utf-8\" src=\"/main.js\"></script>\n\n  <iframe\n    id=\"webpack-dev-server-client-overlay\"\n    src=\"about:blank\"\n    style=\"\n      position: fixed;\n      inset: 0px;\n      width: 100vw;\n      height: 100vh;\n      border: none;\n      z-index: 2147483647;\n    \"\n  ></iframe>\n</body>\n\"\n`;\n\nexports[`overlay should not show initially, then show on an error, then hide on fix: overlay html 1`] = `\n\"<body>\n  <div\n    id=\"webpack-dev-server-client-overlay-div\"\n    style=\"\n      position: fixed;\n      box-sizing: border-box;\n      inset: 0px;\n      width: 100vw;\n      height: 100vh;\n      font-size: large;\n      padding: 2rem 2rem 4rem;\n      line-height: 1.2;\n      white-space: pre-wrap;\n      overflow: auto;\n      background-color: rgba(0, 0, 0, 0.9);\n      color: white;\n    \"\n  >\n    <div\n      style=\"\n        color: rgb(232, 59, 70);\n        font-size: 2em;\n        white-space: pre-wrap;\n        font-family: sans-serif;\n        margin: 0px 2rem 2rem 0px;\n        flex: 0 0 auto;\n        max-height: 50%;\n        overflow: auto;\n      \"\n    >\n      Compiled with problems:\n    </div>\n    <button\n      aria-label=\"Dismiss\"\n      style=\"\n        color: rgb(255, 255, 255);\n        line-height: 1rem;\n        font-size: 1.5rem;\n        padding: 1rem;\n        cursor: pointer;\n        position: absolute;\n        right: 0px;\n        top: 0px;\n        background-color: transparent;\n        border: none;\n      \"\n    >\n      ×\n    </button>\n    <div>\n      <div\n        style=\"\n          background-color: rgba(206, 17, 38, 0.1);\n          color: rgb(252, 207, 207);\n          padding: 1rem 1rem 1.5rem;\n        \"\n      >\n        <div\n          data-can-open=\"true\"\n          style=\"\n            color: rgb(232, 59, 70);\n            font-size: 1.2em;\n            margin-bottom: 1rem;\n            font-family: sans-serif;\n            cursor: pointer;\n          \"\n        >\n          ERROR in ./foo.js 1:1\n        </div>\n        <div\n          style=\"\n            line-height: 1.5;\n            font-size: 1rem;\n            font-family: Menlo, Consolas, monospace;\n          \"\n        >\n          Module parse failed: Unterminated template (1:1) You may need an\n          appropriate loader to handle this file type, currently no loaders are\n          configured to process this file. See\n          https://webpack.js.org/concepts#loaders &gt; \\`;\n        </div>\n      </div>\n    </div>\n  </div>\n</body>\n\"\n`;\n\nexports[`overlay should not show initially, then show on an error, then hide on fix: page html after fix error 1`] = `\n\"<body>\n  <h1>webpack-dev-server is running...</h1>\n  <script type=\"text/javascript\" charset=\"utf-8\" src=\"/main.js\"></script>\n</body>\n\"\n`;\n\nexports[`overlay should not show initially, then show on an error, then hide on fix: page html initial 1`] = `\n\"<body>\n  <h1>webpack-dev-server is running...</h1>\n  <script type=\"text/javascript\" charset=\"utf-8\" src=\"/main.js\"></script>\n</body>\n\"\n`;\n\nexports[`overlay should not show initially, then show on an error, then hide on fix: page html with error 1`] = `\n\"<body>\n  <h1>webpack-dev-server is running...</h1>\n  <script type=\"text/javascript\" charset=\"utf-8\" src=\"/main.js\"></script>\n\n  <iframe\n    id=\"webpack-dev-server-client-overlay\"\n    src=\"about:blank\"\n    style=\"\n      position: fixed;\n      inset: 0px;\n      width: 100vw;\n      height: 100vh;\n      border: none;\n      z-index: 2147483647;\n    \"\n  ></iframe>\n</body>\n\"\n`;\n\nexports[`overlay should not show initially, then show on an error, then show other error, then hide on fix: overlay html 1`] = `\n\"<body>\n  <div\n    id=\"webpack-dev-server-client-overlay-div\"\n    style=\"\n      position: fixed;\n      box-sizing: border-box;\n      inset: 0px;\n      width: 100vw;\n      height: 100vh;\n      font-size: large;\n      padding: 2rem 2rem 4rem;\n      line-height: 1.2;\n      white-space: pre-wrap;\n      overflow: auto;\n      background-color: rgba(0, 0, 0, 0.9);\n      color: white;\n    \"\n  >\n    <div\n      style=\"\n        color: rgb(232, 59, 70);\n        font-size: 2em;\n        white-space: pre-wrap;\n        font-family: sans-serif;\n        margin: 0px 2rem 2rem 0px;\n        flex: 0 0 auto;\n        max-height: 50%;\n        overflow: auto;\n      \"\n    >\n      Compiled with problems:\n    </div>\n    <button\n      aria-label=\"Dismiss\"\n      style=\"\n        color: rgb(255, 255, 255);\n        line-height: 1rem;\n        font-size: 1.5rem;\n        padding: 1rem;\n        cursor: pointer;\n        position: absolute;\n        right: 0px;\n        top: 0px;\n        background-color: transparent;\n        border: none;\n      \"\n    >\n      ×\n    </button>\n    <div>\n      <div\n        style=\"\n          background-color: rgba(206, 17, 38, 0.1);\n          color: rgb(252, 207, 207);\n          padding: 1rem 1rem 1.5rem;\n        \"\n      >\n        <div\n          data-can-open=\"true\"\n          style=\"\n            color: rgb(232, 59, 70);\n            font-size: 1.2em;\n            margin-bottom: 1rem;\n            font-family: sans-serif;\n            cursor: pointer;\n          \"\n        >\n          ERROR in ./foo.js 1:1\n        </div>\n        <div\n          style=\"\n            line-height: 1.5;\n            font-size: 1rem;\n            font-family: Menlo, Consolas, monospace;\n          \"\n        >\n          Module parse failed: Unterminated template (1:1) You may need an\n          appropriate loader to handle this file type, currently no loaders are\n          configured to process this file. See\n          https://webpack.js.org/concepts#loaders &gt; \\`;\n        </div>\n      </div>\n    </div>\n  </div>\n</body>\n\"\n`;\n\nexports[`overlay should not show initially, then show on an error, then show other error, then hide on fix: overlay html 2`] = `\n\"<body>\n  <div\n    id=\"webpack-dev-server-client-overlay-div\"\n    style=\"\n      position: fixed;\n      box-sizing: border-box;\n      inset: 0px;\n      width: 100vw;\n      height: 100vh;\n      font-size: large;\n      padding: 2rem 2rem 4rem;\n      line-height: 1.2;\n      white-space: pre-wrap;\n      overflow: auto;\n      background-color: rgba(0, 0, 0, 0.9);\n      color: white;\n    \"\n  >\n    <div\n      style=\"\n        color: rgb(232, 59, 70);\n        font-size: 2em;\n        white-space: pre-wrap;\n        font-family: sans-serif;\n        margin: 0px 2rem 2rem 0px;\n        flex: 0 0 auto;\n        max-height: 50%;\n        overflow: auto;\n      \"\n    >\n      Compiled with problems:\n    </div>\n    <button\n      aria-label=\"Dismiss\"\n      style=\"\n        color: rgb(255, 255, 255);\n        line-height: 1rem;\n        font-size: 1.5rem;\n        padding: 1rem;\n        cursor: pointer;\n        position: absolute;\n        right: 0px;\n        top: 0px;\n        background-color: transparent;\n        border: none;\n      \"\n    >\n      ×\n    </button>\n    <div>\n      <div\n        style=\"\n          background-color: rgba(206, 17, 38, 0.1);\n          color: rgb(252, 207, 207);\n          padding: 1rem 1rem 1.5rem;\n        \"\n      >\n        <div\n          data-can-open=\"true\"\n          style=\"\n            color: rgb(232, 59, 70);\n            font-size: 1.2em;\n            margin-bottom: 1rem;\n            font-family: sans-serif;\n            cursor: pointer;\n          \"\n        >\n          ERROR in ./foo.js 1:1\n        </div>\n        <div\n          style=\"\n            line-height: 1.5;\n            font-size: 1rem;\n            font-family: Menlo, Consolas, monospace;\n          \"\n        >\n          Module parse failed: Unterminated template (1:1) You may need an\n          appropriate loader to handle this file type, currently no loaders are\n          configured to process this file. See\n          https://webpack.js.org/concepts#loaders &gt; \\`;a\n        </div>\n      </div>\n    </div>\n  </div>\n</body>\n\"\n`;\n\nexports[`overlay should not show initially, then show on an error, then show other error, then hide on fix: page html after fix error 1`] = `\n\"<body>\n  <h1>webpack-dev-server is running...</h1>\n  <script type=\"text/javascript\" charset=\"utf-8\" src=\"/main.js\"></script>\n</body>\n\"\n`;\n\nexports[`overlay should not show initially, then show on an error, then show other error, then hide on fix: page html initial 1`] = `\n\"<body>\n  <h1>webpack-dev-server is running...</h1>\n  <script type=\"text/javascript\" charset=\"utf-8\" src=\"/main.js\"></script>\n</body>\n\"\n`;\n\nexports[`overlay should not show initially, then show on an error, then show other error, then hide on fix: page html with error 1`] = `\n\"<body>\n  <h1>webpack-dev-server is running...</h1>\n  <script type=\"text/javascript\" charset=\"utf-8\" src=\"/main.js\"></script>\n\n  <iframe\n    id=\"webpack-dev-server-client-overlay\"\n    src=\"about:blank\"\n    style=\"\n      position: fixed;\n      inset: 0px;\n      width: 100vw;\n      height: 100vh;\n      border: none;\n      z-index: 2147483647;\n    \"\n  ></iframe>\n</body>\n\"\n`;\n\nexports[`overlay should not show initially, then show on an error, then show other error, then hide on fix: page html with other error 1`] = `\n\"<body>\n  <h1>webpack-dev-server is running...</h1>\n  <script type=\"text/javascript\" charset=\"utf-8\" src=\"/main.js\"></script>\n\n  <iframe\n    id=\"webpack-dev-server-client-overlay\"\n    src=\"about:blank\"\n    style=\"\n      position: fixed;\n      inset: 0px;\n      width: 100vw;\n      height: 100vh;\n      border: none;\n      z-index: 2147483647;\n    \"\n  ></iframe>\n</body>\n\"\n`;\n\nexports[`overlay should not show overlay when Trusted Types are enabled, but policy is not allowed: page html 1`] = `\n\"<body>\n  <h1>webpack-dev-server is running...</h1>\n  <script type=\"text/javascript\" charset=\"utf-8\" src=\"/main.js\"></script>\n</body>\n\"\n`;\n\nexports[`overlay should show a warning after invalidation: overlay html 1`] = `\n\"<body>\n  <div\n    id=\"webpack-dev-server-client-overlay-div\"\n    style=\"\n      position: fixed;\n      box-sizing: border-box;\n      inset: 0px;\n      width: 100vw;\n      height: 100vh;\n      font-size: large;\n      padding: 2rem 2rem 4rem;\n      line-height: 1.2;\n      white-space: pre-wrap;\n      overflow: auto;\n      background-color: rgba(0, 0, 0, 0.9);\n      color: white;\n    \"\n  >\n    <div\n      style=\"\n        color: rgb(232, 59, 70);\n        font-size: 2em;\n        white-space: pre-wrap;\n        font-family: sans-serif;\n        margin: 0px 2rem 2rem 0px;\n        flex: 0 0 auto;\n        max-height: 50%;\n        overflow: auto;\n      \"\n    >\n      Compiled with problems:\n    </div>\n    <button\n      aria-label=\"Dismiss\"\n      style=\"\n        color: rgb(255, 255, 255);\n        line-height: 1rem;\n        font-size: 1.5rem;\n        padding: 1rem;\n        cursor: pointer;\n        position: absolute;\n        right: 0px;\n        top: 0px;\n        background-color: transparent;\n        border: none;\n      \"\n    >\n      ×\n    </button>\n    <div>\n      <div\n        style=\"\n          background-color: rgba(251, 245, 180, 0.1);\n          color: rgb(251, 245, 180);\n          padding: 1rem 1rem 1.5rem;\n        \"\n      >\n        <div\n          style=\"\n            color: rgb(232, 59, 70);\n            font-size: 1.2em;\n            margin-bottom: 1rem;\n            font-family: sans-serif;\n          \"\n        >\n          WARNING\n        </div>\n        <div\n          style=\"\n            line-height: 1.5;\n            font-size: 1rem;\n            font-family: Menlo, Consolas, monospace;\n          \"\n        >\n          Warning from compilation\n        </div>\n      </div>\n    </div>\n  </div>\n</body>\n\"\n`;\n\nexports[`overlay should show a warning after invalidation: page html 1`] = `\n\"<body>\n  <h1>webpack-dev-server is running...</h1>\n  <script type=\"text/javascript\" charset=\"utf-8\" src=\"/main.js\"></script>\n\n  <iframe\n    id=\"webpack-dev-server-client-overlay\"\n    src=\"about:blank\"\n    style=\"\n      position: fixed;\n      inset: 0px;\n      width: 100vw;\n      height: 100vh;\n      border: none;\n      z-index: 2147483647;\n    \"\n  ></iframe>\n</body>\n\"\n`;\n\nexports[`overlay should show a warning and error for initial compilation and protects against xss: overlay html 1`] = `\n\"<body>\n  <div\n    id=\"webpack-dev-server-client-overlay-div\"\n    style=\"\n      position: fixed;\n      box-sizing: border-box;\n      inset: 0px;\n      width: 100vw;\n      height: 100vh;\n      font-size: large;\n      padding: 2rem 2rem 4rem;\n      line-height: 1.2;\n      white-space: pre-wrap;\n      overflow: auto;\n      background-color: rgba(0, 0, 0, 0.9);\n      color: white;\n    \"\n  >\n    <div\n      style=\"\n        color: rgb(232, 59, 70);\n        font-size: 2em;\n        white-space: pre-wrap;\n        font-family: sans-serif;\n        margin: 0px 2rem 2rem 0px;\n        flex: 0 0 auto;\n        max-height: 50%;\n        overflow: auto;\n      \"\n    >\n      Compiled with problems:\n    </div>\n    <button\n      aria-label=\"Dismiss\"\n      style=\"\n        color: rgb(255, 255, 255);\n        line-height: 1rem;\n        font-size: 1.5rem;\n        padding: 1rem;\n        cursor: pointer;\n        position: absolute;\n        right: 0px;\n        top: 0px;\n        background-color: transparent;\n        border: none;\n      \"\n    >\n      ×\n    </button>\n    <div>\n      <div\n        style=\"\n          background-color: rgba(206, 17, 38, 0.1);\n          color: rgb(252, 207, 207);\n          padding: 1rem 1rem 1.5rem;\n        \"\n      >\n        <div\n          style=\"\n            color: rgb(232, 59, 70);\n            font-size: 1.2em;\n            margin-bottom: 1rem;\n            font-family: sans-serif;\n          \"\n        >\n          ERROR\n        </div>\n        <div\n          style=\"\n            line-height: 1.5;\n            font-size: 1rem;\n            font-family: Menlo, Consolas, monospace;\n          \"\n        >\n          &lt;strong&gt;strong&lt;/strong&gt;\n        </div>\n      </div>\n      <div\n        style=\"\n          background-color: rgba(206, 17, 38, 0.1);\n          color: rgb(252, 207, 207);\n          padding: 1rem 1rem 1.5rem;\n        \"\n      >\n        <div\n          style=\"\n            color: rgb(232, 59, 70);\n            font-size: 1.2em;\n            margin-bottom: 1rem;\n            font-family: sans-serif;\n          \"\n        >\n          ERROR\n        </div>\n        <div\n          style=\"\n            line-height: 1.5;\n            font-size: 1rem;\n            font-family: Menlo, Consolas, monospace;\n          \"\n        >\n          &lt;strong&gt;strong&lt;/strong&gt;\n        </div>\n      </div>\n    </div>\n  </div>\n</body>\n\"\n`;\n\nexports[`overlay should show a warning and error for initial compilation and protects against xss: page html 1`] = `\n\"<body>\n  <h1>webpack-dev-server is running...</h1>\n  <script type=\"text/javascript\" charset=\"utf-8\" src=\"/main.js\"></script>\n\n  <iframe\n    id=\"webpack-dev-server-client-overlay\"\n    src=\"about:blank\"\n    style=\"\n      position: fixed;\n      inset: 0px;\n      width: 100vw;\n      height: 100vh;\n      border: none;\n      z-index: 2147483647;\n    \"\n  ></iframe>\n</body>\n\"\n`;\n\nexports[`overlay should show a warning and error for initial compilation: overlay html 1`] = `\n\"<body>\n  <div\n    id=\"webpack-dev-server-client-overlay-div\"\n    style=\"\n      position: fixed;\n      box-sizing: border-box;\n      inset: 0px;\n      width: 100vw;\n      height: 100vh;\n      font-size: large;\n      padding: 2rem 2rem 4rem;\n      line-height: 1.2;\n      white-space: pre-wrap;\n      overflow: auto;\n      background-color: rgba(0, 0, 0, 0.9);\n      color: white;\n    \"\n  >\n    <div\n      style=\"\n        color: rgb(232, 59, 70);\n        font-size: 2em;\n        white-space: pre-wrap;\n        font-family: sans-serif;\n        margin: 0px 2rem 2rem 0px;\n        flex: 0 0 auto;\n        max-height: 50%;\n        overflow: auto;\n      \"\n    >\n      Compiled with problems:\n    </div>\n    <button\n      aria-label=\"Dismiss\"\n      style=\"\n        color: rgb(255, 255, 255);\n        line-height: 1rem;\n        font-size: 1.5rem;\n        padding: 1rem;\n        cursor: pointer;\n        position: absolute;\n        right: 0px;\n        top: 0px;\n        background-color: transparent;\n        border: none;\n      \"\n    >\n      ×\n    </button>\n    <div>\n      <div\n        style=\"\n          background-color: rgba(206, 17, 38, 0.1);\n          color: rgb(252, 207, 207);\n          padding: 1rem 1rem 1.5rem;\n        \"\n      >\n        <div\n          style=\"\n            color: rgb(232, 59, 70);\n            font-size: 1.2em;\n            margin-bottom: 1rem;\n            font-family: sans-serif;\n          \"\n        >\n          ERROR\n        </div>\n        <div\n          style=\"\n            line-height: 1.5;\n            font-size: 1rem;\n            font-family: Menlo, Consolas, monospace;\n          \"\n        >\n          Warning from compilation\n        </div>\n      </div>\n      <div\n        style=\"\n          background-color: rgba(206, 17, 38, 0.1);\n          color: rgb(252, 207, 207);\n          padding: 1rem 1rem 1.5rem;\n        \"\n      >\n        <div\n          style=\"\n            color: rgb(232, 59, 70);\n            font-size: 1.2em;\n            margin-bottom: 1rem;\n            font-family: sans-serif;\n          \"\n        >\n          ERROR\n        </div>\n        <div\n          style=\"\n            line-height: 1.5;\n            font-size: 1rem;\n            font-family: Menlo, Consolas, monospace;\n          \"\n        >\n          Warning from compilation\n        </div>\n      </div>\n      <div\n        style=\"\n          background-color: rgba(206, 17, 38, 0.1);\n          color: rgb(252, 207, 207);\n          padding: 1rem 1rem 1.5rem;\n        \"\n      >\n        <div\n          style=\"\n            color: rgb(232, 59, 70);\n            font-size: 1.2em;\n            margin-bottom: 1rem;\n            font-family: sans-serif;\n          \"\n        >\n          ERROR\n        </div>\n        <div\n          style=\"\n            line-height: 1.5;\n            font-size: 1rem;\n            font-family: Menlo, Consolas, monospace;\n          \"\n        >\n          Error from compilation. Can't find 'test' module.\n        </div>\n      </div>\n      <div\n        style=\"\n          background-color: rgba(206, 17, 38, 0.1);\n          color: rgb(252, 207, 207);\n          padding: 1rem 1rem 1.5rem;\n        \"\n      >\n        <div\n          style=\"\n            color: rgb(232, 59, 70);\n            font-size: 1.2em;\n            margin-bottom: 1rem;\n            font-family: sans-serif;\n          \"\n        >\n          ERROR\n        </div>\n        <div\n          style=\"\n            line-height: 1.5;\n            font-size: 1rem;\n            font-family: Menlo, Consolas, monospace;\n          \"\n        >\n          Error from compilation. Can't find 'test' module.\n        </div>\n      </div>\n      <div\n        style=\"\n          background-color: rgba(206, 17, 38, 0.1);\n          color: rgb(252, 207, 207);\n          padding: 1rem 1rem 1.5rem;\n        \"\n      >\n        <div\n          style=\"\n            color: rgb(232, 59, 70);\n            font-size: 1.2em;\n            margin-bottom: 1rem;\n            font-family: sans-serif;\n          \"\n        >\n          ERROR\n        </div>\n        <div\n          style=\"\n            line-height: 1.5;\n            font-size: 1rem;\n            font-family: Menlo, Consolas, monospace;\n          \"\n        >\n          Error from compilation. Can't find 'test' module.\n        </div>\n      </div>\n    </div>\n  </div>\n</body>\n\"\n`;\n\nexports[`overlay should show a warning and error for initial compilation: page html 1`] = `\n\"<body>\n  <h1>webpack-dev-server is running...</h1>\n  <script type=\"text/javascript\" charset=\"utf-8\" src=\"/main.js\"></script>\n\n  <iframe\n    id=\"webpack-dev-server-client-overlay\"\n    src=\"about:blank\"\n    style=\"\n      position: fixed;\n      inset: 0px;\n      width: 100vw;\n      height: 100vh;\n      border: none;\n      z-index: 2147483647;\n    \"\n  ></iframe>\n</body>\n\"\n`;\n\nexports[`overlay should show a warning and hide them after closing connection: overlay html 1`] = `\n\"<body>\n  <div\n    id=\"webpack-dev-server-client-overlay-div\"\n    style=\"\n      position: fixed;\n      box-sizing: border-box;\n      inset: 0px;\n      width: 100vw;\n      height: 100vh;\n      font-size: large;\n      padding: 2rem 2rem 4rem;\n      line-height: 1.2;\n      white-space: pre-wrap;\n      overflow: auto;\n      background-color: rgba(0, 0, 0, 0.9);\n      color: white;\n    \"\n  >\n    <div\n      style=\"\n        color: rgb(232, 59, 70);\n        font-size: 2em;\n        white-space: pre-wrap;\n        font-family: sans-serif;\n        margin: 0px 2rem 2rem 0px;\n        flex: 0 0 auto;\n        max-height: 50%;\n        overflow: auto;\n      \"\n    >\n      Compiled with problems:\n    </div>\n    <button\n      aria-label=\"Dismiss\"\n      style=\"\n        color: rgb(255, 255, 255);\n        line-height: 1rem;\n        font-size: 1.5rem;\n        padding: 1rem;\n        cursor: pointer;\n        position: absolute;\n        right: 0px;\n        top: 0px;\n        background-color: transparent;\n        border: none;\n      \"\n    >\n      ×\n    </button>\n    <div>\n      <div\n        style=\"\n          background-color: rgba(251, 245, 180, 0.1);\n          color: rgb(251, 245, 180);\n          padding: 1rem 1rem 1.5rem;\n        \"\n      >\n        <div\n          style=\"\n            color: rgb(232, 59, 70);\n            font-size: 1.2em;\n            margin-bottom: 1rem;\n            font-family: sans-serif;\n          \"\n        >\n          WARNING\n        </div>\n        <div\n          style=\"\n            line-height: 1.5;\n            font-size: 1rem;\n            font-family: Menlo, Consolas, monospace;\n          \"\n        >\n          Warning from compilation\n        </div>\n      </div>\n    </div>\n  </div>\n</body>\n\"\n`;\n\nexports[`overlay should show a warning and hide them after closing connection: page html 1`] = `\n\"<body>\n  <h1>webpack-dev-server is running...</h1>\n  <script type=\"text/javascript\" charset=\"utf-8\" src=\"/main.js\"></script>\n\n  <iframe\n    id=\"webpack-dev-server-client-overlay\"\n    src=\"about:blank\"\n    style=\"\n      position: fixed;\n      inset: 0px;\n      width: 100vw;\n      height: 100vh;\n      border: none;\n      z-index: 2147483647;\n    \"\n  ></iframe>\n</body>\n\"\n`;\n\nexports[`overlay should show a warning and hide them after closing connection: page html 2`] = `\n\"<body>\n  <h1>webpack-dev-server is running...</h1>\n  <script type=\"text/javascript\" charset=\"utf-8\" src=\"/main.js\"></script>\n</body>\n\"\n`;\n\nexports[`overlay should show a warning for initial compilation: overlay html 1`] = `\n\"<body>\n  <div\n    id=\"webpack-dev-server-client-overlay-div\"\n    style=\"\n      position: fixed;\n      box-sizing: border-box;\n      inset: 0px;\n      width: 100vw;\n      height: 100vh;\n      font-size: large;\n      padding: 2rem 2rem 4rem;\n      line-height: 1.2;\n      white-space: pre-wrap;\n      overflow: auto;\n      background-color: rgba(0, 0, 0, 0.9);\n      color: white;\n    \"\n  >\n    <div\n      style=\"\n        color: rgb(232, 59, 70);\n        font-size: 2em;\n        white-space: pre-wrap;\n        font-family: sans-serif;\n        margin: 0px 2rem 2rem 0px;\n        flex: 0 0 auto;\n        max-height: 50%;\n        overflow: auto;\n      \"\n    >\n      Compiled with problems:\n    </div>\n    <button\n      aria-label=\"Dismiss\"\n      style=\"\n        color: rgb(255, 255, 255);\n        line-height: 1rem;\n        font-size: 1.5rem;\n        padding: 1rem;\n        cursor: pointer;\n        position: absolute;\n        right: 0px;\n        top: 0px;\n        background-color: transparent;\n        border: none;\n      \"\n    >\n      ×\n    </button>\n    <div>\n      <div\n        style=\"\n          background-color: rgba(251, 245, 180, 0.1);\n          color: rgb(251, 245, 180);\n          padding: 1rem 1rem 1.5rem;\n        \"\n      >\n        <div\n          style=\"\n            color: rgb(232, 59, 70);\n            font-size: 1.2em;\n            margin-bottom: 1rem;\n            font-family: sans-serif;\n          \"\n        >\n          WARNING\n        </div>\n        <div\n          style=\"\n            line-height: 1.5;\n            font-size: 1rem;\n            font-family: Menlo, Consolas, monospace;\n          \"\n        >\n          Warning from compilation\n        </div>\n      </div>\n    </div>\n  </div>\n</body>\n\"\n`;\n\nexports[`overlay should show a warning for initial compilation: page html 1`] = `\n\"<body>\n  <h1>webpack-dev-server is running...</h1>\n  <script type=\"text/javascript\" charset=\"utf-8\" src=\"/main.js\"></script>\n\n  <iframe\n    id=\"webpack-dev-server-client-overlay\"\n    src=\"about:blank\"\n    style=\"\n      position: fixed;\n      inset: 0px;\n      width: 100vw;\n      height: 100vh;\n      border: none;\n      z-index: 2147483647;\n    \"\n  ></iframe>\n</body>\n\"\n`;\n\nexports[`overlay should show a warning when \"client.overlay\" is \"true\": overlay html 1`] = `\n\"<body>\n  <div\n    id=\"webpack-dev-server-client-overlay-div\"\n    style=\"\n      position: fixed;\n      box-sizing: border-box;\n      inset: 0px;\n      width: 100vw;\n      height: 100vh;\n      font-size: large;\n      padding: 2rem 2rem 4rem;\n      line-height: 1.2;\n      white-space: pre-wrap;\n      overflow: auto;\n      background-color: rgba(0, 0, 0, 0.9);\n      color: white;\n    \"\n  >\n    <div\n      style=\"\n        color: rgb(232, 59, 70);\n        font-size: 2em;\n        white-space: pre-wrap;\n        font-family: sans-serif;\n        margin: 0px 2rem 2rem 0px;\n        flex: 0 0 auto;\n        max-height: 50%;\n        overflow: auto;\n      \"\n    >\n      Compiled with problems:\n    </div>\n    <button\n      aria-label=\"Dismiss\"\n      style=\"\n        color: rgb(255, 255, 255);\n        line-height: 1rem;\n        font-size: 1.5rem;\n        padding: 1rem;\n        cursor: pointer;\n        position: absolute;\n        right: 0px;\n        top: 0px;\n        background-color: transparent;\n        border: none;\n      \"\n    >\n      ×\n    </button>\n    <div>\n      <div\n        style=\"\n          background-color: rgba(251, 245, 180, 0.1);\n          color: rgb(251, 245, 180);\n          padding: 1rem 1rem 1.5rem;\n        \"\n      >\n        <div\n          style=\"\n            color: rgb(232, 59, 70);\n            font-size: 1.2em;\n            margin-bottom: 1rem;\n            font-family: sans-serif;\n          \"\n        >\n          WARNING\n        </div>\n        <div\n          style=\"\n            line-height: 1.5;\n            font-size: 1rem;\n            font-family: Menlo, Consolas, monospace;\n          \"\n        >\n          Warning from compilation\n        </div>\n      </div>\n    </div>\n  </div>\n</body>\n\"\n`;\n\nexports[`overlay should show a warning when \"client.overlay\" is \"true\": page html 1`] = `\n\"<body>\n  <h1>webpack-dev-server is running...</h1>\n  <script type=\"text/javascript\" charset=\"utf-8\" src=\"/main.js\"></script>\n\n  <iframe\n    id=\"webpack-dev-server-client-overlay\"\n    src=\"about:blank\"\n    style=\"\n      position: fixed;\n      inset: 0px;\n      width: 100vw;\n      height: 100vh;\n      border: none;\n      z-index: 2147483647;\n    \"\n  ></iframe>\n</body>\n\"\n`;\n\nexports[`overlay should show a warning when \"client.overlay.errors\" is \"true\": overlay html 1`] = `\n\"<body>\n  <div\n    id=\"webpack-dev-server-client-overlay-div\"\n    style=\"\n      position: fixed;\n      box-sizing: border-box;\n      inset: 0px;\n      width: 100vw;\n      height: 100vh;\n      font-size: large;\n      padding: 2rem 2rem 4rem;\n      line-height: 1.2;\n      white-space: pre-wrap;\n      overflow: auto;\n      background-color: rgba(0, 0, 0, 0.9);\n      color: white;\n    \"\n  >\n    <div\n      style=\"\n        color: rgb(232, 59, 70);\n        font-size: 2em;\n        white-space: pre-wrap;\n        font-family: sans-serif;\n        margin: 0px 2rem 2rem 0px;\n        flex: 0 0 auto;\n        max-height: 50%;\n        overflow: auto;\n      \"\n    >\n      Compiled with problems:\n    </div>\n    <button\n      aria-label=\"Dismiss\"\n      style=\"\n        color: rgb(255, 255, 255);\n        line-height: 1rem;\n        font-size: 1.5rem;\n        padding: 1rem;\n        cursor: pointer;\n        position: absolute;\n        right: 0px;\n        top: 0px;\n        background-color: transparent;\n        border: none;\n      \"\n    >\n      ×\n    </button>\n    <div>\n      <div\n        style=\"\n          background-color: rgba(251, 245, 180, 0.1);\n          color: rgb(251, 245, 180);\n          padding: 1rem 1rem 1.5rem;\n        \"\n      >\n        <div\n          style=\"\n            color: rgb(232, 59, 70);\n            font-size: 1.2em;\n            margin-bottom: 1rem;\n            font-family: sans-serif;\n          \"\n        >\n          WARNING\n        </div>\n        <div\n          style=\"\n            line-height: 1.5;\n            font-size: 1rem;\n            font-family: Menlo, Consolas, monospace;\n          \"\n        >\n          Warning from compilation\n        </div>\n      </div>\n    </div>\n  </div>\n</body>\n\"\n`;\n\nexports[`overlay should show a warning when \"client.overlay.errors\" is \"true\": page html 1`] = `\n\"<body>\n  <h1>webpack-dev-server is running...</h1>\n  <script type=\"text/javascript\" charset=\"utf-8\" src=\"/main.js\"></script>\n\n  <iframe\n    id=\"webpack-dev-server-client-overlay\"\n    src=\"about:blank\"\n    style=\"\n      position: fixed;\n      inset: 0px;\n      width: 100vw;\n      height: 100vh;\n      border: none;\n      z-index: 2147483647;\n    \"\n  ></iframe>\n</body>\n\"\n`;\n\nexports[`overlay should show a warning when \"client.overlay.warnings\" is \"true\": overlay html 1`] = `\n\"<body>\n  <div\n    id=\"webpack-dev-server-client-overlay-div\"\n    style=\"\n      position: fixed;\n      box-sizing: border-box;\n      inset: 0px;\n      width: 100vw;\n      height: 100vh;\n      font-size: large;\n      padding: 2rem 2rem 4rem;\n      line-height: 1.2;\n      white-space: pre-wrap;\n      overflow: auto;\n      background-color: rgba(0, 0, 0, 0.9);\n      color: white;\n    \"\n  >\n    <div\n      style=\"\n        color: rgb(232, 59, 70);\n        font-size: 2em;\n        white-space: pre-wrap;\n        font-family: sans-serif;\n        margin: 0px 2rem 2rem 0px;\n        flex: 0 0 auto;\n        max-height: 50%;\n        overflow: auto;\n      \"\n    >\n      Compiled with problems:\n    </div>\n    <button\n      aria-label=\"Dismiss\"\n      style=\"\n        color: rgb(255, 255, 255);\n        line-height: 1rem;\n        font-size: 1.5rem;\n        padding: 1rem;\n        cursor: pointer;\n        position: absolute;\n        right: 0px;\n        top: 0px;\n        background-color: transparent;\n        border: none;\n      \"\n    >\n      ×\n    </button>\n    <div>\n      <div\n        style=\"\n          background-color: rgba(251, 245, 180, 0.1);\n          color: rgb(251, 245, 180);\n          padding: 1rem 1rem 1.5rem;\n        \"\n      >\n        <div\n          style=\"\n            color: rgb(232, 59, 70);\n            font-size: 1.2em;\n            margin-bottom: 1rem;\n            font-family: sans-serif;\n          \"\n        >\n          WARNING\n        </div>\n        <div\n          style=\"\n            line-height: 1.5;\n            font-size: 1rem;\n            font-family: Menlo, Consolas, monospace;\n          \"\n        >\n          Warning from compilation\n        </div>\n      </div>\n    </div>\n  </div>\n</body>\n\"\n`;\n\nexports[`overlay should show a warning when \"client.overlay.warnings\" is \"true\": page html 1`] = `\n\"<body>\n  <h1>webpack-dev-server is running...</h1>\n  <script type=\"text/javascript\" charset=\"utf-8\" src=\"/main.js\"></script>\n\n  <iframe\n    id=\"webpack-dev-server-client-overlay\"\n    src=\"about:blank\"\n    style=\"\n      position: fixed;\n      inset: 0px;\n      width: 100vw;\n      height: 100vh;\n      border: none;\n      z-index: 2147483647;\n    \"\n  ></iframe>\n</body>\n\"\n`;\n\nexports[`overlay should show an ansi formatted error for initial compilation: overlay html 1`] = `\n\"<body>\n  <div\n    id=\"webpack-dev-server-client-overlay-div\"\n    style=\"\n      position: fixed;\n      box-sizing: border-box;\n      inset: 0px;\n      width: 100vw;\n      height: 100vh;\n      font-size: large;\n      padding: 2rem 2rem 4rem;\n      line-height: 1.2;\n      white-space: pre-wrap;\n      overflow: auto;\n      background-color: rgba(0, 0, 0, 0.9);\n      color: white;\n    \"\n  >\n    <div\n      style=\"\n        color: rgb(232, 59, 70);\n        font-size: 2em;\n        white-space: pre-wrap;\n        font-family: sans-serif;\n        margin: 0px 2rem 2rem 0px;\n        flex: 0 0 auto;\n        max-height: 50%;\n        overflow: auto;\n      \"\n    >\n      Compiled with problems:\n    </div>\n    <button\n      aria-label=\"Dismiss\"\n      style=\"\n        color: rgb(255, 255, 255);\n        line-height: 1rem;\n        font-size: 1.5rem;\n        padding: 1rem;\n        cursor: pointer;\n        position: absolute;\n        right: 0px;\n        top: 0px;\n        background-color: transparent;\n        border: none;\n      \"\n    >\n      ×\n    </button>\n    <div>\n      <div\n        style=\"\n          background-color: rgba(206, 17, 38, 0.1);\n          color: rgb(252, 207, 207);\n          padding: 1rem 1rem 1.5rem;\n        \"\n      >\n        <div\n          style=\"\n            color: rgb(232, 59, 70);\n            font-size: 1.2em;\n            margin-bottom: 1rem;\n            font-family: sans-serif;\n          \"\n        >\n          ERROR\n        </div>\n        <div\n          style=\"\n            line-height: 1.5;\n            font-size: 1rem;\n            font-family: Menlo, Consolas, monospace;\n          \"\n        >\n          <span\n            style=\"\n              font-weight: normal;\n              opacity: 1;\n              color: #transparent;\n              background: #transparent;\n            \"\n          >\n            <span style=\"color: #6d7891\"> 18 |</span>\n            <span style=\"color: #ffd080\">Render</span>\n            <span style=\"color: #ffd080\">ansi formatted text</span></span\n          >\n        </div>\n      </div>\n    </div>\n  </div>\n</body>\n\"\n`;\n\nexports[`overlay should show an ansi formatted error for initial compilation: page html 1`] = `\n\"<body>\n  <h1>webpack-dev-server is running...</h1>\n  <script type=\"text/javascript\" charset=\"utf-8\" src=\"/main.js\"></script>\n\n  <iframe\n    id=\"webpack-dev-server-client-overlay\"\n    src=\"about:blank\"\n    style=\"\n      position: fixed;\n      inset: 0px;\n      width: 100vw;\n      height: 100vh;\n      border: none;\n      z-index: 2147483647;\n    \"\n  ></iframe>\n</body>\n\"\n`;\n\nexports[`overlay should show an error after invalidation: overlay html 1`] = `\n\"<body>\n  <div\n    id=\"webpack-dev-server-client-overlay-div\"\n    style=\"\n      position: fixed;\n      box-sizing: border-box;\n      inset: 0px;\n      width: 100vw;\n      height: 100vh;\n      font-size: large;\n      padding: 2rem 2rem 4rem;\n      line-height: 1.2;\n      white-space: pre-wrap;\n      overflow: auto;\n      background-color: rgba(0, 0, 0, 0.9);\n      color: white;\n    \"\n  >\n    <div\n      style=\"\n        color: rgb(232, 59, 70);\n        font-size: 2em;\n        white-space: pre-wrap;\n        font-family: sans-serif;\n        margin: 0px 2rem 2rem 0px;\n        flex: 0 0 auto;\n        max-height: 50%;\n        overflow: auto;\n      \"\n    >\n      Compiled with problems:\n    </div>\n    <button\n      aria-label=\"Dismiss\"\n      style=\"\n        color: rgb(255, 255, 255);\n        line-height: 1rem;\n        font-size: 1.5rem;\n        padding: 1rem;\n        cursor: pointer;\n        position: absolute;\n        right: 0px;\n        top: 0px;\n        background-color: transparent;\n        border: none;\n      \"\n    >\n      ×\n    </button>\n    <div>\n      <div\n        style=\"\n          background-color: rgba(206, 17, 38, 0.1);\n          color: rgb(252, 207, 207);\n          padding: 1rem 1rem 1.5rem;\n        \"\n      >\n        <div\n          style=\"\n            color: rgb(232, 59, 70);\n            font-size: 1.2em;\n            margin-bottom: 1rem;\n            font-family: sans-serif;\n          \"\n        >\n          ERROR\n        </div>\n        <div\n          style=\"\n            line-height: 1.5;\n            font-size: 1rem;\n            font-family: Menlo, Consolas, monospace;\n          \"\n        >\n          Error from compilation\n        </div>\n      </div>\n    </div>\n  </div>\n</body>\n\"\n`;\n\nexports[`overlay should show an error after invalidation: page html 1`] = `\n\"<body>\n  <h1>webpack-dev-server is running...</h1>\n  <script type=\"text/javascript\" charset=\"utf-8\" src=\"/main.js\"></script>\n\n  <iframe\n    id=\"webpack-dev-server-client-overlay\"\n    src=\"about:blank\"\n    style=\"\n      position: fixed;\n      inset: 0px;\n      width: 100vw;\n      height: 100vh;\n      border: none;\n      z-index: 2147483647;\n    \"\n  ></iframe>\n</body>\n\"\n`;\n\nexports[`overlay should show an error for initial compilation: overlay html 1`] = `\n\"<body>\n  <div\n    id=\"webpack-dev-server-client-overlay-div\"\n    style=\"\n      position: fixed;\n      box-sizing: border-box;\n      inset: 0px;\n      width: 100vw;\n      height: 100vh;\n      font-size: large;\n      padding: 2rem 2rem 4rem;\n      line-height: 1.2;\n      white-space: pre-wrap;\n      overflow: auto;\n      background-color: rgba(0, 0, 0, 0.9);\n      color: white;\n    \"\n  >\n    <div\n      style=\"\n        color: rgb(232, 59, 70);\n        font-size: 2em;\n        white-space: pre-wrap;\n        font-family: sans-serif;\n        margin: 0px 2rem 2rem 0px;\n        flex: 0 0 auto;\n        max-height: 50%;\n        overflow: auto;\n      \"\n    >\n      Compiled with problems:\n    </div>\n    <button\n      aria-label=\"Dismiss\"\n      style=\"\n        color: rgb(255, 255, 255);\n        line-height: 1rem;\n        font-size: 1.5rem;\n        padding: 1rem;\n        cursor: pointer;\n        position: absolute;\n        right: 0px;\n        top: 0px;\n        background-color: transparent;\n        border: none;\n      \"\n    >\n      ×\n    </button>\n    <div>\n      <div\n        style=\"\n          background-color: rgba(206, 17, 38, 0.1);\n          color: rgb(252, 207, 207);\n          padding: 1rem 1rem 1.5rem;\n        \"\n      >\n        <div\n          style=\"\n            color: rgb(232, 59, 70);\n            font-size: 1.2em;\n            margin-bottom: 1rem;\n            font-family: sans-serif;\n          \"\n        >\n          ERROR\n        </div>\n        <div\n          style=\"\n            line-height: 1.5;\n            font-size: 1rem;\n            font-family: Menlo, Consolas, monospace;\n          \"\n        >\n          Error from compilation. Can't find 'test' module.\n        </div>\n      </div>\n    </div>\n  </div>\n</body>\n\"\n`;\n\nexports[`overlay should show an error for initial compilation: page html 1`] = `\n\"<body>\n  <h1>webpack-dev-server is running...</h1>\n  <script type=\"text/javascript\" charset=\"utf-8\" src=\"/main.js\"></script>\n\n  <iframe\n    id=\"webpack-dev-server-client-overlay\"\n    src=\"about:blank\"\n    style=\"\n      position: fixed;\n      inset: 0px;\n      width: 100vw;\n      height: 100vh;\n      border: none;\n      z-index: 2147483647;\n    \"\n  ></iframe>\n</body>\n\"\n`;\n\nexports[`overlay should show an error when \"client.overlay\" is \"true\": overlay html 1`] = `\n\"<body>\n  <div\n    id=\"webpack-dev-server-client-overlay-div\"\n    style=\"\n      position: fixed;\n      box-sizing: border-box;\n      inset: 0px;\n      width: 100vw;\n      height: 100vh;\n      font-size: large;\n      padding: 2rem 2rem 4rem;\n      line-height: 1.2;\n      white-space: pre-wrap;\n      overflow: auto;\n      background-color: rgba(0, 0, 0, 0.9);\n      color: white;\n    \"\n  >\n    <div\n      style=\"\n        color: rgb(232, 59, 70);\n        font-size: 2em;\n        white-space: pre-wrap;\n        font-family: sans-serif;\n        margin: 0px 2rem 2rem 0px;\n        flex: 0 0 auto;\n        max-height: 50%;\n        overflow: auto;\n      \"\n    >\n      Compiled with problems:\n    </div>\n    <button\n      aria-label=\"Dismiss\"\n      style=\"\n        color: rgb(255, 255, 255);\n        line-height: 1rem;\n        font-size: 1.5rem;\n        padding: 1rem;\n        cursor: pointer;\n        position: absolute;\n        right: 0px;\n        top: 0px;\n        background-color: transparent;\n        border: none;\n      \"\n    >\n      ×\n    </button>\n    <div>\n      <div\n        style=\"\n          background-color: rgba(206, 17, 38, 0.1);\n          color: rgb(252, 207, 207);\n          padding: 1rem 1rem 1.5rem;\n        \"\n      >\n        <div\n          style=\"\n            color: rgb(232, 59, 70);\n            font-size: 1.2em;\n            margin-bottom: 1rem;\n            font-family: sans-serif;\n          \"\n        >\n          ERROR\n        </div>\n        <div\n          style=\"\n            line-height: 1.5;\n            font-size: 1rem;\n            font-family: Menlo, Consolas, monospace;\n          \"\n        >\n          Error from compilation. Can't find 'test' module.\n        </div>\n      </div>\n    </div>\n  </div>\n</body>\n\"\n`;\n\nexports[`overlay should show an error when \"client.overlay\" is \"true\": page html 1`] = `\n\"<body>\n  <h1>webpack-dev-server is running...</h1>\n  <script type=\"text/javascript\" charset=\"utf-8\" src=\"/main.js\"></script>\n\n  <iframe\n    id=\"webpack-dev-server-client-overlay\"\n    src=\"about:blank\"\n    style=\"\n      position: fixed;\n      inset: 0px;\n      width: 100vw;\n      height: 100vh;\n      border: none;\n      z-index: 2147483647;\n    \"\n  ></iframe>\n</body>\n\"\n`;\n\nexports[`overlay should show an error when \"client.overlay.errors\" is \"true\": overlay html 1`] = `\n\"<body>\n  <div\n    id=\"webpack-dev-server-client-overlay-div\"\n    style=\"\n      position: fixed;\n      box-sizing: border-box;\n      inset: 0px;\n      width: 100vw;\n      height: 100vh;\n      font-size: large;\n      padding: 2rem 2rem 4rem;\n      line-height: 1.2;\n      white-space: pre-wrap;\n      overflow: auto;\n      background-color: rgba(0, 0, 0, 0.9);\n      color: white;\n    \"\n  >\n    <div\n      style=\"\n        color: rgb(232, 59, 70);\n        font-size: 2em;\n        white-space: pre-wrap;\n        font-family: sans-serif;\n        margin: 0px 2rem 2rem 0px;\n        flex: 0 0 auto;\n        max-height: 50%;\n        overflow: auto;\n      \"\n    >\n      Compiled with problems:\n    </div>\n    <button\n      aria-label=\"Dismiss\"\n      style=\"\n        color: rgb(255, 255, 255);\n        line-height: 1rem;\n        font-size: 1.5rem;\n        padding: 1rem;\n        cursor: pointer;\n        position: absolute;\n        right: 0px;\n        top: 0px;\n        background-color: transparent;\n        border: none;\n      \"\n    >\n      ×\n    </button>\n    <div>\n      <div\n        style=\"\n          background-color: rgba(206, 17, 38, 0.1);\n          color: rgb(252, 207, 207);\n          padding: 1rem 1rem 1.5rem;\n        \"\n      >\n        <div\n          style=\"\n            color: rgb(232, 59, 70);\n            font-size: 1.2em;\n            margin-bottom: 1rem;\n            font-family: sans-serif;\n          \"\n        >\n          ERROR\n        </div>\n        <div\n          style=\"\n            line-height: 1.5;\n            font-size: 1rem;\n            font-family: Menlo, Consolas, monospace;\n          \"\n        >\n          Error from compilation. Can't find 'test' module.\n        </div>\n      </div>\n    </div>\n  </div>\n</body>\n\"\n`;\n\nexports[`overlay should show an error when \"client.overlay.errors\" is \"true\": page html 1`] = `\n\"<body>\n  <h1>webpack-dev-server is running...</h1>\n  <script type=\"text/javascript\" charset=\"utf-8\" src=\"/main.js\"></script>\n\n  <iframe\n    id=\"webpack-dev-server-client-overlay\"\n    src=\"about:blank\"\n    style=\"\n      position: fixed;\n      inset: 0px;\n      width: 100vw;\n      height: 100vh;\n      border: none;\n      z-index: 2147483647;\n    \"\n  ></iframe>\n</body>\n\"\n`;\n\nexports[`overlay should show an error when \"client.overlay.warnings\" is \"true\": overlay html 1`] = `\n\"<body>\n  <div\n    id=\"webpack-dev-server-client-overlay-div\"\n    style=\"\n      position: fixed;\n      box-sizing: border-box;\n      inset: 0px;\n      width: 100vw;\n      height: 100vh;\n      font-size: large;\n      padding: 2rem 2rem 4rem;\n      line-height: 1.2;\n      white-space: pre-wrap;\n      overflow: auto;\n      background-color: rgba(0, 0, 0, 0.9);\n      color: white;\n    \"\n  >\n    <div\n      style=\"\n        color: rgb(232, 59, 70);\n        font-size: 2em;\n        white-space: pre-wrap;\n        font-family: sans-serif;\n        margin: 0px 2rem 2rem 0px;\n        flex: 0 0 auto;\n        max-height: 50%;\n        overflow: auto;\n      \"\n    >\n      Compiled with problems:\n    </div>\n    <button\n      aria-label=\"Dismiss\"\n      style=\"\n        color: rgb(255, 255, 255);\n        line-height: 1rem;\n        font-size: 1.5rem;\n        padding: 1rem;\n        cursor: pointer;\n        position: absolute;\n        right: 0px;\n        top: 0px;\n        background-color: transparent;\n        border: none;\n      \"\n    >\n      ×\n    </button>\n    <div>\n      <div\n        style=\"\n          background-color: rgba(251, 245, 180, 0.1);\n          color: rgb(251, 245, 180);\n          padding: 1rem 1rem 1.5rem;\n        \"\n      >\n        <div\n          style=\"\n            color: rgb(232, 59, 70);\n            font-size: 1.2em;\n            margin-bottom: 1rem;\n            font-family: sans-serif;\n          \"\n        >\n          WARNING\n        </div>\n        <div\n          style=\"\n            line-height: 1.5;\n            font-size: 1rem;\n            font-family: Menlo, Consolas, monospace;\n          \"\n        >\n          Warning from compilation\n        </div>\n      </div>\n    </div>\n  </div>\n</body>\n\"\n`;\n\nexports[`overlay should show an error when \"client.overlay.warnings\" is \"true\": page html 1`] = `\n\"<body>\n  <h1>webpack-dev-server is running...</h1>\n  <script type=\"text/javascript\" charset=\"utf-8\" src=\"/main.js\"></script>\n\n  <iframe\n    id=\"webpack-dev-server-client-overlay\"\n    src=\"about:blank\"\n    style=\"\n      position: fixed;\n      inset: 0px;\n      width: 100vw;\n      height: 100vh;\n      border: none;\n      z-index: 2147483647;\n    \"\n  ></iframe>\n</body>\n\"\n`;\n\nexports[`overlay should show error for uncaught promise rejection: overlay html 1`] = `\n\"<body>\n  <div\n    id=\"webpack-dev-server-client-overlay-div\"\n    style=\"\n      position: fixed;\n      box-sizing: border-box;\n      inset: 0px;\n      width: 100vw;\n      height: 100vh;\n      font-size: large;\n      padding: 2rem 2rem 4rem;\n      line-height: 1.2;\n      white-space: pre-wrap;\n      overflow: auto;\n      background-color: rgba(0, 0, 0, 0.9);\n      color: white;\n    \"\n  >\n    <div\n      style=\"\n        color: rgb(232, 59, 70);\n        font-size: 2em;\n        white-space: pre-wrap;\n        font-family: sans-serif;\n        margin: 0px 2rem 2rem 0px;\n        flex: 0 0 auto;\n        max-height: 50%;\n        overflow: auto;\n      \"\n    >\n      Uncaught runtime errors:\n    </div>\n    <button\n      aria-label=\"Dismiss\"\n      style=\"\n        color: rgb(255, 255, 255);\n        line-height: 1rem;\n        font-size: 1.5rem;\n        padding: 1rem;\n        cursor: pointer;\n        position: absolute;\n        right: 0px;\n        top: 0px;\n        background-color: transparent;\n        border: none;\n      \"\n    >\n      ×\n    </button>\n    <div>\n      <div\n        style=\"\n          background-color: rgba(206, 17, 38, 0.1);\n          color: rgb(252, 207, 207);\n          padding: 1rem 1rem 1.5rem;\n        \"\n      >\n        <div\n          style=\"\n            color: rgb(232, 59, 70);\n            font-size: 1.2em;\n            margin-bottom: 1rem;\n            font-family: sans-serif;\n          \"\n        >\n          ERROR\n        </div>\n        <div\n          style=\"\n            line-height: 1.5;\n            font-size: 1rem;\n            font-family: Menlo, Consolas, monospace;\n          \"\n        >\n          Async error at &lt;anonymous&gt;:3:26\n        </div>\n      </div>\n    </div>\n  </div>\n</body>\n\"\n`;\n\nexports[`overlay should show error for uncaught runtime error: overlay html 1`] = `\n\"<body>\n  <div\n    id=\"webpack-dev-server-client-overlay-div\"\n    style=\"\n      position: fixed;\n      box-sizing: border-box;\n      inset: 0px;\n      width: 100vw;\n      height: 100vh;\n      font-size: large;\n      padding: 2rem 2rem 4rem;\n      line-height: 1.2;\n      white-space: pre-wrap;\n      overflow: auto;\n      background-color: rgba(0, 0, 0, 0.9);\n      color: white;\n    \"\n  >\n    <div\n      style=\"\n        color: rgb(232, 59, 70);\n        font-size: 2em;\n        white-space: pre-wrap;\n        font-family: sans-serif;\n        margin: 0px 2rem 2rem 0px;\n        flex: 0 0 auto;\n        max-height: 50%;\n        overflow: auto;\n      \"\n    >\n      Uncaught runtime errors:\n    </div>\n    <button\n      aria-label=\"Dismiss\"\n      style=\"\n        color: rgb(255, 255, 255);\n        line-height: 1rem;\n        font-size: 1.5rem;\n        padding: 1rem;\n        cursor: pointer;\n        position: absolute;\n        right: 0px;\n        top: 0px;\n        background-color: transparent;\n        border: none;\n      \"\n    >\n      ×\n    </button>\n    <div>\n      <div\n        style=\"\n          background-color: rgba(206, 17, 38, 0.1);\n          color: rgb(252, 207, 207);\n          padding: 1rem 1rem 1.5rem;\n        \"\n      >\n        <div\n          style=\"\n            color: rgb(232, 59, 70);\n            font-size: 1.2em;\n            margin-bottom: 1rem;\n            font-family: sans-serif;\n          \"\n        >\n          ERROR\n        </div>\n        <div\n          style=\"\n            line-height: 1.5;\n            font-size: 1rem;\n            font-family: Menlo, Consolas, monospace;\n          \"\n        >\n          Injected error at throwError (&lt;anonymous&gt;:2:15) at\n          &lt;anonymous&gt;:3:9\n        </div>\n      </div>\n    </div>\n  </div>\n</body>\n\"\n`;\n\nexports[`overlay should show error when it is not filtered: overlay html 1`] = `\n\"<body>\n  <div\n    id=\"webpack-dev-server-client-overlay-div\"\n    style=\"\n      position: fixed;\n      box-sizing: border-box;\n      inset: 0px;\n      width: 100vw;\n      height: 100vh;\n      font-size: large;\n      padding: 2rem 2rem 4rem;\n      line-height: 1.2;\n      white-space: pre-wrap;\n      overflow: auto;\n      background-color: rgba(0, 0, 0, 0.9);\n      color: white;\n    \"\n  >\n    <div\n      style=\"\n        color: rgb(232, 59, 70);\n        font-size: 2em;\n        white-space: pre-wrap;\n        font-family: sans-serif;\n        margin: 0px 2rem 2rem 0px;\n        flex: 0 0 auto;\n        max-height: 50%;\n        overflow: auto;\n      \"\n    >\n      Compiled with problems:\n    </div>\n    <button\n      aria-label=\"Dismiss\"\n      style=\"\n        color: rgb(255, 255, 255);\n        line-height: 1rem;\n        font-size: 1.5rem;\n        padding: 1rem;\n        cursor: pointer;\n        position: absolute;\n        right: 0px;\n        top: 0px;\n        background-color: transparent;\n        border: none;\n      \"\n    >\n      ×\n    </button>\n    <div>\n      <div\n        style=\"\n          background-color: rgba(206, 17, 38, 0.1);\n          color: rgb(252, 207, 207);\n          padding: 1rem 1rem 1.5rem;\n        \"\n      >\n        <div\n          style=\"\n            color: rgb(232, 59, 70);\n            font-size: 1.2em;\n            margin-bottom: 1rem;\n            font-family: sans-serif;\n          \"\n        >\n          ERROR\n        </div>\n        <div\n          style=\"\n            line-height: 1.5;\n            font-size: 1rem;\n            font-family: Menlo, Consolas, monospace;\n          \"\n        >\n          Unfiltered error\n        </div>\n      </div>\n    </div>\n  </div>\n</body>\n\"\n`;\n\nexports[`overlay should show error when it is not filtered: page html 1`] = `\n\"<body>\n  <h1>webpack-dev-server is running...</h1>\n  <script type=\"text/javascript\" charset=\"utf-8\" src=\"/main.js\"></script>\n\n  <iframe\n    id=\"webpack-dev-server-client-overlay\"\n    src=\"about:blank\"\n    style=\"\n      position: fixed;\n      inset: 0px;\n      width: 100vw;\n      height: 100vh;\n      border: none;\n      z-index: 2147483647;\n    \"\n  ></iframe>\n</body>\n\"\n`;\n\nexports[`overlay should show overlay when \"Content-Security-Policy\" is \"default-src 'self'\" was used: overlay html 1`] = `\n\"<body>\n  <div\n    id=\"webpack-dev-server-client-overlay-div\"\n    style=\"\n      position: fixed;\n      box-sizing: border-box;\n      inset: 0px;\n      width: 100vw;\n      height: 100vh;\n      font-size: large;\n      padding: 2rem 2rem 4rem;\n      line-height: 1.2;\n      white-space: pre-wrap;\n      overflow: auto;\n      background-color: rgba(0, 0, 0, 0.9);\n      color: white;\n    \"\n  >\n    <div\n      style=\"\n        color: rgb(232, 59, 70);\n        font-size: 2em;\n        white-space: pre-wrap;\n        font-family: sans-serif;\n        margin: 0px 2rem 2rem 0px;\n        flex: 0 0 auto;\n        max-height: 50%;\n        overflow: auto;\n      \"\n    >\n      Compiled with problems:\n    </div>\n    <button\n      aria-label=\"Dismiss\"\n      style=\"\n        color: rgb(255, 255, 255);\n        line-height: 1rem;\n        font-size: 1.5rem;\n        padding: 1rem;\n        cursor: pointer;\n        position: absolute;\n        right: 0px;\n        top: 0px;\n        background-color: transparent;\n        border: none;\n      \"\n    >\n      X\n    </button>\n    <div>\n      <div\n        style=\"\n          background-color: rgba(206, 17, 38, 0.1);\n          color: rgb(252, 207, 207);\n          padding: 1rem 1rem 1.5rem;\n        \"\n      >\n        <div\n          style=\"\n            color: rgb(232, 59, 70);\n            font-size: 1.2em;\n            margin-bottom: 1rem;\n            font-family: sans-serif;\n          \"\n        >\n          ERROR\n        </div>\n        <div\n          style=\"\n            line-height: 1.5;\n            font-size: 1rem;\n            font-family: Menlo, Consolas, monospace;\n          \"\n        >\n          Error from compilation. Can't find 'test' module.\n        </div>\n      </div>\n    </div>\n  </div>\n</body>\n\"\n`;\n\nexports[`overlay should show overlay when \"Content-Security-Policy\" is \"default-src 'self'\" was used: page html 1`] = `\n\"<body>\n  <h1>webpack-dev-server is running...</h1>\n  <script type=\"text/javascript\" charset=\"utf-8\" src=\"/main.js\"></script>\n\n  <iframe\n    id=\"webpack-dev-server-client-overlay\"\n    src=\"about:blank\"\n    style=\"\n      position: fixed;\n      inset: 0px;\n      width: 100vw;\n      height: 100vh;\n      border: none;\n      z-index: 2147483647;\n    \"\n  ></iframe>\n</body>\n\"\n`;\n\nexports[`overlay should show overlay when Trusted Types are enabled and the \"require-trusted-types-for 'script'\" header was used: overlay html 1`] = `\n\"<body>\n  <div\n    id=\"webpack-dev-server-client-overlay-div\"\n    style=\"\n      position: fixed;\n      box-sizing: border-box;\n      inset: 0px;\n      width: 100vw;\n      height: 100vh;\n      font-size: large;\n      padding: 2rem 2rem 4rem;\n      line-height: 1.2;\n      white-space: pre-wrap;\n      overflow: auto;\n      background-color: rgba(0, 0, 0, 0.9);\n      color: white;\n    \"\n  >\n    <div\n      style=\"\n        color: rgb(232, 59, 70);\n        font-size: 2em;\n        white-space: pre-wrap;\n        font-family: sans-serif;\n        margin: 0px 2rem 2rem 0px;\n        flex: 0 0 auto;\n        max-height: 50%;\n        overflow: auto;\n      \"\n    >\n      Compiled with problems:\n    </div>\n    <button\n      aria-label=\"Dismiss\"\n      style=\"\n        color: rgb(255, 255, 255);\n        line-height: 1rem;\n        font-size: 1.5rem;\n        padding: 1rem;\n        cursor: pointer;\n        position: absolute;\n        right: 0px;\n        top: 0px;\n        background-color: transparent;\n        border: none;\n      \"\n    >\n      ×\n    </button>\n    <div>\n      <div\n        style=\"\n          background-color: rgba(206, 17, 38, 0.1);\n          color: rgb(252, 207, 207);\n          padding: 1rem 1rem 1.5rem;\n        \"\n      >\n        <div\n          style=\"\n            color: rgb(232, 59, 70);\n            font-size: 1.2em;\n            margin-bottom: 1rem;\n            font-family: sans-serif;\n          \"\n        >\n          ERROR\n        </div>\n        <div\n          style=\"\n            line-height: 1.5;\n            font-size: 1rem;\n            font-family: Menlo, Consolas, monospace;\n          \"\n        >\n          Error from compilation. Can't find 'test' module.\n        </div>\n      </div>\n    </div>\n  </div>\n</body>\n\"\n`;\n\nexports[`overlay should show overlay when Trusted Types are enabled and the \"require-trusted-types-for 'script'\" header was used: page html 1`] = `\n\"<body>\n  <h1>webpack-dev-server is running...</h1>\n  <script type=\"text/javascript\" charset=\"utf-8\" src=\"/main.js\"></script>\n\n  <iframe\n    id=\"webpack-dev-server-client-overlay\"\n    src=\"about:blank\"\n    style=\"\n      position: fixed;\n      inset: 0px;\n      width: 100vw;\n      height: 100vh;\n      border: none;\n      z-index: 2147483647;\n    \"\n  ></iframe>\n</body>\n\"\n`;\n\nexports[`overlay should show overlay when Trusted Types are enabled: overlay html 1`] = `\n\"<body>\n  <div\n    id=\"webpack-dev-server-client-overlay-div\"\n    style=\"\n      position: fixed;\n      box-sizing: border-box;\n      inset: 0px;\n      width: 100vw;\n      height: 100vh;\n      font-size: large;\n      padding: 2rem 2rem 4rem;\n      line-height: 1.2;\n      white-space: pre-wrap;\n      overflow: auto;\n      background-color: rgba(0, 0, 0, 0.9);\n      color: white;\n    \"\n  >\n    <div\n      style=\"\n        color: rgb(232, 59, 70);\n        font-size: 2em;\n        white-space: pre-wrap;\n        font-family: sans-serif;\n        margin: 0px 2rem 2rem 0px;\n        flex: 0 0 auto;\n        max-height: 50%;\n        overflow: auto;\n      \"\n    >\n      Compiled with problems:\n    </div>\n    <button\n      aria-label=\"Dismiss\"\n      style=\"\n        color: rgb(255, 255, 255);\n        line-height: 1rem;\n        font-size: 1.5rem;\n        padding: 1rem;\n        cursor: pointer;\n        position: absolute;\n        right: 0px;\n        top: 0px;\n        background-color: transparent;\n        border: none;\n      \"\n    >\n      ×\n    </button>\n    <div>\n      <div\n        style=\"\n          background-color: rgba(206, 17, 38, 0.1);\n          color: rgb(252, 207, 207);\n          padding: 1rem 1rem 1.5rem;\n        \"\n      >\n        <div\n          style=\"\n            color: rgb(232, 59, 70);\n            font-size: 1.2em;\n            margin-bottom: 1rem;\n            font-family: sans-serif;\n          \"\n        >\n          ERROR\n        </div>\n        <div\n          style=\"\n            line-height: 1.5;\n            font-size: 1rem;\n            font-family: Menlo, Consolas, monospace;\n          \"\n        >\n          Error from compilation. Can't find 'test' module.\n        </div>\n      </div>\n    </div>\n  </div>\n</body>\n\"\n`;\n\nexports[`overlay should show overlay when Trusted Types are enabled: page html 1`] = `\n\"<body>\n  <h1>webpack-dev-server is running...</h1>\n  <script type=\"text/javascript\" charset=\"utf-8\" src=\"/main.js\"></script>\n\n  <iframe\n    id=\"webpack-dev-server-client-overlay\"\n    src=\"about:blank\"\n    style=\"\n      position: fixed;\n      inset: 0px;\n      width: 100vw;\n      height: 100vh;\n      border: none;\n      z-index: 2147483647;\n    \"\n  ></iframe>\n</body>\n\"\n`;\n\nexports[`overlay should show warning when it is not filtered: overlay html 1`] = `\n\"<body>\n  <div\n    id=\"webpack-dev-server-client-overlay-div\"\n    style=\"\n      position: fixed;\n      box-sizing: border-box;\n      inset: 0px;\n      width: 100vw;\n      height: 100vh;\n      font-size: large;\n      padding: 2rem 2rem 4rem;\n      line-height: 1.2;\n      white-space: pre-wrap;\n      overflow: auto;\n      background-color: rgba(0, 0, 0, 0.9);\n      color: white;\n    \"\n  >\n    <div\n      style=\"\n        color: rgb(232, 59, 70);\n        font-size: 2em;\n        white-space: pre-wrap;\n        font-family: sans-serif;\n        margin: 0px 2rem 2rem 0px;\n        flex: 0 0 auto;\n        max-height: 50%;\n        overflow: auto;\n      \"\n    >\n      Compiled with problems:\n    </div>\n    <button\n      aria-label=\"Dismiss\"\n      style=\"\n        color: rgb(255, 255, 255);\n        line-height: 1rem;\n        font-size: 1.5rem;\n        padding: 1rem;\n        cursor: pointer;\n        position: absolute;\n        right: 0px;\n        top: 0px;\n        background-color: transparent;\n        border: none;\n      \"\n    >\n      ×\n    </button>\n    <div>\n      <div\n        style=\"\n          background-color: rgba(251, 245, 180, 0.1);\n          color: rgb(251, 245, 180);\n          padding: 1rem 1rem 1.5rem;\n        \"\n      >\n        <div\n          style=\"\n            color: rgb(232, 59, 70);\n            font-size: 1.2em;\n            margin-bottom: 1rem;\n            font-family: sans-serif;\n          \"\n        >\n          WARNING\n        </div>\n        <div\n          style=\"\n            line-height: 1.5;\n            font-size: 1rem;\n            font-family: Menlo, Consolas, monospace;\n          \"\n        >\n          Unfiltered warning\n        </div>\n      </div>\n    </div>\n  </div>\n</body>\n\"\n`;\n\nexports[`overlay should show warning when it is not filtered: page html 1`] = `\n\"<body>\n  <h1>webpack-dev-server is running...</h1>\n  <script type=\"text/javascript\" charset=\"utf-8\" src=\"/main.js\"></script>\n\n  <iframe\n    id=\"webpack-dev-server-client-overlay\"\n    src=\"about:blank\"\n    style=\"\n      position: fixed;\n      inset: 0px;\n      width: 100vw;\n      height: 100vh;\n      border: none;\n      z-index: 2147483647;\n    \"\n  ></iframe>\n</body>\n\"\n`;\n"
  },
  {
    "path": "test/e2e/__snapshots__/port.test.js.snap.webpack5",
    "content": "// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing\n\nexports[`port should work using \"<not-specified>\" port : console messages 1`] = `\n[\n  \"[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.\",\n  \"[HMR] Waiting for update signal from WDS...\",\n  \"Hey.\",\n]\n`;\n\nexports[`port should work using \"<not-specified>\" port : page errors 1`] = `[]`;\n\nexports[`port should work using \"0\" port : console messages 1`] = `\n[\n  \"[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.\",\n  \"[HMR] Waiting for update signal from WDS...\",\n  \"Hey.\",\n]\n`;\n\nexports[`port should work using \"0\" port : page errors 1`] = `[]`;\n\nexports[`port should work using \"8161\" port : console messages 1`] = `\n[\n  \"[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.\",\n  \"[HMR] Waiting for update signal from WDS...\",\n  \"Hey.\",\n]\n`;\n\nexports[`port should work using \"8161\" port : console messages 2`] = `\n[\n  \"[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.\",\n  \"[HMR] Waiting for update signal from WDS...\",\n  \"Hey.\",\n]\n`;\n\nexports[`port should work using \"8161\" port : page errors 1`] = `[]`;\n\nexports[`port should work using \"8161\" port : page errors 2`] = `[]`;\n\nexports[`port should work using \"auto\" port : console messages 1`] = `\n[\n  \"[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.\",\n  \"[HMR] Waiting for update signal from WDS...\",\n  \"Hey.\",\n]\n`;\n\nexports[`port should work using \"auto\" port : page errors 1`] = `[]`;\n\nexports[`port should work using \"undefined\" port : console messages 1`] = `\n[\n  \"[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.\",\n  \"[HMR] Waiting for update signal from WDS...\",\n  \"Hey.\",\n]\n`;\n\nexports[`port should work using \"undefined\" port : page errors 1`] = `[]`;\n"
  },
  {
    "path": "test/e2e/__snapshots__/server-and-client-transport.test.js.snap.webpack5",
    "content": "// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing\n\nexports[`server and client transport should throw an error on invalid path to client transport 1`] = `\"client.webSocketTransport must be a string denoting a default implementation (e.g. 'sockjs', 'ws') or a full path to a JS file via require.resolve(...) which exports a class \"`;\n\nexports[`server and client transport should throw an error on invalid path to server transport 1`] = `\"webSocketServer (webSocketServer.type) must be a string denoting a default implementation (e.g. 'ws', 'sockjs'), a full path to a JS file which exports a class extending BaseServer (webpack-dev-server/lib/servers/BaseServer.js) via require.resolve(...), or the class itself which extends BaseServer\"`;\n\nexports[`server and client transport should throw an error on wrong path 1`] = `\"webSocketServer (webSocketServer.type) must be a string denoting a default implementation (e.g. 'ws', 'sockjs'), a full path to a JS file which exports a class extending BaseServer (webpack-dev-server/lib/servers/BaseServer.js) via require.resolve(...), or the class itself which extends BaseServer\"`;\n\nexports[`server and client transport should use \"sockjs\" transport and \"sockjs\" web socket server 1`] = `\n[\n  \"[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.\",\n  \"[HMR] Waiting for update signal from WDS...\",\n]\n`;\n\nexports[`server and client transport should use \"sockjs\" transport, when web socket server is not specify 1`] = `[]`;\n\nexports[`server and client transport should use \"sockjs\" web socket server when specify \"sockjs\" value 1`] = `\n[\n  \"[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.\",\n  \"[HMR] Waiting for update signal from WDS...\",\n]\n`;\n\nexports[`server and client transport should use \"sockjs\" web socket server when specify \"sockjs\" value using object 1`] = `\n[\n  \"[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.\",\n  \"[HMR] Waiting for update signal from WDS...\",\n]\n`;\n\nexports[`server and client transport should use \"ws\" transport and \"ws\" web socket server 1`] = `\n[\n  \"[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.\",\n  \"[HMR] Waiting for update signal from WDS...\",\n]\n`;\n\nexports[`server and client transport should use \"ws\" transport, when web socket server is not specify 1`] = `\n[\n  \"[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.\",\n  \"[HMR] Waiting for update signal from WDS...\",\n]\n`;\n\nexports[`server and client transport should use \"ws\" web socket server when specify \"ws\" value 1`] = `\n[\n  \"[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.\",\n  \"[HMR] Waiting for update signal from WDS...\",\n]\n`;\n\nexports[`server and client transport should use \"ws\" web socket server when specify \"ws\" value using object 1`] = `\n[\n  \"[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.\",\n  \"[HMR] Waiting for update signal from WDS...\",\n]\n`;\n\nexports[`server and client transport should use custom transport and \"sockjs\" web socket server 1`] = `\n[\n  \"[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.\",\n  \"[HMR] Waiting for update signal from WDS...\",\n  \"open\",\n  \"hot\",\n  \"liveReload\",\n  \"reconnect\",\n  \"overlay\",\n  \"hash\",\n  \"ok\",\n]\n`;\n\nexports[`server and client transport should use custom web socket server when specify class 1`] = `\n[\n  \"[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.\",\n  \"[HMR] Waiting for update signal from WDS...\",\n]\n`;\n\nexports[`server and client transport should use custom web socket server when specify class using object 1`] = `\n[\n  \"[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.\",\n  \"[HMR] Waiting for update signal from WDS...\",\n]\n`;\n\nexports[`server and client transport should use custom web socket server when specify path to class 1`] = `\n[\n  \"[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.\",\n  \"[HMR] Waiting for update signal from WDS...\",\n]\n`;\n\nexports[`server and client transport should use custom web socket server when specify path to class using object 1`] = `\n[\n  \"[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.\",\n  \"[HMR] Waiting for update signal from WDS...\",\n]\n`;\n\nexports[`server and client transport should use default web socket server (\"ws\") 1`] = `\n[\n  \"[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.\",\n  \"[HMR] Waiting for update signal from WDS...\",\n]\n`;\n"
  },
  {
    "path": "test/e2e/__snapshots__/server.test.js.snap.webpack5",
    "content": "// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing\n\nexports[`server option as object allow to pass more options should handle GET request to index route (/): console messages 1`] = `[]`;\n\nexports[`server option as object allow to pass more options should handle GET request to index route (/): https options 1`] = `\n{\n  \"ca\": \"<Buffer>\",\n  \"cert\": \"<Buffer>\",\n  \"key\": \"<Buffer>\",\n  \"minVersion\": \"TLSv1.1\",\n  \"passphrase\": \"webpack-dev-server\",\n  \"pfx\": \"<Buffer>\",\n  \"requestCert\": false,\n}\n`;\n\nexports[`server option as object allow to pass more options should handle GET request to index route (/): page errors 1`] = `[]`;\n\nexports[`server option as object allow to pass more options should handle GET request to index route (/): response status 1`] = `200`;\n\nexports[`server option as object allow to pass more options should handle GET request to index route (/): response text 1`] = `\n\"Heyo.\n\"\n`;\n\nexports[`server option as object ca, pfx, key and cert are array of buffers should handle GET request to index route (/): console messages 1`] = `[]`;\n\nexports[`server option as object ca, pfx, key and cert are array of buffers should handle GET request to index route (/): https options 1`] = `\n{\n  \"ca\": [\n    \"<Buffer>\",\n  ],\n  \"cert\": [\n    \"<Buffer>\",\n  ],\n  \"key\": [\n    \"<Buffer>\",\n  ],\n  \"passphrase\": \"webpack-dev-server\",\n  \"pfx\": [\n    \"<Buffer>\",\n  ],\n  \"requestCert\": false,\n}\n`;\n\nexports[`server option as object ca, pfx, key and cert are array of buffers should handle GET request to index route (/): page errors 1`] = `[]`;\n\nexports[`server option as object ca, pfx, key and cert are array of buffers should handle GET request to index route (/): response status 1`] = `200`;\n\nexports[`server option as object ca, pfx, key and cert are array of buffers should handle GET request to index route (/): response text 1`] = `\n\"Heyo.\n\"\n`;\n\nexports[`server option as object ca, pfx, key and cert are array of paths to files should handle GET request to index route (/): console messages 1`] = `[]`;\n\nexports[`server option as object ca, pfx, key and cert are array of paths to files should handle GET request to index route (/): https options 1`] = `\n{\n  \"ca\": [\n    \"<Buffer>\",\n  ],\n  \"cert\": [\n    \"<Buffer>\",\n  ],\n  \"key\": [\n    \"<Buffer>\",\n  ],\n  \"passphrase\": \"webpack-dev-server\",\n  \"pfx\": [\n    \"<Buffer>\",\n  ],\n  \"requestCert\": false,\n}\n`;\n\nexports[`server option as object ca, pfx, key and cert are array of paths to files should handle GET request to index route (/): page errors 1`] = `[]`;\n\nexports[`server option as object ca, pfx, key and cert are array of paths to files should handle GET request to index route (/): response status 1`] = `200`;\n\nexports[`server option as object ca, pfx, key and cert are array of paths to files should handle GET request to index route (/): response text 1`] = `\n\"Heyo.\n\"\n`;\n\nexports[`server option as object ca, pfx, key and cert are array of strings should handle GET request to index route (/): console messages 1`] = `[]`;\n\nexports[`server option as object ca, pfx, key and cert are array of strings should handle GET request to index route (/): https options 1`] = `\n{\n  \"ca\": [\n    \"-----BEGIN RSA PRIVATE KEY-----\nMIIEpQIBAAKCAQEAxAUVLFM+K3XDLQkBi7xt0s1Ip7JoHYDskzUDQNHjjMkUq5kv\nC/hf5Ei1J6qruJs3Xqg86Nl4+ed4ynUajAkRRibhp0P1SG1tgPssIK6iC7g8heYu\nDy9WkFuMie0513zjSn6bMEAK5TegxYAWCbaCZX/Fw9bDniabL/zuOv4sf8J4EPhs\nEENnH6sUE9HxPUgQmNt1Tbd0j1Cd5PXrSTLyfVPRh0m9QhXTUHuxsse8XSn9U2sw\nduxJTWRINmhffYn+O7kbJGI77xYr8u58Rsf3HCMI8DTKZNvQLChvvtLJ9ckyu7Q+\nT8emgklStASm3V2UtnriaK/IQEhgSdxqVRib3QIDAQABAoIBAGqWKPE1QnT3T+3J\nG+ITz9P0dDFbvWltlTZmeSJh/s2q+WZloUNtBxdmwbqT/1QecnkyGgyzVCjvSKsu\nCgVjWNVAhysgtNtxRT4BVflffBXLVH2qsBjpsLRGU6EcMXuPGTiEp3YRHNuO6Aj8\noP8fEsCGPc9DlJMGgxQRAKlrVF8TN/0j6Qk+YpS4MZ0YFQfBY+WdKu04Z8TVTplQ\ntTkiGpBI+Oj85jF59aQiizglJgADkAZ6zmbrctm/G9jPxh7JLS2cKI0ECZgK5yAc\npk10E1YWhoCksjr9arxy6fS9TiX9P15vv06k+s7c4c5X7XDm3X0GWeSbqBMJb8q7\nBhZQNzECgYEA4kAtymDBvFYiZFq7+lzQBRKAI1RCq7YqxlieumH0PSkie2bba3dW\nNVdTi7at8+GDB9/cHUPKzg/skfJllek57MZmusiVwB/Lmp/IlW8YyGShdYZ7zQsV\nKMWJljpky3BEDM5sb08wIkfrOkelI/S4Bqqabd9JzOMJzoTiVOlMam8CgYEA3ctN\nyonWz2bsnCUstQvQCLdI5a8Q7GJvlH2awephxGXIKGUuRmyyop0AnRnIBEWtOQV7\nyZjW32bU+Wt+2BJ247EyJiIQ4gT+T51t+v/Wt1YNbL3dSj9ttOvwYd4H2W4E7EIO\nGKIF4I39FM7r8NfG7YE7S1aVcnrqs01N3nhd9HMCgYEAjepbzpmqbAxLPk97oase\nAFB+d6qetz5ozklAJwDSRprKukTmVR5hwMup5/UKX/OQURwl4WVojKCIb3NwLPxC\nDTbVsUuoQv6uo6qeEr3A+dHFRQa6GP9eolhl2Ql/t+wPg0jn01oEgzxBXCkceNVD\nqUrR2yE4FYBD4nqPzVsZR5kCgYEA1yTi7NkQeldIpZ6Z43T18753A/Xx4JsLyWqd\nuAT3mV9x7V1Yqg++qGbLtZjQoPRFt85N6ZxMsqA5b0iK3mXq1auJDdx1rAlT9z6q\n9JM/YNAkbZsvEVq9vIYxw31w98T1GYhpzBM+yDhzir+9tv5YhQKa1dXDWi1JhWwz\nYN45pWkCgYEAxuVsJ4D4Th5o050ppWpnxM/WuMhIUKqaoFTVucMKFzn+g24y9pv5\nmiYdNYIk4Y+4pzHG6ZGZSHJcQ9BLui6H/nLQnqkgCb2lT5nfp7/GKdus7BdcjPGs\nfcV46yL7/X0m8nDb3hkwwrDTU4mKFkMrzKpjdZBsttEmW0Aw/3y36gU=\n-----END RSA PRIVATE KEY-----\n\",\n  ],\n  \"cert\": [\n    \"-----BEGIN CERTIFICATE-----\nMIIDXTCCAkWgAwIBAgIJALz8gD/gAt0OMA0GCSqGSIb3DQEBCwUAMEUxCzAJBgNV\nBAYTAkFVMRMwEQYDVQQIDApTb21lLVN0YXRlMSEwHwYDVQQKDBhJbnRlcm5ldCBX\naWRnaXRzIFB0eSBMdGQwHhcNMTgxMDIzMTgyMTQ5WhcNMTkxMDIzMTgyMTQ5WjBF\nMQswCQYDVQQGEwJBVTETMBEGA1UECAwKU29tZS1TdGF0ZTEhMB8GA1UECgwYSW50\nZXJuZXQgV2lkZ2l0cyBQdHkgTHRkMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIB\nCgKCAQEAxAUVLFM+K3XDLQkBi7xt0s1Ip7JoHYDskzUDQNHjjMkUq5kvC/hf5Ei1\nJ6qruJs3Xqg86Nl4+ed4ynUajAkRRibhp0P1SG1tgPssIK6iC7g8heYuDy9WkFuM\nie0513zjSn6bMEAK5TegxYAWCbaCZX/Fw9bDniabL/zuOv4sf8J4EPhsEENnH6sU\nE9HxPUgQmNt1Tbd0j1Cd5PXrSTLyfVPRh0m9QhXTUHuxsse8XSn9U2swduxJTWRI\nNmhffYn+O7kbJGI77xYr8u58Rsf3HCMI8DTKZNvQLChvvtLJ9ckyu7Q+T8emgklS\ntASm3V2UtnriaK/IQEhgSdxqVRib3QIDAQABo1AwTjAdBgNVHQ4EFgQUDZBhVKdb\n3BRhLIhuuE522Vsul0IwHwYDVR0jBBgwFoAUDZBhVKdb3BRhLIhuuE522Vsul0Iw\nDAYDVR0TBAUwAwEB/zANBgkqhkiG9w0BAQsFAAOCAQEABh9WWZwWLgb9/DcTxL72\n6pI96t4jiF79Q+pPefkaIIi0mE6yodWrTAsBQu9I6bNRaEcCSoiXkP2bqskD/UGg\nLwUFgSrDOAA3UjdHw3QU5g2NocduG7mcFwA40TB98sOsxsUyYlzSyWzoiQWwPYwb\nhek1djuWkqPXsTjlj54PTPN/SjTFmo4p5Ip6nbRf2nOREl7v0rJpGbJvXiCMYyd+\nZv+j4mRjCGo8ysMR2HjCUGkYReLAgKyyz3M7i8vevJhKslyOmy6Txn4F0nPVumaU\nDDIy4xXPW1STWfsmSYJfYW3wa0wk+pJQ3j2cTzkPQQ8gwpvM3U9DJl43uwb37v6I\n7Q==\n-----END CERTIFICATE-----\n\",\n  ],\n  \"key\": [\n    \"-----BEGIN PRIVATE KEY-----\nMIIEvwIBADANBgkqhkiG9w0BAQEFAASCBKkwggSlAgEAAoIBAQDEBRUsUz4rdcMt\nCQGLvG3SzUinsmgdgOyTNQNA0eOMyRSrmS8L+F/kSLUnqqu4mzdeqDzo2Xj553jK\ndRqMCRFGJuGnQ/VIbW2A+ywgrqILuDyF5i4PL1aQW4yJ7TnXfONKfpswQArlN6DF\ngBYJtoJlf8XD1sOeJpsv/O46/ix/wngQ+GwQQ2cfqxQT0fE9SBCY23VNt3SPUJ3k\n9etJMvJ9U9GHSb1CFdNQe7Gyx7xdKf1TazB27ElNZEg2aF99if47uRskYjvvFivy\n7nxGx/ccIwjwNMpk29AsKG++0sn1yTK7tD5Px6aCSVK0BKbdXZS2euJor8hASGBJ\n3GpVGJvdAgMBAAECggEAapYo8TVCdPdP7ckb4hPP0/R0MVu9aW2VNmZ5ImH+zar5\nZmWhQ20HF2bBupP/VB5yeTIaDLNUKO9Iqy4KBWNY1UCHKyC023FFPgFV+V98FctU\nfaqwGOmwtEZToRwxe48ZOISndhEc247oCPyg/x8SwIY9z0OUkwaDFBEAqWtUXxM3\n/SPpCT5ilLgxnRgVB8Fj5Z0q7ThnxNVOmVC1OSIakEj46PzmMXn1pCKLOCUmAAOQ\nBnrOZuty2b8b2M/GHsktLZwojQQJmArnIBymTXQTVhaGgKSyOv1qvHLp9L1OJf0/\nXm+/TqT6ztzhzlftcObdfQZZ5JuoEwlvyrsGFlA3MQKBgQDiQC3KYMG8ViJkWrv6\nXNAFEoAjVEKrtirGWJ66YfQ9KSJ7Zttrd1Y1V1OLtq3z4YMH39wdQ8rOD+yR8mWV\n6Tnsxma6yJXAH8uan8iVbxjIZKF1hnvNCxUoxYmWOmTLcEQMzmxvTzAiR+s6R6Uj\n9LgGqppt30nM4wnOhOJU6UxqbwKBgQDdy03KidbPZuycJSy1C9AIt0jlrxDsYm+U\nfZrB6mHEZcgoZS5GbLKinQCdGcgERa05BXvJmNbfZtT5a37YEnbjsTImIhDiBP5P\nnW36/9a3Vg1svd1KP2206/Bh3gfZbgTsQg4YogXgjf0Uzuvw18btgTtLVpVyeuqz\nTU3eeF30cwKBgQCN6lvOmapsDEs+T3uhqx4AUH53qp63PmjOSUAnANJGmsq6ROZV\nHmHAy6nn9Qpf85BRHCXhZWiMoIhvc3As/EINNtWxS6hC/q6jqp4SvcD50cVFBroY\n/16iWGXZCX+37A+DSOfTWgSDPEFcKRx41UOpStHbITgVgEPieo/NWxlHmQKBgQDX\nJOLs2RB6V0ilnpnjdPXzvncD9fHgmwvJap24BPeZX3HtXViqD76oZsu1mNCg9EW3\nzk3pnEyyoDlvSIreZerVq4kN3HWsCVP3Pqr0kz9g0CRtmy8RWr28hjHDfXD3xPUZ\niGnMEz7IOHOKv722/liFAprV1cNaLUmFbDNg3jmlaQKBgQDG5WwngPhOHmjTnSml\namfEz9a4yEhQqpqgVNW5wwoXOf6DbjL2m/maJh01giThj7inMcbpkZlIclxD0Eu6\nLof+ctCeqSAJvaVPmd+nv8Yp26zsF1yM8ax9xXjrIvv9fSbycNveGTDCsNNTiYoW\nQyvMqmN1kGy20SZbQDD/fLfqBQ==\n-----END PRIVATE KEY-----\n\",\n  ],\n  \"passphrase\": \"webpack-dev-server\",\n  \"pfx\": [\n    \"<Buffer>\",\n  ],\n  \"requestCert\": false,\n}\n`;\n\nexports[`server option as object ca, pfx, key and cert are array of strings should handle GET request to index route (/): page errors 1`] = `[]`;\n\nexports[`server option as object ca, pfx, key and cert are array of strings should handle GET request to index route (/): response status 1`] = `200`;\n\nexports[`server option as object ca, pfx, key and cert are array of strings should handle GET request to index route (/): response text 1`] = `\n\"Heyo.\n\"\n`;\n\nexports[`server option as object ca, pfx, key and cert are buffer should handle GET request to index route (/): console messages 1`] = `[]`;\n\nexports[`server option as object ca, pfx, key and cert are buffer should handle GET request to index route (/): https options 1`] = `\n{\n  \"ca\": \"<Buffer>\",\n  \"cert\": \"<Buffer>\",\n  \"key\": \"<Buffer>\",\n  \"passphrase\": \"webpack-dev-server\",\n  \"pfx\": \"<Buffer>\",\n  \"requestCert\": false,\n}\n`;\n\nexports[`server option as object ca, pfx, key and cert are buffer should handle GET request to index route (/): page errors 1`] = `[]`;\n\nexports[`server option as object ca, pfx, key and cert are buffer should handle GET request to index route (/): response status 1`] = `200`;\n\nexports[`server option as object ca, pfx, key and cert are buffer should handle GET request to index route (/): response text 1`] = `\n\"Heyo.\n\"\n`;\n\nexports[`server option as object ca, pfx, key and cert are buffer, key and pfx are objects should handle GET request to index route (/): console messages 1`] = `[]`;\n\nexports[`server option as object ca, pfx, key and cert are buffer, key and pfx are objects should handle GET request to index route (/): https options 1`] = `\n{\n  \"ca\": \"<Buffer>\",\n  \"cert\": \"<Buffer>\",\n  \"key\": [\n    {\n      \"pem\": \"<Buffer>\",\n    },\n  ],\n  \"passphrase\": \"webpack-dev-server\",\n  \"pfx\": [\n    {\n      \"buf\": \"<Buffer>\",\n    },\n  ],\n  \"requestCert\": false,\n}\n`;\n\nexports[`server option as object ca, pfx, key and cert are buffer, key and pfx are objects should handle GET request to index route (/): page errors 1`] = `[]`;\n\nexports[`server option as object ca, pfx, key and cert are buffer, key and pfx are objects should handle GET request to index route (/): response status 1`] = `200`;\n\nexports[`server option as object ca, pfx, key and cert are buffer, key and pfx are objects should handle GET request to index route (/): response text 1`] = `\n\"Heyo.\n\"\n`;\n\nexports[`server option as object ca, pfx, key and cert are paths to files should handle GET request to index route (/): console messages 1`] = `[]`;\n\nexports[`server option as object ca, pfx, key and cert are paths to files should handle GET request to index route (/): https options 1`] = `\n{\n  \"ca\": \"<Buffer>\",\n  \"cert\": \"<Buffer>\",\n  \"key\": \"<Buffer>\",\n  \"passphrase\": \"webpack-dev-server\",\n  \"pfx\": \"<Buffer>\",\n  \"requestCert\": false,\n}\n`;\n\nexports[`server option as object ca, pfx, key and cert are paths to files should handle GET request to index route (/): page errors 1`] = `[]`;\n\nexports[`server option as object ca, pfx, key and cert are paths to files should handle GET request to index route (/): response status 1`] = `200`;\n\nexports[`server option as object ca, pfx, key and cert are paths to files should handle GET request to index route (/): response text 1`] = `\n\"Heyo.\n\"\n`;\n\nexports[`server option as object ca, pfx, key and cert are strings should handle GET request to index route (/): console messages 1`] = `[]`;\n\nexports[`server option as object ca, pfx, key and cert are strings should handle GET request to index route (/): https options 1`] = `\n{\n  \"ca\": \"-----BEGIN RSA PRIVATE KEY-----\nMIIEpQIBAAKCAQEAxAUVLFM+K3XDLQkBi7xt0s1Ip7JoHYDskzUDQNHjjMkUq5kv\nC/hf5Ei1J6qruJs3Xqg86Nl4+ed4ynUajAkRRibhp0P1SG1tgPssIK6iC7g8heYu\nDy9WkFuMie0513zjSn6bMEAK5TegxYAWCbaCZX/Fw9bDniabL/zuOv4sf8J4EPhs\nEENnH6sUE9HxPUgQmNt1Tbd0j1Cd5PXrSTLyfVPRh0m9QhXTUHuxsse8XSn9U2sw\nduxJTWRINmhffYn+O7kbJGI77xYr8u58Rsf3HCMI8DTKZNvQLChvvtLJ9ckyu7Q+\nT8emgklStASm3V2UtnriaK/IQEhgSdxqVRib3QIDAQABAoIBAGqWKPE1QnT3T+3J\nG+ITz9P0dDFbvWltlTZmeSJh/s2q+WZloUNtBxdmwbqT/1QecnkyGgyzVCjvSKsu\nCgVjWNVAhysgtNtxRT4BVflffBXLVH2qsBjpsLRGU6EcMXuPGTiEp3YRHNuO6Aj8\noP8fEsCGPc9DlJMGgxQRAKlrVF8TN/0j6Qk+YpS4MZ0YFQfBY+WdKu04Z8TVTplQ\ntTkiGpBI+Oj85jF59aQiizglJgADkAZ6zmbrctm/G9jPxh7JLS2cKI0ECZgK5yAc\npk10E1YWhoCksjr9arxy6fS9TiX9P15vv06k+s7c4c5X7XDm3X0GWeSbqBMJb8q7\nBhZQNzECgYEA4kAtymDBvFYiZFq7+lzQBRKAI1RCq7YqxlieumH0PSkie2bba3dW\nNVdTi7at8+GDB9/cHUPKzg/skfJllek57MZmusiVwB/Lmp/IlW8YyGShdYZ7zQsV\nKMWJljpky3BEDM5sb08wIkfrOkelI/S4Bqqabd9JzOMJzoTiVOlMam8CgYEA3ctN\nyonWz2bsnCUstQvQCLdI5a8Q7GJvlH2awephxGXIKGUuRmyyop0AnRnIBEWtOQV7\nyZjW32bU+Wt+2BJ247EyJiIQ4gT+T51t+v/Wt1YNbL3dSj9ttOvwYd4H2W4E7EIO\nGKIF4I39FM7r8NfG7YE7S1aVcnrqs01N3nhd9HMCgYEAjepbzpmqbAxLPk97oase\nAFB+d6qetz5ozklAJwDSRprKukTmVR5hwMup5/UKX/OQURwl4WVojKCIb3NwLPxC\nDTbVsUuoQv6uo6qeEr3A+dHFRQa6GP9eolhl2Ql/t+wPg0jn01oEgzxBXCkceNVD\nqUrR2yE4FYBD4nqPzVsZR5kCgYEA1yTi7NkQeldIpZ6Z43T18753A/Xx4JsLyWqd\nuAT3mV9x7V1Yqg++qGbLtZjQoPRFt85N6ZxMsqA5b0iK3mXq1auJDdx1rAlT9z6q\n9JM/YNAkbZsvEVq9vIYxw31w98T1GYhpzBM+yDhzir+9tv5YhQKa1dXDWi1JhWwz\nYN45pWkCgYEAxuVsJ4D4Th5o050ppWpnxM/WuMhIUKqaoFTVucMKFzn+g24y9pv5\nmiYdNYIk4Y+4pzHG6ZGZSHJcQ9BLui6H/nLQnqkgCb2lT5nfp7/GKdus7BdcjPGs\nfcV46yL7/X0m8nDb3hkwwrDTU4mKFkMrzKpjdZBsttEmW0Aw/3y36gU=\n-----END RSA PRIVATE KEY-----\n\",\n  \"cert\": \"-----BEGIN CERTIFICATE-----\nMIIDXTCCAkWgAwIBAgIJALz8gD/gAt0OMA0GCSqGSIb3DQEBCwUAMEUxCzAJBgNV\nBAYTAkFVMRMwEQYDVQQIDApTb21lLVN0YXRlMSEwHwYDVQQKDBhJbnRlcm5ldCBX\naWRnaXRzIFB0eSBMdGQwHhcNMTgxMDIzMTgyMTQ5WhcNMTkxMDIzMTgyMTQ5WjBF\nMQswCQYDVQQGEwJBVTETMBEGA1UECAwKU29tZS1TdGF0ZTEhMB8GA1UECgwYSW50\nZXJuZXQgV2lkZ2l0cyBQdHkgTHRkMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIB\nCgKCAQEAxAUVLFM+K3XDLQkBi7xt0s1Ip7JoHYDskzUDQNHjjMkUq5kvC/hf5Ei1\nJ6qruJs3Xqg86Nl4+ed4ynUajAkRRibhp0P1SG1tgPssIK6iC7g8heYuDy9WkFuM\nie0513zjSn6bMEAK5TegxYAWCbaCZX/Fw9bDniabL/zuOv4sf8J4EPhsEENnH6sU\nE9HxPUgQmNt1Tbd0j1Cd5PXrSTLyfVPRh0m9QhXTUHuxsse8XSn9U2swduxJTWRI\nNmhffYn+O7kbJGI77xYr8u58Rsf3HCMI8DTKZNvQLChvvtLJ9ckyu7Q+T8emgklS\ntASm3V2UtnriaK/IQEhgSdxqVRib3QIDAQABo1AwTjAdBgNVHQ4EFgQUDZBhVKdb\n3BRhLIhuuE522Vsul0IwHwYDVR0jBBgwFoAUDZBhVKdb3BRhLIhuuE522Vsul0Iw\nDAYDVR0TBAUwAwEB/zANBgkqhkiG9w0BAQsFAAOCAQEABh9WWZwWLgb9/DcTxL72\n6pI96t4jiF79Q+pPefkaIIi0mE6yodWrTAsBQu9I6bNRaEcCSoiXkP2bqskD/UGg\nLwUFgSrDOAA3UjdHw3QU5g2NocduG7mcFwA40TB98sOsxsUyYlzSyWzoiQWwPYwb\nhek1djuWkqPXsTjlj54PTPN/SjTFmo4p5Ip6nbRf2nOREl7v0rJpGbJvXiCMYyd+\nZv+j4mRjCGo8ysMR2HjCUGkYReLAgKyyz3M7i8vevJhKslyOmy6Txn4F0nPVumaU\nDDIy4xXPW1STWfsmSYJfYW3wa0wk+pJQ3j2cTzkPQQ8gwpvM3U9DJl43uwb37v6I\n7Q==\n-----END CERTIFICATE-----\n\",\n  \"key\": \"-----BEGIN PRIVATE KEY-----\nMIIEvwIBADANBgkqhkiG9w0BAQEFAASCBKkwggSlAgEAAoIBAQDEBRUsUz4rdcMt\nCQGLvG3SzUinsmgdgOyTNQNA0eOMyRSrmS8L+F/kSLUnqqu4mzdeqDzo2Xj553jK\ndRqMCRFGJuGnQ/VIbW2A+ywgrqILuDyF5i4PL1aQW4yJ7TnXfONKfpswQArlN6DF\ngBYJtoJlf8XD1sOeJpsv/O46/ix/wngQ+GwQQ2cfqxQT0fE9SBCY23VNt3SPUJ3k\n9etJMvJ9U9GHSb1CFdNQe7Gyx7xdKf1TazB27ElNZEg2aF99if47uRskYjvvFivy\n7nxGx/ccIwjwNMpk29AsKG++0sn1yTK7tD5Px6aCSVK0BKbdXZS2euJor8hASGBJ\n3GpVGJvdAgMBAAECggEAapYo8TVCdPdP7ckb4hPP0/R0MVu9aW2VNmZ5ImH+zar5\nZmWhQ20HF2bBupP/VB5yeTIaDLNUKO9Iqy4KBWNY1UCHKyC023FFPgFV+V98FctU\nfaqwGOmwtEZToRwxe48ZOISndhEc247oCPyg/x8SwIY9z0OUkwaDFBEAqWtUXxM3\n/SPpCT5ilLgxnRgVB8Fj5Z0q7ThnxNVOmVC1OSIakEj46PzmMXn1pCKLOCUmAAOQ\nBnrOZuty2b8b2M/GHsktLZwojQQJmArnIBymTXQTVhaGgKSyOv1qvHLp9L1OJf0/\nXm+/TqT6ztzhzlftcObdfQZZ5JuoEwlvyrsGFlA3MQKBgQDiQC3KYMG8ViJkWrv6\nXNAFEoAjVEKrtirGWJ66YfQ9KSJ7Zttrd1Y1V1OLtq3z4YMH39wdQ8rOD+yR8mWV\n6Tnsxma6yJXAH8uan8iVbxjIZKF1hnvNCxUoxYmWOmTLcEQMzmxvTzAiR+s6R6Uj\n9LgGqppt30nM4wnOhOJU6UxqbwKBgQDdy03KidbPZuycJSy1C9AIt0jlrxDsYm+U\nfZrB6mHEZcgoZS5GbLKinQCdGcgERa05BXvJmNbfZtT5a37YEnbjsTImIhDiBP5P\nnW36/9a3Vg1svd1KP2206/Bh3gfZbgTsQg4YogXgjf0Uzuvw18btgTtLVpVyeuqz\nTU3eeF30cwKBgQCN6lvOmapsDEs+T3uhqx4AUH53qp63PmjOSUAnANJGmsq6ROZV\nHmHAy6nn9Qpf85BRHCXhZWiMoIhvc3As/EINNtWxS6hC/q6jqp4SvcD50cVFBroY\n/16iWGXZCX+37A+DSOfTWgSDPEFcKRx41UOpStHbITgVgEPieo/NWxlHmQKBgQDX\nJOLs2RB6V0ilnpnjdPXzvncD9fHgmwvJap24BPeZX3HtXViqD76oZsu1mNCg9EW3\nzk3pnEyyoDlvSIreZerVq4kN3HWsCVP3Pqr0kz9g0CRtmy8RWr28hjHDfXD3xPUZ\niGnMEz7IOHOKv722/liFAprV1cNaLUmFbDNg3jmlaQKBgQDG5WwngPhOHmjTnSml\namfEz9a4yEhQqpqgVNW5wwoXOf6DbjL2m/maJh01giThj7inMcbpkZlIclxD0Eu6\nLof+ctCeqSAJvaVPmd+nv8Yp26zsF1yM8ax9xXjrIvv9fSbycNveGTDCsNNTiYoW\nQyvMqmN1kGy20SZbQDD/fLfqBQ==\n-----END PRIVATE KEY-----\n\",\n  \"passphrase\": \"webpack-dev-server\",\n  \"pfx\": \"<Buffer>\",\n  \"requestCert\": false,\n}\n`;\n\nexports[`server option as object ca, pfx, key and cert are strings should handle GET request to index route (/): page errors 1`] = `[]`;\n\nexports[`server option as object ca, pfx, key and cert are strings should handle GET request to index route (/): response status 1`] = `200`;\n\nexports[`server option as object ca, pfx, key and cert are strings should handle GET request to index route (/): response text 1`] = `\n\"Heyo.\n\"\n`;\n\nexports[`server option as object ca, pfx, key and cert are strings, key and pfx are objects should handle GET request to index route (/): console messages 1`] = `[]`;\n\nexports[`server option as object ca, pfx, key and cert are strings, key and pfx are objects should handle GET request to index route (/): https options 1`] = `\n{\n  \"ca\": \"-----BEGIN RSA PRIVATE KEY-----\nMIIEpQIBAAKCAQEAxAUVLFM+K3XDLQkBi7xt0s1Ip7JoHYDskzUDQNHjjMkUq5kv\nC/hf5Ei1J6qruJs3Xqg86Nl4+ed4ynUajAkRRibhp0P1SG1tgPssIK6iC7g8heYu\nDy9WkFuMie0513zjSn6bMEAK5TegxYAWCbaCZX/Fw9bDniabL/zuOv4sf8J4EPhs\nEENnH6sUE9HxPUgQmNt1Tbd0j1Cd5PXrSTLyfVPRh0m9QhXTUHuxsse8XSn9U2sw\nduxJTWRINmhffYn+O7kbJGI77xYr8u58Rsf3HCMI8DTKZNvQLChvvtLJ9ckyu7Q+\nT8emgklStASm3V2UtnriaK/IQEhgSdxqVRib3QIDAQABAoIBAGqWKPE1QnT3T+3J\nG+ITz9P0dDFbvWltlTZmeSJh/s2q+WZloUNtBxdmwbqT/1QecnkyGgyzVCjvSKsu\nCgVjWNVAhysgtNtxRT4BVflffBXLVH2qsBjpsLRGU6EcMXuPGTiEp3YRHNuO6Aj8\noP8fEsCGPc9DlJMGgxQRAKlrVF8TN/0j6Qk+YpS4MZ0YFQfBY+WdKu04Z8TVTplQ\ntTkiGpBI+Oj85jF59aQiizglJgADkAZ6zmbrctm/G9jPxh7JLS2cKI0ECZgK5yAc\npk10E1YWhoCksjr9arxy6fS9TiX9P15vv06k+s7c4c5X7XDm3X0GWeSbqBMJb8q7\nBhZQNzECgYEA4kAtymDBvFYiZFq7+lzQBRKAI1RCq7YqxlieumH0PSkie2bba3dW\nNVdTi7at8+GDB9/cHUPKzg/skfJllek57MZmusiVwB/Lmp/IlW8YyGShdYZ7zQsV\nKMWJljpky3BEDM5sb08wIkfrOkelI/S4Bqqabd9JzOMJzoTiVOlMam8CgYEA3ctN\nyonWz2bsnCUstQvQCLdI5a8Q7GJvlH2awephxGXIKGUuRmyyop0AnRnIBEWtOQV7\nyZjW32bU+Wt+2BJ247EyJiIQ4gT+T51t+v/Wt1YNbL3dSj9ttOvwYd4H2W4E7EIO\nGKIF4I39FM7r8NfG7YE7S1aVcnrqs01N3nhd9HMCgYEAjepbzpmqbAxLPk97oase\nAFB+d6qetz5ozklAJwDSRprKukTmVR5hwMup5/UKX/OQURwl4WVojKCIb3NwLPxC\nDTbVsUuoQv6uo6qeEr3A+dHFRQa6GP9eolhl2Ql/t+wPg0jn01oEgzxBXCkceNVD\nqUrR2yE4FYBD4nqPzVsZR5kCgYEA1yTi7NkQeldIpZ6Z43T18753A/Xx4JsLyWqd\nuAT3mV9x7V1Yqg++qGbLtZjQoPRFt85N6ZxMsqA5b0iK3mXq1auJDdx1rAlT9z6q\n9JM/YNAkbZsvEVq9vIYxw31w98T1GYhpzBM+yDhzir+9tv5YhQKa1dXDWi1JhWwz\nYN45pWkCgYEAxuVsJ4D4Th5o050ppWpnxM/WuMhIUKqaoFTVucMKFzn+g24y9pv5\nmiYdNYIk4Y+4pzHG6ZGZSHJcQ9BLui6H/nLQnqkgCb2lT5nfp7/GKdus7BdcjPGs\nfcV46yL7/X0m8nDb3hkwwrDTU4mKFkMrzKpjdZBsttEmW0Aw/3y36gU=\n-----END RSA PRIVATE KEY-----\n\",\n  \"cert\": \"-----BEGIN CERTIFICATE-----\nMIIDXTCCAkWgAwIBAgIJALz8gD/gAt0OMA0GCSqGSIb3DQEBCwUAMEUxCzAJBgNV\nBAYTAkFVMRMwEQYDVQQIDApTb21lLVN0YXRlMSEwHwYDVQQKDBhJbnRlcm5ldCBX\naWRnaXRzIFB0eSBMdGQwHhcNMTgxMDIzMTgyMTQ5WhcNMTkxMDIzMTgyMTQ5WjBF\nMQswCQYDVQQGEwJBVTETMBEGA1UECAwKU29tZS1TdGF0ZTEhMB8GA1UECgwYSW50\nZXJuZXQgV2lkZ2l0cyBQdHkgTHRkMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIB\nCgKCAQEAxAUVLFM+K3XDLQkBi7xt0s1Ip7JoHYDskzUDQNHjjMkUq5kvC/hf5Ei1\nJ6qruJs3Xqg86Nl4+ed4ynUajAkRRibhp0P1SG1tgPssIK6iC7g8heYuDy9WkFuM\nie0513zjSn6bMEAK5TegxYAWCbaCZX/Fw9bDniabL/zuOv4sf8J4EPhsEENnH6sU\nE9HxPUgQmNt1Tbd0j1Cd5PXrSTLyfVPRh0m9QhXTUHuxsse8XSn9U2swduxJTWRI\nNmhffYn+O7kbJGI77xYr8u58Rsf3HCMI8DTKZNvQLChvvtLJ9ckyu7Q+T8emgklS\ntASm3V2UtnriaK/IQEhgSdxqVRib3QIDAQABo1AwTjAdBgNVHQ4EFgQUDZBhVKdb\n3BRhLIhuuE522Vsul0IwHwYDVR0jBBgwFoAUDZBhVKdb3BRhLIhuuE522Vsul0Iw\nDAYDVR0TBAUwAwEB/zANBgkqhkiG9w0BAQsFAAOCAQEABh9WWZwWLgb9/DcTxL72\n6pI96t4jiF79Q+pPefkaIIi0mE6yodWrTAsBQu9I6bNRaEcCSoiXkP2bqskD/UGg\nLwUFgSrDOAA3UjdHw3QU5g2NocduG7mcFwA40TB98sOsxsUyYlzSyWzoiQWwPYwb\nhek1djuWkqPXsTjlj54PTPN/SjTFmo4p5Ip6nbRf2nOREl7v0rJpGbJvXiCMYyd+\nZv+j4mRjCGo8ysMR2HjCUGkYReLAgKyyz3M7i8vevJhKslyOmy6Txn4F0nPVumaU\nDDIy4xXPW1STWfsmSYJfYW3wa0wk+pJQ3j2cTzkPQQ8gwpvM3U9DJl43uwb37v6I\n7Q==\n-----END CERTIFICATE-----\n\",\n  \"key\": [\n    {\n      \"pem\": \"-----BEGIN PRIVATE KEY-----\nMIIEvwIBADANBgkqhkiG9w0BAQEFAASCBKkwggSlAgEAAoIBAQDEBRUsUz4rdcMt\nCQGLvG3SzUinsmgdgOyTNQNA0eOMyRSrmS8L+F/kSLUnqqu4mzdeqDzo2Xj553jK\ndRqMCRFGJuGnQ/VIbW2A+ywgrqILuDyF5i4PL1aQW4yJ7TnXfONKfpswQArlN6DF\ngBYJtoJlf8XD1sOeJpsv/O46/ix/wngQ+GwQQ2cfqxQT0fE9SBCY23VNt3SPUJ3k\n9etJMvJ9U9GHSb1CFdNQe7Gyx7xdKf1TazB27ElNZEg2aF99if47uRskYjvvFivy\n7nxGx/ccIwjwNMpk29AsKG++0sn1yTK7tD5Px6aCSVK0BKbdXZS2euJor8hASGBJ\n3GpVGJvdAgMBAAECggEAapYo8TVCdPdP7ckb4hPP0/R0MVu9aW2VNmZ5ImH+zar5\nZmWhQ20HF2bBupP/VB5yeTIaDLNUKO9Iqy4KBWNY1UCHKyC023FFPgFV+V98FctU\nfaqwGOmwtEZToRwxe48ZOISndhEc247oCPyg/x8SwIY9z0OUkwaDFBEAqWtUXxM3\n/SPpCT5ilLgxnRgVB8Fj5Z0q7ThnxNVOmVC1OSIakEj46PzmMXn1pCKLOCUmAAOQ\nBnrOZuty2b8b2M/GHsktLZwojQQJmArnIBymTXQTVhaGgKSyOv1qvHLp9L1OJf0/\nXm+/TqT6ztzhzlftcObdfQZZ5JuoEwlvyrsGFlA3MQKBgQDiQC3KYMG8ViJkWrv6\nXNAFEoAjVEKrtirGWJ66YfQ9KSJ7Zttrd1Y1V1OLtq3z4YMH39wdQ8rOD+yR8mWV\n6Tnsxma6yJXAH8uan8iVbxjIZKF1hnvNCxUoxYmWOmTLcEQMzmxvTzAiR+s6R6Uj\n9LgGqppt30nM4wnOhOJU6UxqbwKBgQDdy03KidbPZuycJSy1C9AIt0jlrxDsYm+U\nfZrB6mHEZcgoZS5GbLKinQCdGcgERa05BXvJmNbfZtT5a37YEnbjsTImIhDiBP5P\nnW36/9a3Vg1svd1KP2206/Bh3gfZbgTsQg4YogXgjf0Uzuvw18btgTtLVpVyeuqz\nTU3eeF30cwKBgQCN6lvOmapsDEs+T3uhqx4AUH53qp63PmjOSUAnANJGmsq6ROZV\nHmHAy6nn9Qpf85BRHCXhZWiMoIhvc3As/EINNtWxS6hC/q6jqp4SvcD50cVFBroY\n/16iWGXZCX+37A+DSOfTWgSDPEFcKRx41UOpStHbITgVgEPieo/NWxlHmQKBgQDX\nJOLs2RB6V0ilnpnjdPXzvncD9fHgmwvJap24BPeZX3HtXViqD76oZsu1mNCg9EW3\nzk3pnEyyoDlvSIreZerVq4kN3HWsCVP3Pqr0kz9g0CRtmy8RWr28hjHDfXD3xPUZ\niGnMEz7IOHOKv722/liFAprV1cNaLUmFbDNg3jmlaQKBgQDG5WwngPhOHmjTnSml\namfEz9a4yEhQqpqgVNW5wwoXOf6DbjL2m/maJh01giThj7inMcbpkZlIclxD0Eu6\nLof+ctCeqSAJvaVPmd+nv8Yp26zsF1yM8ax9xXjrIvv9fSbycNveGTDCsNNTiYoW\nQyvMqmN1kGy20SZbQDD/fLfqBQ==\n-----END PRIVATE KEY-----\n\",\n    },\n  ],\n  \"passphrase\": \"webpack-dev-server\",\n  \"pfx\": [\n    {\n      \"buf\": \"<Buffer>\",\n    },\n  ],\n  \"requestCert\": false,\n}\n`;\n\nexports[`server option as object ca, pfx, key and cert are strings, key and pfx are objects should handle GET request to index route (/): page errors 1`] = `[]`;\n\nexports[`server option as object ca, pfx, key and cert are strings, key and pfx are objects should handle GET request to index route (/): response status 1`] = `200`;\n\nexports[`server option as object ca, pfx, key and cert are strings, key and pfx are objects should handle GET request to index route (/): response text 1`] = `\n\"Heyo.\n\"\n`;\n\nexports[`server option as object custom server with options should handle GET request to index route (/): console messages 1`] = `[]`;\n\nexports[`server option as object custom server with options should handle GET request to index route (/): http options 1`] = `\n{\n  \"maxHeaderSize\": 16384,\n}\n`;\n\nexports[`server option as object custom server with options should handle GET request to index route (/): page errors 1`] = `[]`;\n\nexports[`server option as object custom server with options should handle GET request to index route (/): response status 1`] = `200`;\n\nexports[`server option as object custom server with options should handle GET request to index route (/): response text 1`] = `\n\"Heyo.\n\"\n`;\n\nexports[`server option as object should support the \"requestCert\" option should handle GET request to index route (/): response status 1`] = `200`;\n\nexports[`server option as object should support the \"requestCert\" option should handle GET request to index route (/): response text 1`] = `\n\"Heyo.\n\"\n`;\n\nexports[`server option as object should support the \"requestCert\" option should pass options to the 'https.createServer' method: https options 1`] = `\n{\n  \"cert\": \"<Buffer>\",\n  \"key\": \"<Buffer>\",\n  \"passphrase\": \"webpack-dev-server\",\n  \"pfx\": \"<Buffer>\",\n  \"requestCert\": true,\n}\n`;\n\nexports[`server option as string custom-http should handle GET request to index route (/): console messages 1`] = `[]`;\n\nexports[`server option as string custom-http should handle GET request to index route (/): page errors 1`] = `[]`;\n\nexports[`server option as string custom-http should handle GET request to index route (/): response status 1`] = `200`;\n\nexports[`server option as string custom-http should handle GET request to index route (/): response text 1`] = `\n\"Heyo.\n\"\n`;\n\nexports[`server option as string http should handle GET request to index route (/): console messages 1`] = `[]`;\n\nexports[`server option as string http should handle GET request to index route (/): page errors 1`] = `[]`;\n\nexports[`server option as string http should handle GET request to index route (/): response status 1`] = `200`;\n\nexports[`server option as string http should handle GET request to index route (/): response text 1`] = `\n\"Heyo.\n\"\n`;\n\nexports[`server option as string https should handle GET request to index route (/): console messages 1`] = `[]`;\n\nexports[`server option as string https should handle GET request to index route (/): page errors 1`] = `[]`;\n\nexports[`server option as string https should handle GET request to index route (/): response status 1`] = `200`;\n\nexports[`server option as string https should handle GET request to index route (/): response text 1`] = `\n\"Heyo.\n\"\n`;\n"
  },
  {
    "path": "test/e2e/__snapshots__/setup-exit-signals.test.js.snap.webpack5",
    "content": "// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing\n\nexports[`setupExitSignals option should handle 'SIGINT' and 'SIGTERM' signals should close and exit on SIGINT: console messages 1`] = `\n[\n  \"[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.\",\n  \"[HMR] Waiting for update signal from WDS...\",\n  \"Hey.\",\n]\n`;\n\nexports[`setupExitSignals option should handle 'SIGINT' and 'SIGTERM' signals should close and exit on SIGINT: page errors 1`] = `[]`;\n\nexports[`setupExitSignals option should handle 'SIGINT' and 'SIGTERM' signals should close and exit on SIGINT: response status 1`] = `200`;\n\nexports[`setupExitSignals option should handle 'SIGINT' and 'SIGTERM' signals should close and exit on SIGTERM: console messages 1`] = `\n[\n  \"[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.\",\n  \"[HMR] Waiting for update signal from WDS...\",\n  \"Hey.\",\n]\n`;\n\nexports[`setupExitSignals option should handle 'SIGINT' and 'SIGTERM' signals should close and exit on SIGTERM: page errors 1`] = `[]`;\n\nexports[`setupExitSignals option should handle 'SIGINT' and 'SIGTERM' signals should close and exit on SIGTERM: response status 1`] = `200`;\n"
  },
  {
    "path": "test/e2e/__snapshots__/setup-middlewares.test.js.snap.webpack5",
    "content": "// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing\n\nexports[`setupMiddlewares option should handle GET request to /setup-middleware/some/path route: console messages 1`] = `[]`;\n\nexports[`setupMiddlewares option should handle GET request to /setup-middleware/some/path route: page errors 1`] = `[]`;\n\nexports[`setupMiddlewares option should handle GET request to /setup-middleware/some/path route: response headers content-type 1`] = `\"text/html; charset=utf-8\"`;\n\nexports[`setupMiddlewares option should handle GET request to /setup-middleware/some/path route: response headers content-type 2`] = `\"text/html; charset=utf-8\"`;\n\nexports[`setupMiddlewares option should handle GET request to /setup-middleware/some/path route: response headers content-type 3`] = `\"text/html; charset=utf-8\"`;\n\nexports[`setupMiddlewares option should handle GET request to /setup-middleware/some/path route: response headers content-type 4`] = `\"text/html; charset=utf-8\"`;\n\nexports[`setupMiddlewares option should handle GET request to /setup-middleware/some/path route: response status 1`] = `200`;\n\nexports[`setupMiddlewares option should handle GET request to /setup-middleware/some/path route: response status 2`] = `200`;\n\nexports[`setupMiddlewares option should handle GET request to /setup-middleware/some/path route: response status 3`] = `200`;\n\nexports[`setupMiddlewares option should handle GET request to /setup-middleware/some/path route: response status 4`] = `200`;\n\nexports[`setupMiddlewares option should handle GET request to /setup-middleware/some/path route: response text 1`] = `\"setup-middlewares option GET\"`;\n\nexports[`setupMiddlewares option should handle GET request to /setup-middleware/some/path route: response text 2`] = `\"Hello World with path!\"`;\n\nexports[`setupMiddlewares option should handle GET request to /setup-middleware/some/path route: response text 3`] = `\"Hello World without path!\"`;\n\nexports[`setupMiddlewares option should handle GET request to /setup-middleware/some/path route: response text 4`] = `\"Hello World as function!\"`;\n\nexports[`setupMiddlewares option should handle POST request to /setup-middleware/some/path route: console messages 1`] = `[]`;\n\nexports[`setupMiddlewares option should handle POST request to /setup-middleware/some/path route: page errors 1`] = `[]`;\n\nexports[`setupMiddlewares option should handle POST request to /setup-middleware/some/path route: response headers content-type 1`] = `\"text/html; charset=utf-8\"`;\n\nexports[`setupMiddlewares option should handle POST request to /setup-middleware/some/path route: response status 1`] = `200`;\n\nexports[`setupMiddlewares option should handle POST request to /setup-middleware/some/path route: response text 1`] = `\"setup-middlewares option POST\"`;\n"
  },
  {
    "path": "test/e2e/__snapshots__/static-directory.test.js.snap.webpack5",
    "content": "// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing\n\nexports[`static.directory option defaults to PWD should handle request to /index.html: console messages 1`] = `[]`;\n\nexports[`static.directory option defaults to PWD should handle request to /index.html: page errors 1`] = `[]`;\n\nexports[`static.directory option defaults to PWD should handle request to /index.html: response status 1`] = `200`;\n\nexports[`static.directory option defaults to PWD should handle request to /index.html: response text 1`] = `\n\"Heyo.\n\"\n`;\n\nexports[`static.directory option disabled should not handle request to /other.html (404): console messages 1`] = `\n[\n  \"Failed to load resource: the server responded with a status of 404 (Not Found)\",\n]\n`;\n\nexports[`static.directory option disabled should not handle request to /other.html (404): page errors 1`] = `[]`;\n\nexports[`static.directory option disabled should not handle request to /other.html (404): response status 1`] = `404`;\n\nexports[`static.directory option disabled should not handle request to /other.html (404): response text 1`] = `\n\"<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n<meta charset=\"utf-8\">\n<title>Error</title>\n</head>\n<body>\n<pre>Cannot GET /index.html</pre>\n</body>\n</html>\n\"\n`;\n\nexports[`static.directory option test listing files in folders without index.html using the default static.serveIndex option (true) should list the files inside the assets folder (200): console messages 1`] = `[]`;\n\nexports[`static.directory option test listing files in folders without index.html using the default static.serveIndex option (true) should list the files inside the assets folder (200): page errors 1`] = `[]`;\n\nexports[`static.directory option test listing files in folders without index.html using the default static.serveIndex option (true) should list the files inside the assets folder (200): response status 1`] = `200`;\n\nexports[`static.directory option test listing files in folders without index.html using the default static.serveIndex option (true) should show Heyo. because bar has index.html inside it (200): console messages 1`] = `[]`;\n\nexports[`static.directory option test listing files in folders without index.html using the default static.serveIndex option (true) should show Heyo. because bar has index.html inside it (200): page errors 1`] = `[]`;\n\nexports[`static.directory option test listing files in folders without index.html using the default static.serveIndex option (true) should show Heyo. because bar has index.html inside it (200): response status 1`] = `200`;\n\nexports[`static.directory option test listing files in folders without index.html using the default static.serveIndex option (true) should show Heyo. because bar has index.html inside it (200): response text 1`] = `\n\"Heyo\n\"\n`;\n\nexports[`static.directory option test listing files in folders without index.html using the option static.serveIndex: false should not list the files inside the assets folder (404): console messages 1`] = `\n[\n  \"Failed to load resource: the server responded with a status of 404 (Not Found)\",\n]\n`;\n\nexports[`static.directory option test listing files in folders without index.html using the option static.serveIndex: false should not list the files inside the assets folder (404): page errors 1`] = `[]`;\n\nexports[`static.directory option test listing files in folders without index.html using the option static.serveIndex: false should not list the files inside the assets folder (404): response status 1`] = `404`;\n\nexports[`static.directory option test listing files in folders without index.html using the option static.serveIndex: false should not list the files inside the assets folder (404): response text 1`] = `\n\"<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n<meta charset=\"utf-8\">\n<title>Error</title>\n</head>\n<body>\n<pre>Cannot GET /assets/</pre>\n</body>\n</html>\n\"\n`;\n\nexports[`static.directory option test listing files in folders without index.html using the option static.serveIndex: false should show Heyo. because bar has index.html inside it (200): console messages 1`] = `[]`;\n\nexports[`static.directory option test listing files in folders without index.html using the option static.serveIndex: false should show Heyo. because bar has index.html inside it (200): page errors 1`] = `[]`;\n\nexports[`static.directory option test listing files in folders without index.html using the option static.serveIndex: false should show Heyo. because bar has index.html inside it (200): response status 1`] = `200`;\n\nexports[`static.directory option test listing files in folders without index.html using the option static.serveIndex: false should show Heyo. because bar has index.html inside it (200): response text 1`] = `\n\"Heyo\n\"\n`;\n\nexports[`static.directory option test listing files in folders without index.html using the option static.serveIndex: true should list the files inside the assets folder (200): console messages 1`] = `[]`;\n\nexports[`static.directory option test listing files in folders without index.html using the option static.serveIndex: true should list the files inside the assets folder (200): page errors 1`] = `[]`;\n\nexports[`static.directory option test listing files in folders without index.html using the option static.serveIndex: true should list the files inside the assets folder (200): response status 1`] = `200`;\n\nexports[`static.directory option test listing files in folders without index.html using the option static.serveIndex: true should show Heyo. because bar has index.html inside it (200): console messages 1`] = `[]`;\n\nexports[`static.directory option test listing files in folders without index.html using the option static.serveIndex: true should show Heyo. because bar has index.html inside it (200): page errors 1`] = `[]`;\n\nexports[`static.directory option test listing files in folders without index.html using the option static.serveIndex: true should show Heyo. because bar has index.html inside it (200): response status 1`] = `200`;\n\nexports[`static.directory option test listing files in folders without index.html using the option static.serveIndex: true should show Heyo. because bar has index.html inside it (200): response text 1`] = `\n\"Heyo\n\"\n`;\n\nexports[`static.directory option to directory should handle request to index route: console messages 1`] = `[]`;\n\nexports[`static.directory option to directory should handle request to index route: page errors 1`] = `[]`;\n\nexports[`static.directory option to directory should handle request to index route: response status 1`] = `200`;\n\nexports[`static.directory option to directory should handle request to index route: response text 1`] = `\n\"Heyo.\n\"\n`;\n\nexports[`static.directory option to directory should handle request to other file: console messages 1`] = `[]`;\n\nexports[`static.directory option to directory should handle request to other file: page errors 1`] = `[]`;\n\nexports[`static.directory option to directory should handle request to other file: response status 1`] = `200`;\n\nexports[`static.directory option to directory should handle request to other file: response text 1`] = `\n\"Other html\n\"\n`;\n\nexports[`static.directory option to multiple directories should handle request first directory: console messages 1`] = `[]`;\n\nexports[`static.directory option to multiple directories should handle request first directory: page errors 1`] = `[]`;\n\nexports[`static.directory option to multiple directories should handle request first directory: response status 1`] = `200`;\n\nexports[`static.directory option to multiple directories should handle request first directory: response text 1`] = `\n\"Heyo.\n\"\n`;\n\nexports[`static.directory option to multiple directories should handle request to second directory: console messages 1`] = `[]`;\n\nexports[`static.directory option to multiple directories should handle request to second directory: page errors 1`] = `[]`;\n\nexports[`static.directory option to multiple directories should handle request to second directory: response status 1`] = `200`;\n\nexports[`static.directory option to multiple directories should handle request to second directory: response text 1`] = `\n\"Foo!\n\"\n`;\n"
  },
  {
    "path": "test/e2e/__snapshots__/static-public-path.test.js.snap.webpack5",
    "content": "// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing\n\nexports[`static.publicPath option Content type should handle request to example.txt: console messages 1`] = `[]`;\n\nexports[`static.publicPath option Content type should handle request to example.txt: page errors 1`] = `[]`;\n\nexports[`static.publicPath option Content type should handle request to example.txt: response header content-type 1`] = `\"text/plain; charset=UTF-8\"`;\n\nexports[`static.publicPath option Content type should handle request to example.txt: response status 1`] = `200`;\n\nexports[`static.publicPath option defaults to CWD should handle request to page: console messages 1`] = `[]`;\n\nexports[`static.publicPath option defaults to CWD should handle request to page: page errors 1`] = `[]`;\n\nexports[`static.publicPath option defaults to CWD should handle request to page: response status 1`] = `200`;\n\nexports[`static.publicPath option defaults to CWD should handle request to page: response text 1`] = `\n\"Heyo.\n\"\n`;\n\nexports[`static.publicPath option multiple static.publicPath entries should handle request to the /foo route of second path: console messages 1`] = `[]`;\n\nexports[`static.publicPath option multiple static.publicPath entries should handle request to the /foo route of second path: page errors 1`] = `[]`;\n\nexports[`static.publicPath option multiple static.publicPath entries should handle request to the /foo route of second path: response status 1`] = `200`;\n\nexports[`static.publicPath option multiple static.publicPath entries should handle request to the /foo route of second path: response text 1`] = `\n\"Foo!\n\"\n`;\n\nexports[`static.publicPath option multiple static.publicPath entries should handle request to the index of first path: console messages 1`] = `[]`;\n\nexports[`static.publicPath option multiple static.publicPath entries should handle request to the index of first path: page errors 1`] = `[]`;\n\nexports[`static.publicPath option multiple static.publicPath entries should handle request to the index of first path: response status 1`] = `200`;\n\nexports[`static.publicPath option multiple static.publicPath entries should handle request to the index of first path: response text 1`] = `\n\"Heyo.\n\"\n`;\n\nexports[`static.publicPath option multiple static.publicPath entries should handle request to the other file of first path: console messages 1`] = `[]`;\n\nexports[`static.publicPath option multiple static.publicPath entries should handle request to the other file of first path: page errors 1`] = `[]`;\n\nexports[`static.publicPath option multiple static.publicPath entries should handle request to the other file of first path: response status 1`] = `200`;\n\nexports[`static.publicPath option multiple static.publicPath entries should handle request to the other file of first path: response text 1`] = `\n\"Other html\n\"\n`;\n\nexports[`static.publicPath option multiple static.publicPath entries with publicPath array should handle request to the /foo route of first path: console messages 1`] = `[]`;\n\nexports[`static.publicPath option multiple static.publicPath entries with publicPath array should handle request to the /foo route of first path: page errors 1`] = `[]`;\n\nexports[`static.publicPath option multiple static.publicPath entries with publicPath array should handle request to the /foo route of first path: response status 1`] = `200`;\n\nexports[`static.publicPath option multiple static.publicPath entries with publicPath array should handle request to the /foo route of first path: response text 1`] = `\n\"Foo!\n\"\n`;\n\nexports[`static.publicPath option multiple static.publicPath entries with publicPath array should handle request to the /foo route of second path: console messages 1`] = `[]`;\n\nexports[`static.publicPath option multiple static.publicPath entries with publicPath array should handle request to the /foo route of second path: page errors 1`] = `[]`;\n\nexports[`static.publicPath option multiple static.publicPath entries with publicPath array should handle request to the /foo route of second path: response status 1`] = `200`;\n\nexports[`static.publicPath option multiple static.publicPath entries with publicPath array should handle request to the /foo route of second path: response text 1`] = `\n\"Foo!\n\"\n`;\n\nexports[`static.publicPath option multiple static.publicPath entries with publicPath array should handle request to the index of first path: console messages 1`] = `[]`;\n\nexports[`static.publicPath option multiple static.publicPath entries with publicPath array should handle request to the index of first path: page errors 1`] = `[]`;\n\nexports[`static.publicPath option multiple static.publicPath entries with publicPath array should handle request to the index of first path: response status 1`] = `200`;\n\nexports[`static.publicPath option multiple static.publicPath entries with publicPath array should handle request to the index of first path: response text 1`] = `\n\"Heyo.\n\"\n`;\n\nexports[`static.publicPath option multiple static.publicPath entries with publicPath array should handle request to the other file of first path: console messages 1`] = `[]`;\n\nexports[`static.publicPath option multiple static.publicPath entries with publicPath array should handle request to the other file of first path: page errors 1`] = `[]`;\n\nexports[`static.publicPath option multiple static.publicPath entries with publicPath array should handle request to the other file of first path: response status 1`] = `200`;\n\nexports[`static.publicPath option multiple static.publicPath entries with publicPath array should handle request to the other file of first path: response text 1`] = `\n\"Other html\n\"\n`;\n\nexports[`static.publicPath option should ignore methods other than GET and HEAD should handle GET request: console messages 1`] = `[]`;\n\nexports[`static.publicPath option should ignore methods other than GET and HEAD should handle GET request: page errors 1`] = `[]`;\n\nexports[`static.publicPath option should ignore methods other than GET and HEAD should handle GET request: response status 1`] = `200`;\n\nexports[`static.publicPath option should ignore methods other than GET and HEAD should handle HEAD request: console messages 1`] = `[]`;\n\nexports[`static.publicPath option should ignore methods other than GET and HEAD should handle HEAD request: page errors 1`] = `[]`;\n\nexports[`static.publicPath option should ignore methods other than GET and HEAD should handle HEAD request: response status 1`] = `200`;\n\nexports[`static.publicPath option should ignore methods other than GET and HEAD should not handle DELETE request: console messages 1`] = `\n[\n  \"Failed to load resource: the server responded with a status of 404 (Not Found)\",\n]\n`;\n\nexports[`static.publicPath option should ignore methods other than GET and HEAD should not handle DELETE request: page errors 1`] = `[]`;\n\nexports[`static.publicPath option should ignore methods other than GET and HEAD should not handle DELETE request: response status 1`] = `404`;\n\nexports[`static.publicPath option should ignore methods other than GET and HEAD should not handle PATCH request: console messages 1`] = `\n[\n  \"Failed to load resource: the server responded with a status of 404 (Not Found)\",\n]\n`;\n\nexports[`static.publicPath option should ignore methods other than GET and HEAD should not handle PATCH request: page errors 1`] = `[]`;\n\nexports[`static.publicPath option should ignore methods other than GET and HEAD should not handle PATCH request: response status 1`] = `404`;\n\nexports[`static.publicPath option should ignore methods other than GET and HEAD should not handle POST request: console messages 1`] = `\n[\n  \"Failed to load resource: the server responded with a status of 404 (Not Found)\",\n]\n`;\n\nexports[`static.publicPath option should ignore methods other than GET and HEAD should not handle POST request: page errors 1`] = `[]`;\n\nexports[`static.publicPath option should ignore methods other than GET and HEAD should not handle POST request: response status 1`] = `404`;\n\nexports[`static.publicPath option should ignore methods other than GET and HEAD should not handle PUT request: console messages 1`] = `\n[\n  \"Failed to load resource: the server responded with a status of 404 (Not Found)\",\n]\n`;\n\nexports[`static.publicPath option should ignore methods other than GET and HEAD should not handle PUT request: page errors 1`] = `[]`;\n\nexports[`static.publicPath option should ignore methods other than GET and HEAD should not handle PUT request: response status 1`] = `404`;\n\nexports[`static.publicPath option test listing files in folders without index.html using the option static.serveIndex default (true) should list the files inside the assets folder (200): console messages 1`] = `[]`;\n\nexports[`static.publicPath option test listing files in folders without index.html using the option static.serveIndex default (true) should list the files inside the assets folder (200): page errors 1`] = `[]`;\n\nexports[`static.publicPath option test listing files in folders without index.html using the option static.serveIndex default (true) should list the files inside the assets folder (200): response status 1`] = `200`;\n\nexports[`static.publicPath option test listing files in folders without index.html using the option static.serveIndex default (true) should show Heyo. because bar has index.html inside it (200): console messages 1`] = `[]`;\n\nexports[`static.publicPath option test listing files in folders without index.html using the option static.serveIndex default (true) should show Heyo. because bar has index.html inside it (200): page errors 1`] = `[]`;\n\nexports[`static.publicPath option test listing files in folders without index.html using the option static.serveIndex default (true) should show Heyo. because bar has index.html inside it (200): response status 1`] = `200`;\n\nexports[`static.publicPath option test listing files in folders without index.html using the option static.serveIndex default (true) should show Heyo. because bar has index.html inside it (200): response text 1`] = `\n\"Heyo\n\"\n`;\n\nexports[`static.publicPath option test listing files in folders without index.html using the option static.serveIndex: false should show Heyo. because bar has index.html inside it (200): console messages 1`] = `[]`;\n\nexports[`static.publicPath option test listing files in folders without index.html using the option static.serveIndex: false should show Heyo. because bar has index.html inside it (200): page errors 1`] = `[]`;\n\nexports[`static.publicPath option test listing files in folders without index.html using the option static.serveIndex: false should show Heyo. because bar has index.html inside it (200): response status 1`] = `200`;\n\nexports[`static.publicPath option test listing files in folders without index.html using the option static.serveIndex: false should show Heyo. because bar has index.html inside it (200): response text 1`] = `\n\"Heyo\n\"\n`;\n\nexports[`static.publicPath option test listing files in folders without index.html using the option static.serveIndex: false shouldn't list the files inside the assets folder (404): console messages 1`] = `\n[\n  \"Failed to load resource: the server responded with a status of 404 (Not Found)\",\n]\n`;\n\nexports[`static.publicPath option test listing files in folders without index.html using the option static.serveIndex: false shouldn't list the files inside the assets folder (404): page errors 1`] = `[]`;\n\nexports[`static.publicPath option test listing files in folders without index.html using the option static.serveIndex: false shouldn't list the files inside the assets folder (404): response status 1`] = `404`;\n\nexports[`static.publicPath option test listing files in folders without index.html using the option static.serveIndex: false shouldn't list the files inside the assets folder (404): response text 1`] = `\n\"<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n<meta charset=\"utf-8\">\n<title>Error</title>\n</head>\n<body>\n<pre>Cannot GET /serve-content-at-this-url/assets/</pre>\n</body>\n</html>\n\"\n`;\n\nexports[`static.publicPath option test listing files in folders without index.html using the option static.serveIndex: true should list the files inside the assets folder (200): console messages 1`] = `[]`;\n\nexports[`static.publicPath option test listing files in folders without index.html using the option static.serveIndex: true should list the files inside the assets folder (200): page errors 1`] = `[]`;\n\nexports[`static.publicPath option test listing files in folders without index.html using the option static.serveIndex: true should list the files inside the assets folder (200): response status 1`] = `200`;\n\nexports[`static.publicPath option test listing files in folders without index.html using the option static.serveIndex: true should show Heyo. because bar has index.html inside it (200): console messages 1`] = `[]`;\n\nexports[`static.publicPath option test listing files in folders without index.html using the option static.serveIndex: true should show Heyo. because bar has index.html inside it (200): page errors 1`] = `[]`;\n\nexports[`static.publicPath option test listing files in folders without index.html using the option static.serveIndex: true should show Heyo. because bar has index.html inside it (200): response status 1`] = `200`;\n\nexports[`static.publicPath option test listing files in folders without index.html using the option static.serveIndex: true should show Heyo. because bar has index.html inside it (200): response text 1`] = `\n\"Heyo\n\"\n`;\n\nexports[`static.publicPath option to directory should handle request to index: console messages 1`] = `[]`;\n\nexports[`static.publicPath option to directory should handle request to index: page errors 1`] = `[]`;\n\nexports[`static.publicPath option to directory should handle request to index: response status 1`] = `200`;\n\nexports[`static.publicPath option to directory should handle request to index: response text 1`] = `\n\"Heyo.\n\"\n`;\n\nexports[`static.publicPath option to directory should handle request to other file: console messages 1`] = `[]`;\n\nexports[`static.publicPath option to directory should handle request to other file: page errors 1`] = `[]`;\n\nexports[`static.publicPath option to directory should handle request to other file: response status 1`] = `200`;\n\nexports[`static.publicPath option to directory should handle request to other file: response text 1`] = `\n\"Other html\n\"\n`;\n\nexports[`static.publicPath option to multiple directories should handle request to first directory: console messages 1`] = `[]`;\n\nexports[`static.publicPath option to multiple directories should handle request to first directory: page errors 1`] = `[]`;\n\nexports[`static.publicPath option to multiple directories should handle request to first directory: response status 1`] = `200`;\n\nexports[`static.publicPath option to multiple directories should handle request to first directory: response text 1`] = `\n\"Heyo.\n\"\n`;\n\nexports[`static.publicPath option to multiple directories should handle request to second directory: console messages 1`] = `[]`;\n\nexports[`static.publicPath option to multiple directories should handle request to second directory: page errors 1`] = `[]`;\n\nexports[`static.publicPath option to multiple directories should handle request to second directory: response status 1`] = `200`;\n\nexports[`static.publicPath option to multiple directories should handle request to second directory: response text 1`] = `\n\"Foo!\n\"\n`;\n"
  },
  {
    "path": "test/e2e/__snapshots__/stats.test.js.snap.webpack5",
    "content": "// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing\n\nexports[`stats should work and respect the \"ignoreWarnings\" option 1`] = `\n[\n  \"[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.\",\n  \"[HMR] Waiting for update signal from WDS...\",\n  \"Hey.\",\n]\n`;\n\nexports[`stats should work using \"{ assets: false }\" value for the \"stats\" option 1`] = `\n[\n  \"[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.\",\n  \"[HMR] Waiting for update signal from WDS...\",\n  \"Hey.\",\n]\n`;\n\nexports[`stats should work using \"{ assets: false }\" value for the \"stats\" option 2`] = `\n[\n  \"[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.\",\n  \"[HMR] Waiting for update signal from WDS...\",\n  \"Hey.\",\n]\n`;\n\nexports[`stats should work using \"{ warningsFilter: 'test' }\" value for the \"stats\" option 1`] = `\n[\n  \"[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.\",\n  \"[HMR] Waiting for update signal from WDS...\",\n  \"Hey.\",\n]\n`;\n\nexports[`stats should work using \"{}\" value for the \"stats\" option 1`] = `\n[\n  \"[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.\",\n  \"[HMR] Waiting for update signal from WDS...\",\n  \"Hey.\",\n]\n`;\n\nexports[`stats should work using \"errors-only\" value for the \"stats\" option 1`] = `\n[\n  \"[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.\",\n  \"[HMR] Waiting for update signal from WDS...\",\n  \"Hey.\",\n]\n`;\n\nexports[`stats should work using \"false\" value for the \"stats\" option 1`] = `\n[\n  \"[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.\",\n  \"[HMR] Waiting for update signal from WDS...\",\n  \"Hey.\",\n]\n`;\n\nexports[`stats should work using \"undefined\" value for the \"stats\" option 1`] = `\n[\n  \"[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.\",\n  \"[HMR] Waiting for update signal from WDS...\",\n  \"Hey.\",\n]\n`;\n\nexports[`stats should work when \"stats\" is not specified 1`] = `\n[\n  \"[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.\",\n  \"[HMR] Waiting for update signal from WDS...\",\n  \"Hey.\",\n]\n`;\n"
  },
  {
    "path": "test/e2e/__snapshots__/target.test.js.snap.webpack5",
    "content": "// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing\n\nexports[`target should work using \"async-node\" target: console messages 1`] = `[]`;\n\nexports[`target should work using \"browserslist:defaults\" target: console messages 1`] = `\n[\n  \"[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.\",\n  \"[HMR] Waiting for update signal from WDS...\",\n  \"Hey.\",\n]\n`;\n\nexports[`target should work using \"browserslist:defaults\" target: page errors 1`] = `[]`;\n\nexports[`target should work using \"electron-main\" target: console messages 1`] = `[]`;\n\nexports[`target should work using \"electron-preload\" target: console messages 1`] = `[]`;\n\nexports[`target should work using \"electron-renderer\" target: console messages 1`] = `[]`;\n\nexports[`target should work using \"es5\" target: console messages 1`] = `\n[\n  \"[HMR] Waiting for update signal from WDS...\",\n  \"Hey.\",\n]\n`;\n\nexports[`target should work using \"es5\" target: page errors 1`] = `[]`;\n\nexports[`target should work using \"false\" target: console messages 1`] = `\n[\n  \"[HMR] Waiting for update signal from WDS...\",\n  \"Hey.\",\n]\n`;\n\nexports[`target should work using \"false\" target: page errors 1`] = `[]`;\n\nexports[`target should work using \"node\" target: console messages 1`] = `[]`;\n\nexports[`target should work using \"node-webkit\" target: console messages 1`] = `[]`;\n\nexports[`target should work using \"nwjs\" target: console messages 1`] = `[]`;\n\nexports[`target should work using \"web\" target: console messages 1`] = `\n[\n  \"[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.\",\n  \"[HMR] Waiting for update signal from WDS...\",\n  \"Hey.\",\n]\n`;\n\nexports[`target should work using \"web\" target: page errors 1`] = `[]`;\n\nexports[`target should work using \"web,es5\" target: console messages 1`] = `\n[\n  \"[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.\",\n  \"[HMR] Waiting for update signal from WDS...\",\n  \"Hey.\",\n]\n`;\n\nexports[`target should work using \"web,es5\" target: page errors 1`] = `[]`;\n\nexports[`target should work using \"webworker\" target: console messages 1`] = `\n[\n  \"[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.\",\n  \"[HMR] Waiting for update signal from WDS...\",\n  \"Hey.\",\n]\n`;\n\nexports[`target should work using \"webworker\" target: page errors 1`] = `[]`;\n\nexports[`target should work using multi compiler mode with \\`web\\` and \\`webworker\\` targets with \\`devServer: false\\`: console messages 1`] = `\n[\n  \"[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.\",\n  \"[HMR] Waiting for update signal from WDS...\",\n  \"Worker said: I'm working before postMessage\",\n  \"Worker said: Message sent: message\",\n]\n`;\n\nexports[`target should work using multi compiler mode with \\`web\\` and \\`webworker\\` targets with \\`devServer: false\\`: page errors 1`] = `[]`;\n\nexports[`target should work using multi compiler mode with \\`web\\` and \\`webworker\\` targets: console messages 1`] = `\n[\n  \"[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.\",\n  \"[HMR] Waiting for update signal from WDS...\",\n  \"[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.\",\n  \"[HMR] Waiting for update signal from WDS...\",\n  \"Worker said: I'm working before postMessage\",\n  \"Worker said: Message sent: message\",\n]\n`;\n\nexports[`target should work using multi compiler mode with \\`web\\` and \\`webworker\\` targets: page errors 1`] = `[]`;\n"
  },
  {
    "path": "test/e2e/__snapshots__/watch-files.test.js.snap.webpack5",
    "content": "// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing\n\nexports[`watchFiles option should not crash if file doesn't exist should reload when file content is changed: console messages 1`] = `\n[\n  \"Hey.\",\n]\n`;\n\nexports[`watchFiles option should not crash if file doesn't exist should reload when file content is changed: page errors 1`] = `[]`;\n\nexports[`watchFiles option should not crash if file doesn't exist should reload when file content is changed: response status 1`] = `200`;\n\nexports[`watchFiles option should work with array config should reload when file content is changed: console messages 1`] = `\n[\n  \"Hey.\",\n]\n`;\n\nexports[`watchFiles option should work with array config should reload when file content is changed: page errors 1`] = `[]`;\n\nexports[`watchFiles option should work with array config should reload when file content is changed: response status 1`] = `200`;\n\nexports[`watchFiles option should work with object with multiple paths should reload when file content is changed: console messages 1`] = `\n[\n  \"Hey.\",\n]\n`;\n\nexports[`watchFiles option should work with object with multiple paths should reload when file content is changed: page errors 1`] = `[]`;\n\nexports[`watchFiles option should work with object with multiple paths should reload when file content is changed: response status 1`] = `200`;\n\nexports[`watchFiles option should work with object with single path should reload when file content is changed: console messages 1`] = `\n[\n  \"Hey.\",\n]\n`;\n\nexports[`watchFiles option should work with object with single path should reload when file content is changed: page errors 1`] = `[]`;\n\nexports[`watchFiles option should work with object with single path should reload when file content is changed: response status 1`] = `200`;\n\nexports[`watchFiles option should work with options {\"interval\":400,\"poll\":200} should reload when file content is changed 1`] = `\n{\n  \"alwaysStat\": true,\n  \"atomic\": false,\n  \"followSymlinks\": false,\n  \"ignoreInitial\": true,\n  \"ignorePermissionErrors\": true,\n  \"ignored\": undefined,\n  \"interval\": 400,\n  \"persistent\": true,\n  \"usePolling\": true,\n}\n`;\n\nexports[`watchFiles option should work with options {\"interval\":400,\"poll\":200} should reload when file content is changed: console messages 1`] = `\n[\n  \"Hey.\",\n]\n`;\n\nexports[`watchFiles option should work with options {\"interval\":400,\"poll\":200} should reload when file content is changed: page errors 1`] = `[]`;\n\nexports[`watchFiles option should work with options {\"interval\":400,\"poll\":200} should reload when file content is changed: response status 1`] = `200`;\n\nexports[`watchFiles option should work with options {\"poll\":200} should reload when file content is changed 1`] = `\n{\n  \"alwaysStat\": true,\n  \"atomic\": false,\n  \"followSymlinks\": false,\n  \"ignoreInitial\": true,\n  \"ignorePermissionErrors\": true,\n  \"ignored\": undefined,\n  \"interval\": 200,\n  \"persistent\": true,\n  \"usePolling\": true,\n}\n`;\n\nexports[`watchFiles option should work with options {\"poll\":200} should reload when file content is changed: console messages 1`] = `\n[\n  \"Hey.\",\n]\n`;\n\nexports[`watchFiles option should work with options {\"poll\":200} should reload when file content is changed: page errors 1`] = `[]`;\n\nexports[`watchFiles option should work with options {\"poll\":200} should reload when file content is changed: response status 1`] = `200`;\n\nexports[`watchFiles option should work with options {\"poll\":true} should reload when file content is changed 1`] = `\n{\n  \"alwaysStat\": true,\n  \"atomic\": false,\n  \"followSymlinks\": false,\n  \"ignoreInitial\": true,\n  \"ignorePermissionErrors\": true,\n  \"ignored\": undefined,\n  \"interval\": undefined,\n  \"persistent\": true,\n  \"usePolling\": true,\n}\n`;\n\nexports[`watchFiles option should work with options {\"poll\":true} should reload when file content is changed: console messages 1`] = `\n[\n  \"Hey.\",\n]\n`;\n\nexports[`watchFiles option should work with options {\"poll\":true} should reload when file content is changed: page errors 1`] = `[]`;\n\nexports[`watchFiles option should work with options {\"poll\":true} should reload when file content is changed: response status 1`] = `200`;\n\nexports[`watchFiles option should work with options {\"usePolling\":false,\"interval\":200,\"poll\":400} should reload when file content is changed 1`] = `\n{\n  \"alwaysStat\": true,\n  \"atomic\": false,\n  \"followSymlinks\": false,\n  \"ignoreInitial\": true,\n  \"ignorePermissionErrors\": true,\n  \"ignored\": undefined,\n  \"interval\": 200,\n  \"persistent\": true,\n  \"usePolling\": false,\n}\n`;\n\nexports[`watchFiles option should work with options {\"usePolling\":false,\"interval\":200,\"poll\":400} should reload when file content is changed: console messages 1`] = `\n[\n  \"Hey.\",\n]\n`;\n\nexports[`watchFiles option should work with options {\"usePolling\":false,\"interval\":200,\"poll\":400} should reload when file content is changed: page errors 1`] = `[]`;\n\nexports[`watchFiles option should work with options {\"usePolling\":false,\"interval\":200,\"poll\":400} should reload when file content is changed: response status 1`] = `200`;\n\nexports[`watchFiles option should work with options {\"usePolling\":false,\"poll\":200} should reload when file content is changed 1`] = `\n{\n  \"alwaysStat\": true,\n  \"atomic\": false,\n  \"followSymlinks\": false,\n  \"ignoreInitial\": true,\n  \"ignorePermissionErrors\": true,\n  \"ignored\": undefined,\n  \"interval\": 200,\n  \"persistent\": true,\n  \"usePolling\": false,\n}\n`;\n\nexports[`watchFiles option should work with options {\"usePolling\":false,\"poll\":200} should reload when file content is changed: console messages 1`] = `\n[\n  \"Hey.\",\n]\n`;\n\nexports[`watchFiles option should work with options {\"usePolling\":false,\"poll\":200} should reload when file content is changed: page errors 1`] = `[]`;\n\nexports[`watchFiles option should work with options {\"usePolling\":false,\"poll\":200} should reload when file content is changed: response status 1`] = `200`;\n\nexports[`watchFiles option should work with options {\"usePolling\":false,\"poll\":true} should reload when file content is changed 1`] = `\n{\n  \"alwaysStat\": true,\n  \"atomic\": false,\n  \"followSymlinks\": false,\n  \"ignoreInitial\": true,\n  \"ignorePermissionErrors\": true,\n  \"ignored\": undefined,\n  \"interval\": undefined,\n  \"persistent\": true,\n  \"usePolling\": false,\n}\n`;\n\nexports[`watchFiles option should work with options {\"usePolling\":false,\"poll\":true} should reload when file content is changed: console messages 1`] = `\n[\n  \"Hey.\",\n]\n`;\n\nexports[`watchFiles option should work with options {\"usePolling\":false,\"poll\":true} should reload when file content is changed: page errors 1`] = `[]`;\n\nexports[`watchFiles option should work with options {\"usePolling\":false,\"poll\":true} should reload when file content is changed: response status 1`] = `200`;\n\nexports[`watchFiles option should work with options {\"usePolling\":false} should reload when file content is changed 1`] = `\n{\n  \"alwaysStat\": true,\n  \"atomic\": false,\n  \"followSymlinks\": false,\n  \"ignoreInitial\": true,\n  \"ignorePermissionErrors\": true,\n  \"ignored\": undefined,\n  \"interval\": undefined,\n  \"persistent\": true,\n  \"usePolling\": false,\n}\n`;\n\nexports[`watchFiles option should work with options {\"usePolling\":false} should reload when file content is changed: console messages 1`] = `\n[\n  \"Hey.\",\n]\n`;\n\nexports[`watchFiles option should work with options {\"usePolling\":false} should reload when file content is changed: page errors 1`] = `[]`;\n\nexports[`watchFiles option should work with options {\"usePolling\":false} should reload when file content is changed: response status 1`] = `200`;\n\nexports[`watchFiles option should work with options {\"usePolling\":true,\"interval\":200,\"poll\":400} should reload when file content is changed 1`] = `\n{\n  \"alwaysStat\": true,\n  \"atomic\": false,\n  \"followSymlinks\": false,\n  \"ignoreInitial\": true,\n  \"ignorePermissionErrors\": true,\n  \"ignored\": undefined,\n  \"interval\": 200,\n  \"persistent\": true,\n  \"usePolling\": true,\n}\n`;\n\nexports[`watchFiles option should work with options {\"usePolling\":true,\"interval\":200,\"poll\":400} should reload when file content is changed: console messages 1`] = `\n[\n  \"Hey.\",\n]\n`;\n\nexports[`watchFiles option should work with options {\"usePolling\":true,\"interval\":200,\"poll\":400} should reload when file content is changed: page errors 1`] = `[]`;\n\nexports[`watchFiles option should work with options {\"usePolling\":true,\"interval\":200,\"poll\":400} should reload when file content is changed: response status 1`] = `200`;\n\nexports[`watchFiles option should work with options {\"usePolling\":true,\"poll\":200} should reload when file content is changed 1`] = `\n{\n  \"alwaysStat\": true,\n  \"atomic\": false,\n  \"followSymlinks\": false,\n  \"ignoreInitial\": true,\n  \"ignorePermissionErrors\": true,\n  \"ignored\": undefined,\n  \"interval\": 200,\n  \"persistent\": true,\n  \"usePolling\": true,\n}\n`;\n\nexports[`watchFiles option should work with options {\"usePolling\":true,\"poll\":200} should reload when file content is changed: console messages 1`] = `\n[\n  \"Hey.\",\n]\n`;\n\nexports[`watchFiles option should work with options {\"usePolling\":true,\"poll\":200} should reload when file content is changed: page errors 1`] = `[]`;\n\nexports[`watchFiles option should work with options {\"usePolling\":true,\"poll\":200} should reload when file content is changed: response status 1`] = `200`;\n\nexports[`watchFiles option should work with options {\"usePolling\":true} should reload when file content is changed 1`] = `\n{\n  \"alwaysStat\": true,\n  \"atomic\": false,\n  \"followSymlinks\": false,\n  \"ignoreInitial\": true,\n  \"ignorePermissionErrors\": true,\n  \"ignored\": undefined,\n  \"interval\": undefined,\n  \"persistent\": true,\n  \"usePolling\": true,\n}\n`;\n\nexports[`watchFiles option should work with options {\"usePolling\":true} should reload when file content is changed: console messages 1`] = `\n[\n  \"Hey.\",\n]\n`;\n\nexports[`watchFiles option should work with options {\"usePolling\":true} should reload when file content is changed: page errors 1`] = `[]`;\n\nexports[`watchFiles option should work with options {\"usePolling\":true} should reload when file content is changed: response status 1`] = `200`;\n\nexports[`watchFiles option should work with string and glob should reload when file content is changed: console messages 1`] = `\n[\n  \"Hey.\",\n]\n`;\n\nexports[`watchFiles option should work with string and glob should reload when file content is changed: page errors 1`] = `[]`;\n\nexports[`watchFiles option should work with string and glob should reload when file content is changed: response status 1`] = `200`;\n\nexports[`watchFiles option should work with string and path to directory should reload when file content is changed: console messages 1`] = `\n[\n  \"Hey.\",\n]\n`;\n\nexports[`watchFiles option should work with string and path to directory should reload when file content is changed: page errors 1`] = `[]`;\n\nexports[`watchFiles option should work with string and path to directory should reload when file content is changed: response status 1`] = `200`;\n\nexports[`watchFiles option should work with string and path to file should reload when file content is changed: console messages 1`] = `\n[\n  \"Hey.\",\n]\n`;\n\nexports[`watchFiles option should work with string and path to file should reload when file content is changed: page errors 1`] = `[]`;\n\nexports[`watchFiles option should work with string and path to file should reload when file content is changed: response status 1`] = `200`;\n"
  },
  {
    "path": "test/e2e/__snapshots__/web-socket-communication.test.js.snap.webpack5",
    "content": "// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing\n\nexports[`web socket communication should work and close web socket client connection when web socket server closed (\"sockjs\"): console messages 1`] = `\n[\n  \"[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.\",\n  \"[HMR] Waiting for update signal from WDS...\",\n  \"Hey.\",\n  \"[webpack-dev-server] Disconnected!\",\n  \"[webpack-dev-server] Trying to reconnect...\",\n]\n`;\n\nexports[`web socket communication should work and close web socket client connection when web socket server closed (\"sockjs\"): page errors 1`] = `[]`;\n\nexports[`web socket communication should work and close web socket client connection when web socket server closed (\"ws\"): console messages 1`] = `\n[\n  \"[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.\",\n  \"[HMR] Waiting for update signal from WDS...\",\n  \"Hey.\",\n  \"[webpack-dev-server] Disconnected!\",\n  \"[webpack-dev-server] Trying to reconnect...\",\n]\n`;\n\nexports[`web socket communication should work and close web socket client connection when web socket server closed (\"ws\"): page errors 1`] = `[]`;\n\nexports[`web socket communication should work and reconnect when the connection is lost (\"sockjs\"): console messages 1`] = `\n[\n  \"[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.\",\n  \"[HMR] Waiting for update signal from WDS...\",\n  \"Hey.\",\n  \"[webpack-dev-server] Disconnected!\",\n  \"[webpack-dev-server] Trying to reconnect...\",\n  \"[webpack-dev-server] App hot update...\",\n  \"[HMR] Checking for updates on the server...\",\n  \"Failed to load resource: the server responded with a status of 404 (Not Found)\",\n  \"[HMR] Cannot find update. Need to do a full reload!\",\n  \"[HMR] (Probably because of restarting the webpack-dev-server)\",\n  \"[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.\",\n  \"[HMR] Waiting for update signal from WDS...\",\n  \"Hey.\",\n]\n`;\n\nexports[`web socket communication should work and reconnect when the connection is lost (\"sockjs\"): page errors 1`] = `[]`;\n\nexports[`web socket communication should work and reconnect when the connection is lost (\"ws\"): console messages 1`] = `\n[\n  \"[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.\",\n  \"[HMR] Waiting for update signal from WDS...\",\n  \"Hey.\",\n  \"[webpack-dev-server] Disconnected!\",\n  \"[webpack-dev-server] Trying to reconnect...\",\n  \"[webpack-dev-server] App hot update...\",\n  \"[HMR] Checking for updates on the server...\",\n  \"Failed to load resource: the server responded with a status of 404 (Not Found)\",\n  \"[HMR] Cannot find update. Need to do a full reload!\",\n  \"[HMR] (Probably because of restarting the webpack-dev-server)\",\n  \"[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.\",\n  \"[HMR] Waiting for update signal from WDS...\",\n  \"Hey.\",\n]\n`;\n\nexports[`web socket communication should work and reconnect when the connection is lost (\"ws\"): page errors 1`] = `[]`;\n\nexports[`web socket communication should work and terminate client that is not alive (\"sockjs\"): console messages 1`] = `\n[\n  \"[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.\",\n  \"[HMR] Waiting for update signal from WDS...\",\n  \"Hey.\",\n]\n`;\n\nexports[`web socket communication should work and terminate client that is not alive (\"sockjs\"): page errors 1`] = `[]`;\n\nexports[`web socket communication should work and terminate client that is not alive (\"ws\"): console messages 1`] = `\n[\n  \"[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.\",\n  \"[HMR] Waiting for update signal from WDS...\",\n  \"Hey.\",\n]\n`;\n\nexports[`web socket communication should work and terminate client that is not alive (\"ws\"): page errors 1`] = `[]`;\n"
  },
  {
    "path": "test/e2e/__snapshots__/web-socket-server-url.test.js.snap.webpack5",
    "content": "// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing\n\nexports[`web socket server URL should not work and output disconnect wrong web socket URL (\"sockjs\"): console messages 1`] = `\n[\n  \"[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.\",\n  \"[HMR] Waiting for update signal from WDS...\",\n  \"Hey.\",\n  \"Failed to load resource: net::ERR_NAME_NOT_RESOLVED\",\n  \"[webpack-dev-server] Disconnected!\",\n]\n`;\n\nexports[`web socket server URL should not work and output disconnect wrong web socket URL (\"sockjs\"): page errors 1`] = `[]`;\n\nexports[`web socket server URL should not work and output disconnect wrong web socket URL (\"ws\"): console messages 1`] = `\n[\n  \"[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.\",\n  \"[HMR] Waiting for update signal from WDS...\",\n  \"Hey.\",\n  \"WebSocket connection to 'ws://unknown.unknown:<port>/unknown' failed: Error in connection establishment: net::ERR_NAME_NOT_RESOLVED\",\n  \"[webpack-dev-server] JSHandle@object\",\n  \"[webpack-dev-server] Disconnected!\",\n]\n`;\n\nexports[`web socket server URL should not work and output disconnect wrong web socket URL (\"ws\"): page errors 1`] = `[]`;\n\nexports[`web socket server URL should work and throw an error on invalid web socket URL (\"sockjs\"): console messages 1`] = `\n[\n  \"[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.\",\n]\n`;\n\nexports[`web socket server URL should work and throw an error on invalid web socket URL (\"sockjs\"): page errors 1`] = `\n[\n  \"The URL's scheme must be either 'http:' or 'https:'. 'unknown:' is not allowed.\",\n]\n`;\n\nexports[`web socket server URL should work and throw an error on invalid web socket URL (\"ws\"): console messages 1`] = `\n[\n  \"[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.\",\n]\n`;\n\nexports[`web socket server URL should work and throw an error on invalid web socket URL (\"ws\"): page errors 1`] = `\n[\n  \"Failed to construct 'WebSocket': The URL's scheme must be either 'http', 'https', 'ws', or 'wss'. 'unknown' is not allowed.\",\n]\n`;\n\nexports[`web socket server URL should work behind proxy, when hostnames are different and ports are different (\"sockjs\"): console messages 1`] = `\n[\n  \"[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.\",\n  \"[HMR] Waiting for update signal from WDS...\",\n  \"Hey.\",\n]\n`;\n\nexports[`web socket server URL should work behind proxy, when hostnames are different and ports are different (\"sockjs\"): page errors 1`] = `[]`;\n\nexports[`web socket server URL should work behind proxy, when hostnames are different and ports are different (\"ws\"): console messages 1`] = `\n[\n  \"[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.\",\n  \"[HMR] Waiting for update signal from WDS...\",\n  \"Hey.\",\n]\n`;\n\nexports[`web socket server URL should work behind proxy, when hostnames are different and ports are different (\"ws\"): page errors 1`] = `[]`;\n\nexports[`web socket server URL should work behind proxy, when hostnames are different and ports are same (\"sockjs\"): console messages 1`] = `\n[\n  \"[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.\",\n  \"[HMR] Waiting for update signal from WDS...\",\n  \"Hey.\",\n]\n`;\n\nexports[`web socket server URL should work behind proxy, when hostnames are different and ports are same (\"sockjs\"): page errors 1`] = `[]`;\n\nexports[`web socket server URL should work behind proxy, when hostnames are different and ports are same (\"ws\"): console messages 1`] = `\n[\n  \"[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.\",\n  \"[HMR] Waiting for update signal from WDS...\",\n  \"Hey.\",\n]\n`;\n\nexports[`web socket server URL should work behind proxy, when hostnames are different and ports are same (\"ws\"): page errors 1`] = `[]`;\n\nexports[`web socket server URL should work behind proxy, when hostnames are same and ports are different (\"sockjs\"): console messages 1`] = `\n[\n  \"[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.\",\n  \"[HMR] Waiting for update signal from WDS...\",\n  \"Hey.\",\n]\n`;\n\nexports[`web socket server URL should work behind proxy, when hostnames are same and ports are different (\"sockjs\"): page errors 1`] = `[]`;\n\nexports[`web socket server URL should work behind proxy, when hostnames are same and ports are different (\"ws\"): console messages 1`] = `\n[\n  \"[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.\",\n  \"[HMR] Waiting for update signal from WDS...\",\n  \"Hey.\",\n]\n`;\n\nexports[`web socket server URL should work behind proxy, when hostnames are same and ports are different (\"ws\"): page errors 1`] = `[]`;\n\nexports[`web socket server URL should work behind proxy, when the \"host\" option is \"local-ip\" and the \"port\" option is \"auto\" (\"sockjs\"): console messages 1`] = `\n[\n  \"[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.\",\n  \"[HMR] Waiting for update signal from WDS...\",\n  \"Hey.\",\n]\n`;\n\nexports[`web socket server URL should work behind proxy, when the \"host\" option is \"local-ip\" and the \"port\" option is \"auto\" (\"sockjs\"): page errors 1`] = `[]`;\n\nexports[`web socket server URL should work behind proxy, when the \"host\" option is \"local-ip\" and the \"port\" option is \"auto\" (\"ws\"): console messages 1`] = `\n[\n  \"[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.\",\n  \"[HMR] Waiting for update signal from WDS...\",\n  \"Hey.\",\n]\n`;\n\nexports[`web socket server URL should work behind proxy, when the \"host\" option is \"local-ip\" and the \"port\" option is \"auto\" (\"ws\"): page errors 1`] = `[]`;\n\nexports[`web socket server URL should work when \"host\" option is \"local-ip\" (\"sockjs\"): console messages 1`] = `\n[\n  \"[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.\",\n  \"[HMR] Waiting for update signal from WDS...\",\n  \"Hey.\",\n]\n`;\n\nexports[`web socket server URL should work when \"host\" option is \"local-ip\" (\"sockjs\"): page errors 1`] = `[]`;\n\nexports[`web socket server URL should work when \"host\" option is \"local-ip\" (\"ws\"): console messages 1`] = `\n[\n  \"[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.\",\n  \"[HMR] Waiting for update signal from WDS...\",\n  \"Hey.\",\n]\n`;\n\nexports[`web socket server URL should work when \"host\" option is \"local-ip\" (\"ws\"): page errors 1`] = `[]`;\n\nexports[`web socket server URL should work when \"host\" option is \"local-ipv4\" (\"sockjs\"): console messages 1`] = `\n[\n  \"[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.\",\n  \"[HMR] Waiting for update signal from WDS...\",\n  \"Hey.\",\n]\n`;\n\nexports[`web socket server URL should work when \"host\" option is \"local-ipv4\" (\"sockjs\"): page errors 1`] = `[]`;\n\nexports[`web socket server URL should work when \"host\" option is \"local-ipv4\" (\"ws\"): console messages 1`] = `\n[\n  \"[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.\",\n  \"[HMR] Waiting for update signal from WDS...\",\n  \"Hey.\",\n]\n`;\n\nexports[`web socket server URL should work when \"host\" option is \"local-ipv4\" (\"ws\"): page errors 1`] = `[]`;\n\nexports[`web socket server URL should work when \"host\" option is IPv4 (\"sockjs\"): console messages 1`] = `\n[\n  \"[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.\",\n  \"[HMR] Waiting for update signal from WDS...\",\n  \"Hey.\",\n]\n`;\n\nexports[`web socket server URL should work when \"host\" option is IPv4 (\"sockjs\"): page errors 1`] = `[]`;\n\nexports[`web socket server URL should work when \"host\" option is IPv4 (\"ws\"): console messages 1`] = `\n[\n  \"[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.\",\n  \"[HMR] Waiting for update signal from WDS...\",\n  \"Hey.\",\n]\n`;\n\nexports[`web socket server URL should work when \"host\" option is IPv4 (\"ws\"): page errors 1`] = `[]`;\n\nexports[`web socket server URL should work when \"port\" option is \"auto\" (\"sockjs\"): console messages 1`] = `\n[\n  \"[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.\",\n  \"[HMR] Waiting for update signal from WDS...\",\n  \"Hey.\",\n]\n`;\n\nexports[`web socket server URL should work when \"port\" option is \"auto\" (\"sockjs\"): page errors 1`] = `[]`;\n\nexports[`web socket server URL should work when \"port\" option is \"auto\" (\"ws\"): console messages 1`] = `\n[\n  \"[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.\",\n  \"[HMR] Waiting for update signal from WDS...\",\n  \"Hey.\",\n]\n`;\n\nexports[`web socket server URL should work when \"port\" option is \"auto\" (\"ws\"): page errors 1`] = `[]`;\n\nexports[`web socket server URL should work with \"client.webSocketURL.*\" options (\"sockjs\"): console messages 1`] = `\n[\n  \"[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.\",\n  \"[HMR] Waiting for update signal from WDS...\",\n  \"Hey.\",\n]\n`;\n\nexports[`web socket server URL should work with \"client.webSocketURL.*\" options (\"sockjs\"): page errors 1`] = `[]`;\n\nexports[`web socket server URL should work with \"client.webSocketURL.*\" options (\"ws\"): console messages 1`] = `\n[\n  \"[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.\",\n  \"[HMR] Waiting for update signal from WDS...\",\n  \"Hey.\",\n]\n`;\n\nexports[`web socket server URL should work with \"client.webSocketURL.*\" options (\"ws\"): page errors 1`] = `[]`;\n\nexports[`web socket server URL should work with \"client.webSocketURL.port\" and \"webSocketServer.options.port\" options as string (\"sockjs\"): console messages 1`] = `\n[\n  \"[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.\",\n  \"[HMR] Waiting for update signal from WDS...\",\n  \"Hey.\",\n]\n`;\n\nexports[`web socket server URL should work with \"client.webSocketURL.port\" and \"webSocketServer.options.port\" options as string (\"sockjs\"): page errors 1`] = `[]`;\n\nexports[`web socket server URL should work with \"client.webSocketURL.port\" and \"webSocketServer.options.port\" options as string (\"ws\"): console messages 1`] = `\n[\n  \"[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.\",\n  \"[HMR] Waiting for update signal from WDS...\",\n  \"Hey.\",\n]\n`;\n\nexports[`web socket server URL should work with \"client.webSocketURL.port\" and \"webSocketServer.options.port\" options as string (\"ws\"): page errors 1`] = `[]`;\n\nexports[`web socket server URL should work with \"server: 'https'\" option (\"sockjs\"): console messages 1`] = `\n[\n  \"[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.\",\n  \"[HMR] Waiting for update signal from WDS...\",\n  \"Hey.\",\n]\n`;\n\nexports[`web socket server URL should work with \"server: 'https'\" option (\"sockjs\"): page errors 1`] = `[]`;\n\nexports[`web socket server URL should work with \"server: 'https'\" option (\"ws\"): console messages 1`] = `\n[\n  \"[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.\",\n  \"[HMR] Waiting for update signal from WDS...\",\n  \"Hey.\",\n]\n`;\n\nexports[`web socket server URL should work with \"server: 'https'\" option (\"ws\"): page errors 1`] = `[]`;\n\nexports[`web socket server URL should work with default \"/ws\" value of the \"client.webSocketURL.pathname\" option (\"sockjs\"): console messages 1`] = `\n[\n  \"[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.\",\n  \"[HMR] Waiting for update signal from WDS...\",\n  \"Hey.\",\n]\n`;\n\nexports[`web socket server URL should work with default \"/ws\" value of the \"client.webSocketURL.pathname\" option (\"sockjs\"): page errors 1`] = `[]`;\n\nexports[`web socket server URL should work with default \"/ws\" value of the \"client.webSocketURL.pathname\" option (\"ws\"): console messages 1`] = `\n[\n  \"[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.\",\n  \"[HMR] Waiting for update signal from WDS...\",\n  \"Hey.\",\n]\n`;\n\nexports[`web socket server URL should work with default \"/ws\" value of the \"client.webSocketURL.pathname\" option (\"ws\"): page errors 1`] = `[]`;\n\nexports[`web socket server URL should work with the \"client.webSocketURL\" option as \"string\" (\"sockjs\"): console messages 1`] = `\n[\n  \"[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.\",\n  \"[HMR] Waiting for update signal from WDS...\",\n  \"Hey.\",\n]\n`;\n\nexports[`web socket server URL should work with the \"client.webSocketURL\" option as \"string\" (\"sockjs\"): page errors 1`] = `[]`;\n\nexports[`web socket server URL should work with the \"client.webSocketURL\" option as \"string\" (\"ws\"): console messages 1`] = `\n[\n  \"[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.\",\n  \"[HMR] Waiting for update signal from WDS...\",\n  \"Hey.\",\n]\n`;\n\nexports[`web socket server URL should work with the \"client.webSocketURL\" option as \"string\" (\"ws\"): page errors 1`] = `[]`;\n\nexports[`web socket server URL should work with the \"client.webSocketURL.host\" option (\"sockjs\"): console messages 1`] = `\n[\n  \"[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.\",\n  \"[HMR] Waiting for update signal from WDS...\",\n  \"Hey.\",\n]\n`;\n\nexports[`web socket server URL should work with the \"client.webSocketURL.host\" option (\"sockjs\"): page errors 1`] = `[]`;\n\nexports[`web socket server URL should work with the \"client.webSocketURL.host\" option (\"ws\"): console messages 1`] = `\n[\n  \"[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.\",\n  \"[HMR] Waiting for update signal from WDS...\",\n  \"Hey.\",\n]\n`;\n\nexports[`web socket server URL should work with the \"client.webSocketURL.host\" option (\"ws\"): page errors 1`] = `[]`;\n\nexports[`web socket server URL should work with the \"client.webSocketURL.host\" option using \"0.0.0.0\" value (\"sockjs\"): console messages 1`] = `\n[\n  \"[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.\",\n  \"[HMR] Waiting for update signal from WDS...\",\n  \"Hey.\",\n]\n`;\n\nexports[`web socket server URL should work with the \"client.webSocketURL.host\" option using \"0.0.0.0\" value (\"sockjs\"): page errors 1`] = `[]`;\n\nexports[`web socket server URL should work with the \"client.webSocketURL.host\" option using \"0.0.0.0\" value (\"ws\"): console messages 1`] = `\n[\n  \"[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.\",\n  \"[HMR] Waiting for update signal from WDS...\",\n  \"Hey.\",\n]\n`;\n\nexports[`web socket server URL should work with the \"client.webSocketURL.host\" option using \"0.0.0.0\" value (\"ws\"): page errors 1`] = `[]`;\n\nexports[`web socket server URL should work with the \"client.webSocketURL.password\" option (\"sockjs\"): console messages 1`] = `\n[\n  \"[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.\",\n  \"[HMR] Waiting for update signal from WDS...\",\n  \"Hey.\",\n]\n`;\n\nexports[`web socket server URL should work with the \"client.webSocketURL.password\" option (\"sockjs\"): page errors 1`] = `[]`;\n\nexports[`web socket server URL should work with the \"client.webSocketURL.password\" option (\"ws\"): console messages 1`] = `\n[\n  \"[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.\",\n  \"[HMR] Waiting for update signal from WDS...\",\n  \"Hey.\",\n]\n`;\n\nexports[`web socket server URL should work with the \"client.webSocketURL.password\" option (\"ws\"): page errors 1`] = `[]`;\n\nexports[`web socket server URL should work with the \"client.webSocketURL.pathname\" option (\"sockjs\"): console messages 1`] = `\n[\n  \"[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.\",\n  \"[HMR] Waiting for update signal from WDS...\",\n  \"Hey.\",\n]\n`;\n\nexports[`web socket server URL should work with the \"client.webSocketURL.pathname\" option (\"sockjs\"): page errors 1`] = `[]`;\n\nexports[`web socket server URL should work with the \"client.webSocketURL.pathname\" option (\"ws\"): console messages 1`] = `\n[\n  \"[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.\",\n  \"[HMR] Waiting for update signal from WDS...\",\n  \"Hey.\",\n]\n`;\n\nexports[`web socket server URL should work with the \"client.webSocketURL.pathname\" option (\"ws\"): page errors 1`] = `[]`;\n\nexports[`web socket server URL should work with the \"client.webSocketURL.pathname\" option and the custom web socket server \"path\" (\"sockjs\"): console messages 1`] = `\n[\n  \"[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.\",\n  \"[HMR] Waiting for update signal from WDS...\",\n  \"Hey.\",\n]\n`;\n\nexports[`web socket server URL should work with the \"client.webSocketURL.pathname\" option and the custom web socket server \"path\" (\"sockjs\"): page errors 1`] = `[]`;\n\nexports[`web socket server URL should work with the \"client.webSocketURL.pathname\" option and the custom web socket server \"path\" (\"ws\"): console messages 1`] = `\n[\n  \"[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.\",\n  \"[HMR] Waiting for update signal from WDS...\",\n  \"Hey.\",\n]\n`;\n\nexports[`web socket server URL should work with the \"client.webSocketURL.pathname\" option and the custom web socket server \"path\" (\"ws\"): page errors 1`] = `[]`;\n\nexports[`web socket server URL should work with the \"client.webSocketURL.pathname\" option and the custom web socket server \"path\" ending with slash (\"sockjs\"): console messages 1`] = `\n[\n  \"[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.\",\n  \"[HMR] Waiting for update signal from WDS...\",\n  \"Hey.\",\n]\n`;\n\nexports[`web socket server URL should work with the \"client.webSocketURL.pathname\" option and the custom web socket server \"path\" ending with slash (\"sockjs\"): page errors 1`] = `[]`;\n\nexports[`web socket server URL should work with the \"client.webSocketURL.pathname\" option and the custom web socket server \"path\" ending with slash (\"ws\"): console messages 1`] = `\n[\n  \"[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.\",\n  \"[HMR] Waiting for update signal from WDS...\",\n  \"Hey.\",\n]\n`;\n\nexports[`web socket server URL should work with the \"client.webSocketURL.pathname\" option and the custom web socket server \"path\" ending with slash (\"ws\"): page errors 1`] = `[]`;\n\nexports[`web socket server URL should work with the \"client.webSocketURL.pathname\" option and the custom web socket server \"path\" ending without slash (\"sockjs\"): console messages 1`] = `\n[\n  \"[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.\",\n  \"[HMR] Waiting for update signal from WDS...\",\n  \"Hey.\",\n]\n`;\n\nexports[`web socket server URL should work with the \"client.webSocketURL.pathname\" option and the custom web socket server \"path\" ending without slash (\"sockjs\"): page errors 1`] = `[]`;\n\nexports[`web socket server URL should work with the \"client.webSocketURL.pathname\" option and the custom web socket server \"path\" ending without slash (\"ws\"): console messages 1`] = `\n[\n  \"[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.\",\n  \"[HMR] Waiting for update signal from WDS...\",\n  \"Hey.\",\n]\n`;\n\nexports[`web socket server URL should work with the \"client.webSocketURL.pathname\" option and the custom web socket server \"path\" ending without slash (\"ws\"): page errors 1`] = `[]`;\n\nexports[`web socket server URL should work with the \"client.webSocketURL.pathname\" option and the custom web socket server \"path\" using empty value (\"sockjs\"): console messages 1`] = `\n[\n  \"[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.\",\n  \"[HMR] Waiting for update signal from WDS...\",\n  \"Hey.\",\n]\n`;\n\nexports[`web socket server URL should work with the \"client.webSocketURL.pathname\" option and the custom web socket server \"path\" using empty value (\"sockjs\"): page errors 1`] = `[]`;\n\nexports[`web socket server URL should work with the \"client.webSocketURL.pathname\" option and the custom web socket server \"path\" using empty value (\"ws\"): console messages 1`] = `\n[\n  \"[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.\",\n  \"[HMR] Waiting for update signal from WDS...\",\n  \"Hey.\",\n]\n`;\n\nexports[`web socket server URL should work with the \"client.webSocketURL.pathname\" option and the custom web socket server \"path\" using empty value (\"ws\"): page errors 1`] = `[]`;\n\nexports[`web socket server URL should work with the \"client.webSocketURL.pathname\" option and the custom web socket server \"prefix\" for compatibility with \"sockjs\" (\"sockjs\"): console messages 1`] = `\n[\n  \"[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.\",\n  \"[HMR] Waiting for update signal from WDS...\",\n  \"Hey.\",\n]\n`;\n\nexports[`web socket server URL should work with the \"client.webSocketURL.pathname\" option and the custom web socket server \"prefix\" for compatibility with \"sockjs\" (\"sockjs\"): page errors 1`] = `[]`;\n\nexports[`web socket server URL should work with the \"client.webSocketURL.pathname\" option and the custom web socket server \"prefix\" for compatibility with \"sockjs\" (\"ws\"): console messages 1`] = `\n[\n  \"[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.\",\n  \"[HMR] Waiting for update signal from WDS...\",\n  \"Hey.\",\n]\n`;\n\nexports[`web socket server URL should work with the \"client.webSocketURL.pathname\" option and the custom web socket server \"prefix\" for compatibility with \"sockjs\" (\"ws\"): page errors 1`] = `[]`;\n\nexports[`web socket server URL should work with the \"client.webSocketURL.port\" option (\"sockjs\"): console messages 1`] = `\n[\n  \"[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.\",\n  \"[HMR] Waiting for update signal from WDS...\",\n  \"Hey.\",\n]\n`;\n\nexports[`web socket server URL should work with the \"client.webSocketURL.port\" option (\"sockjs\"): page errors 1`] = `[]`;\n\nexports[`web socket server URL should work with the \"client.webSocketURL.port\" option (\"ws\"): console messages 1`] = `\n[\n  \"[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.\",\n  \"[HMR] Waiting for update signal from WDS...\",\n  \"Hey.\",\n]\n`;\n\nexports[`web socket server URL should work with the \"client.webSocketURL.port\" option (\"ws\"): page errors 1`] = `[]`;\n\nexports[`web socket server URL should work with the \"client.webSocketURL.port\" option as string (\"sockjs\"): console messages 1`] = `\n[\n  \"[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.\",\n  \"[HMR] Waiting for update signal from WDS...\",\n  \"Hey.\",\n]\n`;\n\nexports[`web socket server URL should work with the \"client.webSocketURL.port\" option as string (\"sockjs\"): page errors 1`] = `[]`;\n\nexports[`web socket server URL should work with the \"client.webSocketURL.port\" option as string (\"ws\"): console messages 1`] = `\n[\n  \"[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.\",\n  \"[HMR] Waiting for update signal from WDS...\",\n  \"Hey.\",\n]\n`;\n\nexports[`web socket server URL should work with the \"client.webSocketURL.port\" option as string (\"ws\"): page errors 1`] = `[]`;\n\nexports[`web socket server URL should work with the \"client.webSocketURL.port\" option using \"0\" value (\"sockjs\"): console messages 1`] = `\n[\n  \"[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.\",\n  \"[HMR] Waiting for update signal from WDS...\",\n  \"Hey.\",\n]\n`;\n\nexports[`web socket server URL should work with the \"client.webSocketURL.port\" option using \"0\" value (\"sockjs\"): page errors 1`] = `[]`;\n\nexports[`web socket server URL should work with the \"client.webSocketURL.port\" option using \"0\" value (\"ws\"): console messages 1`] = `\n[\n  \"[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.\",\n  \"[HMR] Waiting for update signal from WDS...\",\n  \"Hey.\",\n]\n`;\n\nexports[`web socket server URL should work with the \"client.webSocketURL.port\" option using \"0\" value (\"ws\"): page errors 1`] = `[]`;\n\nexports[`web socket server URL should work with the \"client.webSocketURL.protocol\" option (\"sockjs\"): console messages 1`] = `\n[\n  \"[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.\",\n  \"[HMR] Waiting for update signal from WDS...\",\n  \"Hey.\",\n]\n`;\n\nexports[`web socket server URL should work with the \"client.webSocketURL.protocol\" option (\"sockjs\"): page errors 1`] = `[]`;\n\nexports[`web socket server URL should work with the \"client.webSocketURL.protocol\" option (\"ws\"): console messages 1`] = `\n[\n  \"[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.\",\n  \"[HMR] Waiting for update signal from WDS...\",\n  \"Hey.\",\n]\n`;\n\nexports[`web socket server URL should work with the \"client.webSocketURL.protocol\" option (\"ws\"): page errors 1`] = `[]`;\n\nexports[`web socket server URL should work with the \"client.webSocketURL.protocol\" option using \"auto:\" value (\"sockjs\"): console messages 1`] = `\n[\n  \"[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.\",\n  \"[HMR] Waiting for update signal from WDS...\",\n  \"Hey.\",\n]\n`;\n\nexports[`web socket server URL should work with the \"client.webSocketURL.protocol\" option using \"auto:\" value (\"sockjs\"): page errors 1`] = `[]`;\n\nexports[`web socket server URL should work with the \"client.webSocketURL.protocol\" option using \"auto:\" value (\"ws\"): console messages 1`] = `\n[\n  \"[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.\",\n  \"[HMR] Waiting for update signal from WDS...\",\n  \"Hey.\",\n]\n`;\n\nexports[`web socket server URL should work with the \"client.webSocketURL.protocol\" option using \"auto:\" value (\"ws\"): page errors 1`] = `[]`;\n\nexports[`web socket server URL should work with the \"client.webSocketURL.protocol\" option using \"http:\" value and convert to \"ws:\" (\"sockjs\"): console messages 1`] = `\n[\n  \"[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.\",\n  \"[HMR] Waiting for update signal from WDS...\",\n  \"Hey.\",\n]\n`;\n\nexports[`web socket server URL should work with the \"client.webSocketURL.protocol\" option using \"http:\" value and convert to \"ws:\" (\"sockjs\"): page errors 1`] = `[]`;\n\nexports[`web socket server URL should work with the \"client.webSocketURL.protocol\" option using \"http:\" value and convert to \"ws:\" (\"ws\"): console messages 1`] = `\n[\n  \"[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.\",\n  \"[HMR] Waiting for update signal from WDS...\",\n  \"Hey.\",\n]\n`;\n\nexports[`web socket server URL should work with the \"client.webSocketURL.protocol\" option using \"http:\" value and convert to \"ws:\" (\"ws\"): page errors 1`] = `[]`;\n\nexports[`web socket server URL should work with the \"client.webSocketURL.username\" and \"client.webSocketURL.password\" option (\"sockjs\"): console messages 1`] = `\n[\n  \"[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.\",\n  \"[HMR] Waiting for update signal from WDS...\",\n  \"Hey.\",\n]\n`;\n\nexports[`web socket server URL should work with the \"client.webSocketURL.username\" and \"client.webSocketURL.password\" option (\"sockjs\"): page errors 1`] = `[]`;\n\nexports[`web socket server URL should work with the \"client.webSocketURL.username\" and \"client.webSocketURL.password\" option (\"ws\"): console messages 1`] = `\n[\n  \"[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.\",\n  \"[HMR] Waiting for update signal from WDS...\",\n  \"Hey.\",\n]\n`;\n\nexports[`web socket server URL should work with the \"client.webSocketURL.username\" and \"client.webSocketURL.password\" option (\"ws\"): page errors 1`] = `[]`;\n\nexports[`web socket server URL should work with the \"client.webSocketURL.username\" option (\"sockjs\"): console messages 1`] = `\n[\n  \"[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.\",\n  \"[HMR] Waiting for update signal from WDS...\",\n  \"Hey.\",\n]\n`;\n\nexports[`web socket server URL should work with the \"client.webSocketURL.username\" option (\"sockjs\"): page errors 1`] = `[]`;\n\nexports[`web socket server URL should work with the \"client.webSocketURL.username\" option (\"ws\"): console messages 1`] = `\n[\n  \"[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.\",\n  \"[HMR] Waiting for update signal from WDS...\",\n  \"Hey.\",\n]\n`;\n\nexports[`web socket server URL should work with the \"client.webSocketURL.username\" option (\"ws\"): page errors 1`] = `[]`;\n\nexports[`web socket server URL should work with the custom web socket server \"path\" (\"sockjs\"): console messages 1`] = `\n[\n  \"[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.\",\n  \"[HMR] Waiting for update signal from WDS...\",\n  \"Hey.\",\n]\n`;\n\nexports[`web socket server URL should work with the custom web socket server \"path\" (\"sockjs\"): page errors 1`] = `[]`;\n\nexports[`web socket server URL should work with the custom web socket server \"path\" (\"ws\"): console messages 1`] = `\n[\n  \"[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.\",\n  \"[HMR] Waiting for update signal from WDS...\",\n  \"Hey.\",\n]\n`;\n\nexports[`web socket server URL should work with the custom web socket server \"path\" (\"ws\"): page errors 1`] = `[]`;\n\nexports[`web socket server URL should work with the custom web socket server \"path\" using empty value (\"sockjs\"): console messages 1`] = `\n[\n  \"[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.\",\n  \"[HMR] Waiting for update signal from WDS...\",\n  \"Hey.\",\n]\n`;\n\nexports[`web socket server URL should work with the custom web socket server \"path\" using empty value (\"sockjs\"): page errors 1`] = `[]`;\n\nexports[`web socket server URL should work with the custom web socket server \"path\" using empty value (\"ws\"): console messages 1`] = `\n[\n  \"[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.\",\n  \"[HMR] Waiting for update signal from WDS...\",\n  \"Hey.\",\n]\n`;\n\nexports[`web socket server URL should work with the custom web socket server \"path\" using empty value (\"ws\"): page errors 1`] = `[]`;\n"
  },
  {
    "path": "test/e2e/__snapshots__/web-socket-server.test.js.snap.webpack5",
    "content": "// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing\n\nexports[`web socket server should work allow to disable: console messages 1`] = `\n[\n  \"Hey.\",\n]\n`;\n\nexports[`web socket server should work allow to disable: page errors 1`] = `[]`;\n"
  },
  {
    "path": "test/e2e/allowed-hosts.test.js",
    "content": "\"use strict\";\n\nconst express = require(\"express\");\nconst { createProxyMiddleware } = require(\"http-proxy-middleware\");\nconst webpack = require(\"webpack\");\nconst Server = require(\"../../lib/Server\");\nconst config = require(\"../fixtures/client-config/webpack.config\");\nconst runBrowser = require(\"../helpers/run-browser\");\nconst [port1, port2] = require(\"../ports-map\")[\"allowed-hosts\"];\n\nconst webSocketServers = [\"ws\", \"sockjs\"];\n\ndescribe(\"allowed hosts\", () => {\n  for (const webSocketServer of webSocketServers) {\n    it(`should connect web socket client using localhost to web socket server with the \"auto\" value (\"${webSocketServer}\")`, async () => {\n      const devServerHost = \"localhost\";\n      const devServerPort = port1;\n      const proxyHost = devServerHost;\n      const proxyPort = port2;\n\n      const compiler = webpack(config);\n      const devServerOptions = {\n        client: {\n          webSocketURL: {\n            port: port2,\n          },\n        },\n        webSocketServer,\n        port: devServerPort,\n        host: devServerHost,\n        allowedHosts: \"auto\",\n      };\n      const server = new Server(devServerOptions, compiler);\n\n      await server.start();\n\n      function startProxy(callback) {\n        const app = express();\n\n        app.use(\n          \"/\",\n          createProxyMiddleware({\n            target: `http://${devServerHost}:${devServerPort}`,\n            ws: true,\n            changeOrigin: true,\n            logLevel: \"warn\",\n          }),\n        );\n\n        return app.listen(proxyPort, proxyHost, callback);\n      }\n\n      const proxy = await new Promise((resolve) => {\n        const proxyCreated = startProxy(() => {\n          resolve(proxyCreated);\n        });\n      });\n\n      const { page, browser } = await runBrowser();\n      try {\n        const pageErrors = [];\n        const consoleMessages = [];\n\n        page\n          .on(\"console\", (message) => {\n            consoleMessages.push(message);\n          })\n          .on(\"pageerror\", (error) => {\n            pageErrors.push(error);\n          });\n\n        await page.goto(`http://${proxyHost}:${proxyPort}/`, {\n          waitUntil: \"networkidle0\",\n        });\n\n        expect(\n          consoleMessages.map((message) => message.text()),\n        ).toMatchSnapshot(\"console messages\");\n        expect(pageErrors).toMatchSnapshot(\"page errors\");\n      } finally {\n        proxy.close();\n\n        await browser.close();\n        await server.stop();\n      }\n    });\n\n    it(`should connect web socket client using \"localhost\" host to web socket server by default (\"${webSocketServer}\")`, async () => {\n      const devServerHost = \"localhost\";\n      const devServerPort = port1;\n      const proxyHost = devServerHost;\n      const proxyPort = port2;\n\n      const compiler = webpack(config);\n      const devServerOptions = {\n        client: {\n          webSocketURL: {\n            port: port2,\n          },\n        },\n        webSocketServer,\n        port: devServerPort,\n        host: devServerHost,\n      };\n      const server = new Server(devServerOptions, compiler);\n\n      await server.start();\n\n      function startProxy(callback) {\n        const app = express();\n\n        app.use(\n          \"/\",\n          createProxyMiddleware({\n            target: `http://${devServerHost}:${devServerPort}`,\n            ws: true,\n            changeOrigin: true,\n            logLevel: \"warn\",\n          }),\n        );\n\n        return app.listen(proxyPort, proxyHost, callback);\n      }\n\n      const proxy = await new Promise((resolve) => {\n        const proxyCreated = startProxy(() => {\n          resolve(proxyCreated);\n        });\n      });\n\n      const { page, browser } = await runBrowser();\n\n      try {\n        const pageErrors = [];\n        const consoleMessages = [];\n\n        page\n          .on(\"console\", (message) => {\n            consoleMessages.push(message);\n          })\n          .on(\"pageerror\", (error) => {\n            pageErrors.push(error);\n          });\n\n        await page.goto(`http://${proxyHost}:${proxyPort}/`, {\n          waitUntil: \"networkidle0\",\n        });\n\n        expect(\n          consoleMessages.map((message) => message.text()),\n        ).toMatchSnapshot(\"console messages\");\n        expect(pageErrors).toMatchSnapshot(\"page errors\");\n      } finally {\n        proxy.close();\n\n        await browser.close();\n        await server.stop();\n      }\n    });\n\n    it(`should connect web socket client using \"127.0.0.1\" host to web socket server by default (\"${webSocketServer}\")`, async () => {\n      const devServerHost = \"127.0.0.1\";\n      const devServerPort = port1;\n      const proxyHost = devServerHost;\n      const proxyPort = port2;\n\n      const compiler = webpack(config);\n      const devServerOptions = {\n        client: {\n          webSocketURL: {\n            port: port2,\n          },\n        },\n        webSocketServer,\n        port: devServerPort,\n        host: devServerHost,\n      };\n      const server = new Server(devServerOptions, compiler);\n\n      await server.start();\n\n      function startProxy(callback) {\n        const app = express();\n\n        app.use(\n          \"/\",\n          createProxyMiddleware({\n            target: `http://${devServerHost}:${devServerPort}`,\n            ws: true,\n            changeOrigin: true,\n            logLevel: \"warn\",\n          }),\n        );\n\n        return app.listen(proxyPort, proxyHost, callback);\n      }\n\n      const proxy = await new Promise((resolve) => {\n        const proxyCreated = startProxy(() => {\n          resolve(proxyCreated);\n        });\n      });\n\n      const { page, browser } = await runBrowser();\n\n      try {\n        const pageErrors = [];\n        const consoleMessages = [];\n\n        page\n          .on(\"console\", (message) => {\n            consoleMessages.push(message);\n          })\n          .on(\"pageerror\", (error) => {\n            pageErrors.push(error);\n          });\n\n        await page.goto(`http://${proxyHost}:${proxyPort}/`, {\n          waitUntil: \"networkidle0\",\n        });\n\n        expect(\n          consoleMessages.map((message) => message.text()),\n        ).toMatchSnapshot(\"console messages\");\n        expect(pageErrors).toMatchSnapshot(\"page errors\");\n      } finally {\n        proxy.close();\n\n        await browser.close();\n        await server.stop();\n      }\n    });\n\n    it(`should connect web socket client using \"127.0.0.1\" host to web socket server with the \"auto\" value (\"${webSocketServer}\")`, async () => {\n      const devServerHost = \"127.0.0.1\";\n      const devServerPort = port1;\n      const proxyHost = devServerHost;\n      const proxyPort = port2;\n\n      const compiler = webpack(config);\n      const devServerOptions = {\n        client: {\n          webSocketURL: {\n            port: port2,\n          },\n        },\n        webSocketServer,\n        port: devServerPort,\n        host: devServerHost,\n        allowedHosts: \"auto\",\n      };\n      const server = new Server(devServerOptions, compiler);\n\n      await server.start();\n\n      function startProxy(callback) {\n        const app = express();\n\n        app.use(\n          \"/\",\n          createProxyMiddleware({\n            target: `http://${devServerHost}:${devServerPort}`,\n            ws: true,\n            changeOrigin: true,\n            logLevel: \"warn\",\n          }),\n        );\n\n        return app.listen(proxyPort, proxyHost, callback);\n      }\n\n      const proxy = await new Promise((resolve) => {\n        const proxyCreated = startProxy(() => {\n          resolve(proxyCreated);\n        });\n      });\n\n      const { page, browser } = await runBrowser();\n\n      try {\n        const pageErrors = [];\n        const consoleMessages = [];\n\n        page\n          .on(\"console\", (message) => {\n            consoleMessages.push(message);\n          })\n          .on(\"pageerror\", (error) => {\n            pageErrors.push(error);\n          });\n\n        await page.goto(`http://${proxyHost}:${proxyPort}/`, {\n          waitUntil: \"networkidle0\",\n        });\n\n        expect(\n          consoleMessages.map((message) => message.text()),\n        ).toMatchSnapshot(\"console messages\");\n        expect(pageErrors).toMatchSnapshot(\"page errors\");\n      } finally {\n        proxy.close();\n\n        await browser.close();\n        await server.stop();\n      }\n    });\n\n    it(`should connect web socket client using \"[::1] host to web socket server with the \"auto\" value (\"${webSocketServer}\")`, async () => {\n      const devServerHost = \"::1\";\n      const devServerPort = port1;\n      const proxyHost = devServerHost;\n      const proxyPort = port2;\n\n      const compiler = webpack(config);\n      const devServerOptions = {\n        client: {\n          webSocketURL: {\n            port: port2,\n          },\n        },\n        webSocketServer,\n        port: devServerPort,\n        host: devServerHost,\n        allowedHosts: \"auto\",\n      };\n      const server = new Server(devServerOptions, compiler);\n\n      await server.start();\n\n      function startProxy(callback) {\n        const app = express();\n\n        app.use(\n          \"/\",\n          createProxyMiddleware({\n            target: `http://[${devServerHost}]:${devServerPort}`,\n            ws: true,\n            changeOrigin: true,\n            logLevel: \"warn\",\n          }),\n        );\n\n        return app.listen(proxyPort, proxyHost, callback);\n      }\n\n      const proxy = await new Promise((resolve) => {\n        const proxyCreated = startProxy(() => {\n          resolve(proxyCreated);\n        });\n      });\n\n      const { page, browser } = await runBrowser();\n\n      try {\n        const pageErrors = [];\n        const consoleMessages = [];\n\n        page\n          .on(\"console\", (message) => {\n            consoleMessages.push(message);\n          })\n          .on(\"pageerror\", (error) => {\n            pageErrors.push(error);\n          });\n\n        await page.goto(`http://[${proxyHost}]:${proxyPort}/`, {\n          waitUntil: \"networkidle0\",\n        });\n\n        expect(\n          consoleMessages.map((message) => message.text()),\n        ).toMatchSnapshot(\"console messages\");\n        expect(pageErrors).toMatchSnapshot(\"page errors\");\n      } finally {\n        proxy.close();\n\n        await browser.close();\n        await server.stop();\n      }\n    });\n\n    it(`should connect web socket client using \"0.0.0.0\" host to web socket server with the \"auto\" value (\"${webSocketServer}\")`, async () => {\n      const devServerHost = \"0.0.0.0\";\n      const IPv4 = Server.findIp(\"v4\");\n      const devServerPort = port1;\n      const proxyHost = IPv4;\n      const proxyPort = port2;\n\n      const compiler = webpack(config);\n      const devServerOptions = {\n        client: {\n          webSocketURL: {\n            port: port2,\n          },\n        },\n        webSocketServer,\n        port: devServerPort,\n        host: devServerHost,\n        allowedHosts: \"auto\",\n      };\n      const server = new Server(devServerOptions, compiler);\n\n      await server.start();\n\n      function startProxy(callback) {\n        const app = express();\n\n        app.use(\n          \"/\",\n          createProxyMiddleware({\n            target: `http://${IPv4}:${devServerPort}`,\n            ws: true,\n            changeOrigin: true,\n            logLevel: \"warn\",\n          }),\n        );\n\n        return app.listen(proxyPort, proxyHost, callback);\n      }\n\n      const proxy = await new Promise((resolve) => {\n        const proxyCreated = startProxy(() => {\n          resolve(proxyCreated);\n        });\n      });\n\n      const { page, browser } = await runBrowser();\n\n      try {\n        const pageErrors = [];\n        const consoleMessages = [];\n\n        page\n          .on(\"console\", (message) => {\n            consoleMessages.push(message);\n          })\n          .on(\"pageerror\", (error) => {\n            pageErrors.push(error);\n          });\n\n        await page.goto(`http://${proxyHost}:${proxyPort}/`, {\n          waitUntil: \"networkidle0\",\n        });\n\n        expect(\n          consoleMessages.map((message) => message.text()),\n        ).toMatchSnapshot(\"console messages\");\n        expect(pageErrors).toMatchSnapshot(\"page errors\");\n      } finally {\n        proxy.close();\n\n        await browser.close();\n        await server.stop();\n      }\n    });\n\n    it(`should connect web socket client using \"file:\" protocol to web socket server with the \"auto\" value (\"${webSocketServer}\")`, async () => {\n      const devServerHost = \"127.0.0.1\";\n      const devServerPort = port1;\n      const proxyHost = devServerHost;\n      const proxyPort = port2;\n\n      const compiler = webpack(config);\n      const devServerOptions = {\n        client: {\n          webSocketURL: {\n            port: port2,\n          },\n        },\n        webSocketServer,\n        port: devServerPort,\n        host: devServerHost,\n        allowedHosts: \"auto\",\n      };\n      const server = new Server(devServerOptions, compiler);\n\n      await server.start();\n\n      function startProxy(callback) {\n        const app = express();\n\n        app.use(\n          \"/\",\n          createProxyMiddleware({\n            target: `http://${devServerHost}:${devServerPort}`,\n            onProxyReqWs: (proxyReq) => {\n              proxyReq.setHeader(\"origin\", \"file:///path/to/local/file.js\");\n            },\n            ws: true,\n            changeOrigin: true,\n            logLevel: \"warn\",\n          }),\n        );\n\n        return app.listen(proxyPort, proxyHost, callback);\n      }\n\n      const proxy = await new Promise((resolve) => {\n        const proxyCreated = startProxy(() => {\n          resolve(proxyCreated);\n        });\n      });\n\n      const { page, browser } = await runBrowser();\n\n      try {\n        const pageErrors = [];\n        const consoleMessages = [];\n\n        page\n          .on(\"console\", (message) => {\n            consoleMessages.push(message);\n          })\n          .on(\"pageerror\", (error) => {\n            pageErrors.push(error);\n          });\n\n        await page.goto(`http://${proxyHost}:${proxyPort}/`, {\n          waitUntil: \"networkidle0\",\n        });\n\n        expect(\n          consoleMessages.map((message) => message.text()),\n        ).toMatchSnapshot(\"console messages\");\n        expect(pageErrors).toMatchSnapshot(\"page errors\");\n      } finally {\n        proxy.close();\n\n        await browser.close();\n        await server.stop();\n      }\n    });\n\n    it(`should connect web socket client using \"chrome-extension:\" protocol to web socket server with the \"auto\" value (\"${webSocketServer}\")`, async () => {\n      const devServerHost = \"127.0.0.1\";\n      const devServerPort = port1;\n      const proxyHost = devServerHost;\n      const proxyPort = port2;\n\n      const compiler = webpack(config);\n      const devServerOptions = {\n        client: {\n          webSocketURL: {\n            port: port2,\n          },\n        },\n        webSocketServer,\n        port: devServerPort,\n        host: devServerHost,\n        allowedHosts: \"auto\",\n      };\n      const server = new Server(devServerOptions, compiler);\n\n      await server.start();\n\n      function startProxy(callback) {\n        const app = express();\n\n        app.use(\n          \"/\",\n          createProxyMiddleware({\n            target: `http://${devServerHost}:${devServerPort}`,\n            onProxyReqWs: (proxyReq) => {\n              proxyReq.setHeader(\"origin\", \"chrome-extension:///abcdef\");\n            },\n            ws: true,\n            changeOrigin: true,\n            logLevel: \"warn\",\n          }),\n        );\n\n        return app.listen(proxyPort, proxyHost, callback);\n      }\n\n      const proxy = await new Promise((resolve) => {\n        const proxyCreated = startProxy(() => {\n          resolve(proxyCreated);\n        });\n      });\n\n      const { page, browser } = await runBrowser();\n\n      try {\n        const pageErrors = [];\n        const consoleMessages = [];\n\n        page\n          .on(\"console\", (message) => {\n            consoleMessages.push(message);\n          })\n          .on(\"pageerror\", (error) => {\n            pageErrors.push(error);\n          });\n\n        await page.goto(`http://${proxyHost}:${proxyPort}/`, {\n          waitUntil: \"networkidle0\",\n        });\n\n        expect(\n          consoleMessages.map((message) => message.text()),\n        ).toMatchSnapshot(\"console messages\");\n        expect(pageErrors).toMatchSnapshot(\"page errors\");\n      } finally {\n        proxy.close();\n\n        await browser.close();\n        await server.stop();\n      }\n    });\n\n    it(`should connect web socket client using custom hostname to web socket server with the \"all\" value (\"${webSocketServer}\")`, async () => {\n      const devServerHost = \"127.0.0.1\";\n      const devServerPort = port1;\n      const proxyHost = devServerHost;\n      const proxyPort = port2;\n\n      const compiler = webpack(config);\n      const devServerOptions = {\n        client: {\n          webSocketURL: {\n            port: port2,\n          },\n        },\n        webSocketServer,\n        port: devServerPort,\n        host: devServerHost,\n        allowedHosts: \"all\",\n      };\n      const server = new Server(devServerOptions, compiler);\n\n      await server.start();\n\n      function startProxy(callback) {\n        const app = express();\n\n        app.use(\n          \"/\",\n          createProxyMiddleware({\n            // Emulation\n            onProxyReqWs: (proxyReq) => {\n              proxyReq.setHeader(\"origin\", \"http://my-test-origin.com/\");\n            },\n            target: `http://${devServerHost}:${devServerPort}`,\n            ws: true,\n            changeOrigin: true,\n            logLevel: \"warn\",\n          }),\n        );\n\n        return app.listen(proxyPort, proxyHost, callback);\n      }\n\n      const proxy = await new Promise((resolve) => {\n        const proxyCreated = startProxy(() => {\n          resolve(proxyCreated);\n        });\n      });\n\n      const { page, browser } = await runBrowser();\n\n      try {\n        const pageErrors = [];\n        const consoleMessages = [];\n\n        page\n          .on(\"console\", (message) => {\n            consoleMessages.push(message);\n          })\n          .on(\"pageerror\", (error) => {\n            pageErrors.push(error);\n          });\n\n        await page.goto(`http://${proxyHost}:${proxyPort}/`, {\n          waitUntil: \"networkidle0\",\n        });\n\n        expect(\n          consoleMessages.map((message) => message.text()),\n        ).toMatchSnapshot(\"console messages\");\n        expect(pageErrors).toMatchSnapshot(\"page errors\");\n      } finally {\n        proxy.close();\n\n        await browser.close();\n        await server.stop();\n      }\n    });\n\n    it(`should connect web socket client using custom hostname to web socket server with the \"all\" value in array (\"${webSocketServer}\")`, async () => {\n      const devServerHost = \"127.0.0.1\";\n      const devServerPort = port1;\n      const proxyHost = devServerHost;\n      const proxyPort = port2;\n\n      const compiler = webpack(config);\n      const devServerOptions = {\n        client: {\n          webSocketURL: {\n            port: port2,\n          },\n        },\n        webSocketServer,\n        port: devServerPort,\n        host: devServerHost,\n        allowedHosts: [\"all\"],\n      };\n      const server = new Server(devServerOptions, compiler);\n\n      await server.start();\n\n      function startProxy(callback) {\n        const app = express();\n\n        app.use(\n          \"/\",\n          createProxyMiddleware({\n            // Emulation\n            onProxyReqWs: (proxyReq) => {\n              proxyReq.setHeader(\"origin\", \"http://my-test-origin.com/\");\n            },\n            target: `http://${devServerHost}:${devServerPort}`,\n            ws: true,\n            changeOrigin: true,\n            logLevel: \"warn\",\n          }),\n        );\n\n        return app.listen(proxyPort, proxyHost, callback);\n      }\n\n      const proxy = await new Promise((resolve) => {\n        const proxyCreated = startProxy(() => {\n          resolve(proxyCreated);\n        });\n      });\n\n      const { page, browser } = await runBrowser();\n\n      try {\n        const pageErrors = [];\n        const consoleMessages = [];\n\n        page\n          .on(\"console\", (message) => {\n            consoleMessages.push(message);\n          })\n          .on(\"pageerror\", (error) => {\n            pageErrors.push(error);\n          });\n\n        await page.goto(`http://${proxyHost}:${proxyPort}/`, {\n          waitUntil: \"networkidle0\",\n        });\n\n        expect(\n          consoleMessages.map((message) => message.text()),\n        ).toMatchSnapshot(\"console messages\");\n        expect(pageErrors).toMatchSnapshot(\"page errors\");\n      } finally {\n        proxy.close();\n\n        await browser.close();\n        await server.stop();\n      }\n    });\n\n    it(`should connect web socket client using custom hostname to web socket server with the custom hostname value (\"${webSocketServer}\")`, async () => {\n      const devServerHost = \"127.0.0.1\";\n      const devServerPort = port1;\n      const proxyHost = devServerHost;\n      const proxyPort = port2;\n\n      const compiler = webpack(config);\n      const devServerOptions = {\n        client: {\n          webSocketURL: {\n            port: port2,\n          },\n        },\n        webSocketServer,\n        port: devServerPort,\n        host: devServerHost,\n        allowedHosts: \"my-test-origin.com\",\n      };\n      const server = new Server(devServerOptions, compiler);\n\n      await server.start();\n\n      function startProxy(callback) {\n        const app = express();\n\n        app.use(\n          \"/\",\n          createProxyMiddleware({\n            // Emulation\n            onProxyReqWs: (proxyReq) => {\n              proxyReq.setHeader(\"origin\", \"http://my-test-origin.com/\");\n            },\n            target: `http://${devServerHost}:${devServerPort}`,\n            ws: true,\n            changeOrigin: true,\n            logLevel: \"warn\",\n          }),\n        );\n\n        return app.listen(proxyPort, proxyHost, callback);\n      }\n\n      const proxy = await new Promise((resolve) => {\n        const proxyCreated = startProxy(() => {\n          resolve(proxyCreated);\n        });\n      });\n\n      const { page, browser } = await runBrowser();\n\n      try {\n        const pageErrors = [];\n        const consoleMessages = [];\n\n        page\n          .on(\"console\", (message) => {\n            consoleMessages.push(message);\n          })\n          .on(\"pageerror\", (error) => {\n            pageErrors.push(error);\n          });\n\n        await page.goto(`http://${proxyHost}:${proxyPort}/`, {\n          waitUntil: \"networkidle0\",\n        });\n\n        expect(\n          consoleMessages.map((message) => message.text()),\n        ).toMatchSnapshot(\"console messages\");\n        expect(pageErrors).toMatchSnapshot(\"page errors\");\n      } finally {\n        proxy.close();\n\n        await browser.close();\n        await server.stop();\n      }\n    });\n\n    it(`should connect web socket client using custom hostname to web socket server with the custom hostname value starting with dot (\"${webSocketServer}\")`, async () => {\n      const devServerHost = \"127.0.0.1\";\n      const devServerPort = port1;\n      const proxyHost = devServerHost;\n      const proxyPort = port2;\n\n      const compiler = webpack(config);\n      const devServerOptions = {\n        client: {\n          webSocketURL: {\n            port: port2,\n          },\n        },\n        webSocketServer,\n        port: devServerPort,\n        host: devServerHost,\n        allowedHosts: \".my-test-origin.com\",\n      };\n      const server = new Server(devServerOptions, compiler);\n\n      await server.start();\n\n      function startProxy(callback) {\n        const app = express();\n\n        app.use(\n          \"/\",\n          createProxyMiddleware({\n            // Emulation\n            onProxyReqWs: (proxyReq) => {\n              proxyReq.setHeader(\"origin\", \"http://my-test-origin.com/\");\n            },\n            target: `http://${devServerHost}:${devServerPort}`,\n            ws: true,\n            changeOrigin: true,\n            logLevel: \"warn\",\n          }),\n        );\n\n        return app.listen(proxyPort, proxyHost, callback);\n      }\n\n      const proxy = await new Promise((resolve) => {\n        const proxyCreated = startProxy(() => {\n          resolve(proxyCreated);\n        });\n      });\n\n      const { page, browser } = await runBrowser();\n\n      try {\n        const pageErrors = [];\n        const consoleMessages = [];\n\n        page\n          .on(\"console\", (message) => {\n            consoleMessages.push(message);\n          })\n          .on(\"pageerror\", (error) => {\n            pageErrors.push(error);\n          });\n\n        await page.goto(`http://${proxyHost}:${proxyPort}/`, {\n          waitUntil: \"networkidle0\",\n        });\n\n        expect(\n          consoleMessages.map((message) => message.text()),\n        ).toMatchSnapshot(\"console messages\");\n        expect(pageErrors).toMatchSnapshot(\"page errors\");\n      } finally {\n        proxy.close();\n\n        await browser.close();\n        await server.stop();\n      }\n    });\n\n    it(`should connect web socket client using custom sub hostname to web socket server with the custom hostname value (\"${webSocketServer}\")`, async () => {\n      const devServerHost = \"127.0.0.1\";\n      const devServerPort = port1;\n      const proxyHost = devServerHost;\n      const proxyPort = port2;\n\n      const compiler = webpack(config);\n      const devServerOptions = {\n        client: {\n          webSocketURL: {\n            port: port2,\n          },\n        },\n        webSocketServer,\n        port: devServerPort,\n        host: devServerHost,\n        allowedHosts: \".my-test-origin.com\",\n      };\n      const server = new Server(devServerOptions, compiler);\n\n      await server.start();\n\n      function startProxy(callback) {\n        const app = express();\n\n        app.use(\n          \"/\",\n          createProxyMiddleware({\n            // Emulation\n            onProxyReqWs: (proxyReq) => {\n              proxyReq.setHeader(\n                \"origin\",\n                \"http://foo.bar.baz.my-test-origin.com/\",\n              );\n            },\n            target: `http://${devServerHost}:${devServerPort}`,\n            ws: true,\n            changeOrigin: true,\n            logLevel: \"warn\",\n          }),\n        );\n\n        return app.listen(proxyPort, proxyHost, callback);\n      }\n\n      const proxy = await new Promise((resolve) => {\n        const proxyCreated = startProxy(() => {\n          resolve(proxyCreated);\n        });\n      });\n\n      const { page, browser } = await runBrowser();\n\n      try {\n        const pageErrors = [];\n        const consoleMessages = [];\n\n        page\n          .on(\"console\", (message) => {\n            consoleMessages.push(message);\n          })\n          .on(\"pageerror\", (error) => {\n            pageErrors.push(error);\n          });\n\n        await page.goto(`http://${proxyHost}:${proxyPort}/`, {\n          waitUntil: \"networkidle0\",\n        });\n\n        expect(\n          consoleMessages.map((message) => message.text()),\n        ).toMatchSnapshot(\"console messages\");\n        expect(pageErrors).toMatchSnapshot(\"page errors\");\n      } finally {\n        proxy.close();\n\n        await browser.close();\n        await server.stop();\n      }\n    });\n\n    it(`should connect web socket client using custom hostname to web socket server with the multiple custom hostname values (\"${webSocketServer}\")`, async () => {\n      const devServerHost = \"127.0.0.1\";\n      const devServerPort = port1;\n      const proxyHost = devServerHost;\n      const proxyPort = port2;\n\n      const compiler = webpack(config);\n      const devServerOptions = {\n        client: {\n          webSocketURL: {\n            port: port2,\n          },\n        },\n        webSocketServer,\n        port: devServerPort,\n        host: devServerHost,\n        allowedHosts: [\"my-test-origin.com\"],\n      };\n      const server = new Server(devServerOptions, compiler);\n\n      await server.start();\n\n      function startProxy(callback) {\n        const app = express();\n\n        app.use(\n          \"/\",\n          createProxyMiddleware({\n            // Emulation\n            onProxyReqWs: (proxyReq) => {\n              proxyReq.setHeader(\"origin\", \"http://my-test-origin.com/\");\n            },\n            target: `http://${devServerHost}:${devServerPort}`,\n            ws: true,\n            changeOrigin: true,\n            logLevel: \"warn\",\n          }),\n        );\n\n        return app.listen(proxyPort, proxyHost, callback);\n      }\n\n      const proxy = await new Promise((resolve) => {\n        const proxyCreated = startProxy(() => {\n          resolve(proxyCreated);\n        });\n      });\n\n      const { page, browser } = await runBrowser();\n\n      try {\n        const pageErrors = [];\n        const consoleMessages = [];\n\n        page\n          .on(\"console\", (message) => {\n            consoleMessages.push(message);\n          })\n          .on(\"pageerror\", (error) => {\n            pageErrors.push(error);\n          });\n\n        await page.goto(`http://${proxyHost}:${proxyPort}/`, {\n          waitUntil: \"networkidle0\",\n        });\n\n        expect(\n          consoleMessages.map((message) => message.text()),\n        ).toMatchSnapshot(\"console messages\");\n        expect(pageErrors).toMatchSnapshot(\"page errors\");\n      } finally {\n        proxy.close();\n\n        await browser.close();\n        await server.stop();\n      }\n    });\n\n    it(`should connect web socket client using origin header containing an IP address with the custom hostname value (\"${webSocketServer}\")`, async () => {\n      const devServerHost = \"127.0.0.1\";\n      const devServerPort = port1;\n      const proxyHost = devServerHost;\n      const proxyPort = port2;\n\n      const compiler = webpack(config);\n      const devServerOptions = {\n        client: {\n          webSocketURL: {\n            port: port2,\n          },\n        },\n        webSocketServer,\n        port: devServerPort,\n        host: devServerHost,\n        allowedHosts: [\"192.168.1.1\"],\n      };\n      const server = new Server(devServerOptions, compiler);\n\n      await server.start();\n\n      function startProxy(callback) {\n        const app = express();\n\n        app.use(\n          \"/\",\n          createProxyMiddleware({\n            // Emulation\n            onProxyReqWs: (proxyReq) => {\n              proxyReq.setHeader(\"origin\", \"http://192.168.1.1/\");\n            },\n            target: `http://${devServerHost}:${devServerPort}`,\n            ws: true,\n            changeOrigin: true,\n            logLevel: \"warn\",\n          }),\n        );\n\n        return app.listen(proxyPort, proxyHost, callback);\n      }\n\n      const proxy = await new Promise((resolve) => {\n        const proxyCreated = startProxy(() => {\n          resolve(proxyCreated);\n        });\n      });\n\n      const { page, browser } = await runBrowser();\n\n      try {\n        const pageErrors = [];\n        const consoleMessages = [];\n\n        page\n          .on(\"console\", (message) => {\n            consoleMessages.push(message);\n          })\n          .on(\"pageerror\", (error) => {\n            pageErrors.push(error);\n          });\n\n        await page.goto(`http://${proxyHost}:${proxyPort}/`, {\n          waitUntil: \"networkidle0\",\n        });\n\n        expect(\n          consoleMessages.map((message) => message.text()),\n        ).toMatchSnapshot(\"(work) console messages\");\n        expect(pageErrors).toMatchSnapshot(\"(work) page errors\");\n      } finally {\n        proxy.close();\n\n        await browser.close();\n        await server.stop();\n      }\n    });\n\n    it(`should disconnect web socket client using custom hostname from web socket server with the \"auto\" value based on the \"host\" header (\"${webSocketServer}\")`, async () => {\n      const devServerHost = \"127.0.0.1\";\n      const devServerPort = port1;\n      const proxyHost = devServerHost;\n      const proxyPort = port2;\n\n      const compiler = webpack(config);\n      const devServerOptions = {\n        client: {\n          webSocketURL: {\n            port: port2,\n          },\n        },\n        webSocketServer,\n        port: devServerPort,\n        host: devServerHost,\n        allowedHosts: \"auto\",\n      };\n      const server = new Server(devServerOptions, compiler);\n\n      await server.start();\n\n      function startProxy(callback) {\n        const app = express();\n\n        app.use(\n          \"/\",\n          createProxyMiddleware({\n            // Emulation\n            onProxyReqWs: (proxyReq) => {\n              proxyReq.setHeader(\"host\", \"my-test-host\");\n            },\n            target: `http://${devServerHost}:${devServerPort}`,\n            ws: true,\n            changeOrigin: true,\n            logLevel: \"warn\",\n          }),\n        );\n\n        return app.listen(proxyPort, proxyHost, callback);\n      }\n\n      const proxy = await new Promise((resolve) => {\n        const proxyCreated = startProxy(() => {\n          resolve(proxyCreated);\n        });\n      });\n\n      const { page, browser } = await runBrowser();\n\n      try {\n        const pageErrors = [];\n        const consoleMessages = [];\n\n        page\n          .on(\"console\", (message) => {\n            consoleMessages.push(message);\n          })\n          .on(\"pageerror\", (error) => {\n            pageErrors.push(error);\n          });\n\n        await page.goto(`http://${proxyHost}:${proxyPort}/`, {\n          waitUntil: \"networkidle0\",\n        });\n\n        expect(\n          consoleMessages.map((message) => message.text()),\n        ).toMatchSnapshot(\"console messages\");\n        expect(pageErrors).toMatchSnapshot(\"page errors\");\n      } finally {\n        proxy.close();\n\n        await browser.close();\n        await server.stop();\n      }\n    });\n\n    it(`should disconnect web socket client using custom hostname from web socket server with the \"auto\" value based on the \"host\" header when \"server: 'https'\" is enabled (\"${webSocketServer}\")`, async () => {\n      const devServerHost = \"127.0.0.1\";\n      const devServerPort = port1;\n      const proxyHost = devServerHost;\n      const proxyPort = port2;\n\n      const compiler = webpack(config);\n      const devServerOptions = {\n        client: {\n          webSocketURL: {\n            port: port2,\n            protocol: \"ws\",\n          },\n        },\n        webSocketServer,\n        port: devServerPort,\n        host: devServerHost,\n        allowedHosts: \"auto\",\n        server: \"https\",\n      };\n      const server = new Server(devServerOptions, compiler);\n\n      await server.start();\n\n      function startProxy(callback) {\n        const app = express();\n\n        app.use(\n          \"/\",\n          createProxyMiddleware({\n            // Emulation\n            onProxyReqWs: (proxyReq) => {\n              proxyReq.setHeader(\"host\", \"my-test-host\");\n            },\n            target: `https://${devServerHost}:${devServerPort}`,\n            secure: false,\n            ws: true,\n            changeOrigin: true,\n            logLevel: \"warn\",\n          }),\n        );\n\n        return app.listen(proxyPort, proxyHost, callback);\n      }\n\n      const proxy = await new Promise((resolve) => {\n        const proxyCreated = startProxy(() => {\n          resolve(proxyCreated);\n        });\n      });\n\n      const { page, browser } = await runBrowser();\n\n      try {\n        const pageErrors = [];\n        const consoleMessages = [];\n\n        page\n          .on(\"console\", (message) => {\n            consoleMessages.push(message);\n          })\n          .on(\"pageerror\", (error) => {\n            pageErrors.push(error);\n          });\n\n        await page.goto(`http://${proxyHost}:${proxyPort}/`, {\n          waitUntil: \"networkidle0\",\n        });\n\n        expect(\n          consoleMessages.map((message) => message.text()),\n        ).toMatchSnapshot(\"console messages\");\n        expect(pageErrors).toMatchSnapshot(\"page errors\");\n      } finally {\n        proxy.close();\n\n        await browser.close();\n        await server.stop();\n      }\n    });\n\n    it(`should disconnect web socket client using custom hostname from web socket server with the \"auto\" value based on the \"origin\" header (\"${webSocketServer}\")`, async () => {\n      const devServerHost = \"127.0.0.1\";\n      const devServerPort = port1;\n      const proxyHost = devServerHost;\n      const proxyPort = port2;\n\n      const compiler = webpack(config);\n      const devServerOptions = {\n        client: {\n          webSocketURL: {\n            port: port2,\n          },\n        },\n        webSocketServer,\n        port: devServerPort,\n        host: devServerHost,\n        allowedHosts: \"auto\",\n      };\n      const server = new Server(devServerOptions, compiler);\n\n      await server.start();\n\n      function startProxy(callback) {\n        const app = express();\n\n        app.use(\n          \"/\",\n          createProxyMiddleware({\n            // Emulation\n            onProxyReqWs: (proxyReq) => {\n              proxyReq.setHeader(\"origin\", \"http://my-test-origin.com/\");\n            },\n            target: `http://${devServerHost}:${devServerPort}`,\n            ws: true,\n            changeOrigin: true,\n            logLevel: \"warn\",\n          }),\n        );\n\n        return app.listen(proxyPort, proxyHost, callback);\n      }\n\n      const proxy = await new Promise((resolve) => {\n        const proxyCreated = startProxy(() => {\n          resolve(proxyCreated);\n        });\n      });\n\n      const { page, browser } = await runBrowser();\n\n      try {\n        const pageErrors = [];\n        const consoleMessages = [];\n\n        page\n          .on(\"console\", (message) => {\n            consoleMessages.push(message);\n          })\n          .on(\"pageerror\", (error) => {\n            pageErrors.push(error);\n          });\n\n        await page.goto(`http://${proxyHost}:${proxyPort}/`, {\n          waitUntil: \"networkidle0\",\n        });\n\n        expect(\n          consoleMessages.map((message) => message.text()),\n        ).toMatchSnapshot(\"console messages\");\n        expect(pageErrors).toMatchSnapshot(\"page errors\");\n      } finally {\n        proxy.close();\n\n        await browser.close();\n        await server.stop();\n      }\n    });\n\n    it(`should disconnect web client using localhost to web socket server with the \"auto\" value (\"${webSocketServer}\")`, async () => {\n      const devServerHost = \"127.0.0.1\";\n      const devServerPort = port1;\n      const proxyHost = devServerHost;\n      const proxyPort = port2;\n\n      const compiler = webpack(config);\n      const devServerOptions = {\n        client: {\n          webSocketURL: {\n            port: port2,\n          },\n        },\n        webSocketServer,\n        port: devServerPort,\n        host: devServerHost,\n        allowedHosts: \"auto\",\n      };\n      const server = new Server(devServerOptions, compiler);\n\n      await server.start();\n\n      function startProxy(callback) {\n        const app = express();\n\n        app.use(\n          \"/\",\n          createProxyMiddleware({\n            // Emulation\n            onProxyReq: (proxyReq, req, res) => {\n              proxyReq.setHeader(\"host\", \"unknown\");\n              res.setHeader(\"host\", devServerHost);\n            },\n            target: `http://${devServerHost}:${devServerPort}`,\n            ws: true,\n            changeOrigin: true,\n            logLevel: \"warn\",\n          }),\n        );\n\n        return app.listen(proxyPort, proxyHost, callback);\n      }\n\n      const proxy = await new Promise((resolve) => {\n        const proxyCreated = startProxy(() => {\n          resolve(proxyCreated);\n        });\n      });\n\n      const { page, browser } = await runBrowser();\n\n      try {\n        const pageErrors = [];\n        const consoleMessages = [];\n\n        page\n          .on(\"console\", (message) => {\n            consoleMessages.push(message);\n          })\n          .on(\"pageerror\", (error) => {\n            pageErrors.push(error);\n          });\n\n        await page.goto(`http://${proxyHost}:${proxyPort}/`, {\n          waitUntil: \"networkidle0\",\n        });\n\n        const html = await page.content();\n\n        expect(html).toMatchSnapshot(\"html\");\n        expect(\n          consoleMessages.map((message) => message.text()),\n        ).toMatchSnapshot(\"console messages\");\n        expect(pageErrors).toMatchSnapshot(\"page errors\");\n      } finally {\n        proxy.close();\n\n        await browser.close();\n        await server.stop();\n      }\n    });\n\n    it(`should disconnect web client using origin header containing an IP address with the \"auto\" value (\"${webSocketServer}\")`, async () => {\n      const devServerHost = \"127.0.0.1\";\n      const devServerPort = port1;\n      const proxyHost = devServerHost;\n      const proxyPort = port2;\n\n      const compiler = webpack(config);\n      const devServerOptions = {\n        client: {\n          webSocketURL: {\n            port: port2,\n          },\n        },\n        webSocketServer,\n        port: devServerPort,\n        host: devServerHost,\n        allowedHosts: [\"192.168.1.1\"],\n      };\n      const server = new Server(devServerOptions, compiler);\n\n      await server.start();\n\n      function startProxy(callback) {\n        const app = express();\n\n        app.use(\n          \"/\",\n          createProxyMiddleware({\n            // Emulation\n            onProxyReqWs: (proxyReq) => {\n              proxyReq.setHeader(\"origin\", \"http://192.168.0.1/\");\n            },\n            target: `http://${devServerHost}:${devServerPort}`,\n            ws: true,\n            changeOrigin: true,\n            logLevel: \"warn\",\n          }),\n        );\n\n        return app.listen(proxyPort, proxyHost, callback);\n      }\n\n      const proxy = await new Promise((resolve) => {\n        const proxyCreated = startProxy(() => {\n          resolve(proxyCreated);\n        });\n      });\n\n      const { page, browser } = await runBrowser();\n\n      try {\n        const pageErrors = [];\n        const consoleMessages = [];\n\n        page\n          .on(\"console\", (message) => {\n            consoleMessages.push(message);\n          })\n          .on(\"pageerror\", (error) => {\n            pageErrors.push(error);\n          });\n\n        await page.goto(`http://${proxyHost}:${proxyPort}/`, {\n          waitUntil: \"networkidle0\",\n        });\n\n        expect(\n          consoleMessages.map((message) => message.text()),\n        ).toMatchSnapshot(\"(work) console messages\");\n        expect(pageErrors).toMatchSnapshot(\"(work) page errors\");\n      } finally {\n        proxy.close();\n\n        await browser.close();\n        await server.stop();\n      }\n    });\n  }\n\n  describe(\"check host headers\", () => {\n    let compiler;\n    let server;\n    let page;\n    let browser;\n    let pageErrors;\n    let consoleMessages;\n\n    beforeEach(() => {\n      compiler = webpack(config);\n      pageErrors = [];\n      consoleMessages = [];\n    });\n\n    afterEach(async () => {\n      await browser.close();\n      await server.stop();\n    });\n\n    it(\"should always allow `localhost` if options.allowedHosts is auto\", async () => {\n      const options = {\n        allowedHosts: \"auto\",\n        port: port1,\n      };\n\n      const headers = {\n        host: \"localhost\",\n      };\n\n      server = new Server(options, compiler);\n\n      await server.start();\n\n      ({ page, browser } = await runBrowser());\n\n      page\n        .on(\"console\", (message) => {\n          consoleMessages.push(message);\n        })\n        .on(\"pageerror\", (error) => {\n          pageErrors.push(error);\n        });\n\n      const response = await page.goto(`http://127.0.0.1:${port1}/main.js`, {\n        waitUntil: \"networkidle0\",\n      });\n\n      if (!server.isValidHost(headers, \"host\")) {\n        throw new Error(\"Validation didn't fail\");\n      }\n\n      expect(response.status()).toMatchSnapshot(\"response status\");\n\n      expect(consoleMessages.map((message) => message.text())).toMatchSnapshot(\n        \"console messages\",\n      );\n\n      expect(pageErrors).toMatchSnapshot(\"page errors\");\n    });\n\n    it(\"should always allow `localhost` subdomain if options.allowedHosts is auto\", async () => {\n      const options = {\n        allowedHosts: \"auto\",\n        port: port1,\n      };\n\n      const headers = {\n        host: \"app.localhost\",\n      };\n\n      server = new Server(options, compiler);\n\n      await server.start();\n\n      ({ page, browser } = await runBrowser());\n\n      page\n        .on(\"console\", (message) => {\n          consoleMessages.push(message);\n        })\n        .on(\"pageerror\", (error) => {\n          pageErrors.push(error);\n        });\n\n      const response = await page.goto(`http://127.0.0.1:${port1}/main.js`, {\n        waitUntil: \"networkidle0\",\n      });\n\n      if (!server.isValidHost(headers, \"host\")) {\n        throw new Error(\"Validation didn't fail\");\n      }\n\n      expect(response.status()).toMatchSnapshot(\"response status\");\n\n      expect(consoleMessages.map((message) => message.text())).toMatchSnapshot(\n        \"console messages\",\n      );\n\n      expect(pageErrors).toMatchSnapshot(\"page errors\");\n    });\n\n    it(\"should always allow value from the `host` options if options.allowedHosts is auto\", async () => {\n      const networkIP = Server.internalIPSync(\"v4\");\n      const options = {\n        host: networkIP,\n        allowedHosts: \"auto\",\n        port: port1,\n      };\n\n      const headers = {\n        host: networkIP,\n      };\n\n      server = new Server(options, compiler);\n\n      await server.start();\n\n      ({ page, browser } = await runBrowser());\n\n      page\n        .on(\"console\", (message) => {\n          consoleMessages.push(message);\n        })\n        .on(\"pageerror\", (error) => {\n          pageErrors.push(error);\n        });\n\n      const response = await page.goto(`http://${networkIP}:${port1}/main.js`, {\n        waitUntil: \"networkidle0\",\n      });\n\n      if (!server.isValidHost(headers, \"host\")) {\n        throw new Error(\"Validation didn't fail\");\n      }\n\n      expect(response.status()).toMatchSnapshot(\"response status\");\n\n      expect(consoleMessages.map((message) => message.text())).toMatchSnapshot(\n        \"console messages\",\n      );\n\n      expect(pageErrors).toMatchSnapshot(\"page errors\");\n    });\n\n    it(\"should always allow value of the `host` option from the `client.webSocketURL` option if options.allowedHosts is auto\", async () => {\n      const options = {\n        allowedHosts: \"auto\",\n        port: port1,\n        client: {\n          webSocketURL: \"ws://test.host:80\",\n        },\n      };\n\n      const headers = {\n        host: \"test.host\",\n      };\n\n      server = new Server(options, compiler);\n\n      await server.start();\n\n      ({ page, browser } = await runBrowser());\n\n      page\n        .on(\"console\", (message) => {\n          consoleMessages.push(message);\n        })\n        .on(\"pageerror\", (error) => {\n          pageErrors.push(error);\n        });\n\n      const response = await page.goto(`http://127.0.0.1:${port1}/main.js`, {\n        waitUntil: \"networkidle0\",\n      });\n\n      if (!server.isValidHost(headers, \"host\")) {\n        throw new Error(\"Validation didn't fail\");\n      }\n\n      expect(response.status()).toMatchSnapshot(\"response status\");\n\n      expect(consoleMessages.map((message) => message.text())).toMatchSnapshot(\n        \"console messages\",\n      );\n\n      expect(pageErrors).toMatchSnapshot(\"page errors\");\n    });\n\n    it(\"should always allow any host if options.allowedHosts is all\", async () => {\n      const options = {\n        allowedHosts: \"all\",\n        port: port1,\n      };\n      const headers = {\n        host: \"bad.host\",\n      };\n\n      server = new Server(options, compiler);\n\n      await server.start();\n\n      ({ page, browser } = await runBrowser());\n\n      page\n        .on(\"console\", (message) => {\n          consoleMessages.push(message);\n        })\n        .on(\"pageerror\", (error) => {\n          pageErrors.push(error);\n        });\n\n      const response = await page.goto(`http://127.0.0.1:${port1}/main.js`, {\n        waitUntil: \"networkidle0\",\n      });\n\n      if (!server.isValidHost(headers, \"host\")) {\n        throw new Error(\"Validation didn't fail\");\n      }\n\n      expect(response.status()).toMatchSnapshot(\"response status\");\n\n      expect(consoleMessages.map((message) => message.text())).toMatchSnapshot(\n        \"console messages\",\n      );\n\n      expect(pageErrors).toMatchSnapshot(\"page errors\");\n    });\n\n    it(\"should allow hosts in allowedHosts\", async () => {\n      const tests = [\"test.host\", \"test2.host\", \"test3.host\"];\n      const options = {\n        allowedHosts: tests,\n        port: port1,\n      };\n\n      server = new Server(options, compiler);\n\n      await server.start();\n\n      ({ page, browser } = await runBrowser());\n\n      page\n        .on(\"console\", (message) => {\n          consoleMessages.push(message);\n        })\n        .on(\"pageerror\", (error) => {\n          pageErrors.push(error);\n        });\n\n      const response = await page.goto(`http://127.0.0.1:${port1}/main.js`, {\n        waitUntil: \"networkidle0\",\n      });\n\n      for (const test of tests) {\n        const headers = { host: test };\n\n        if (!server.isValidHost(headers, \"host\")) {\n          throw new Error(\"Validation didn't fail\");\n        }\n      }\n\n      expect(response.status()).toMatchSnapshot(\"response status\");\n\n      expect(consoleMessages.map((message) => message.text())).toMatchSnapshot(\n        \"console messages\",\n      );\n\n      expect(pageErrors).toMatchSnapshot(\"page errors\");\n    });\n\n    it(\"should allow hosts that pass a wildcard in allowedHosts\", async () => {\n      const options = {\n        allowedHosts: [\".example.com\"],\n        port: port1,\n      };\n\n      server = new Server(options, compiler);\n\n      await server.start();\n\n      ({ page, browser } = await runBrowser());\n\n      page\n        .on(\"console\", (message) => {\n          consoleMessages.push(message);\n        })\n        .on(\"pageerror\", (error) => {\n          pageErrors.push(error);\n        });\n\n      const response = await page.goto(`http://127.0.0.1:${port1}/main.js`, {\n        waitUntil: \"networkidle0\",\n      });\n\n      const tests = [\n        \"www.example.com\",\n        \"subdomain.example.com\",\n        \"example.com\",\n        \"subsubcomain.subdomain.example.com\",\n        \"example.com:80\",\n        \"subdomain.example.com:80\",\n      ];\n\n      for (const test of tests) {\n        const headers = { host: test };\n\n        if (!server.isValidHost(headers, \"host\")) {\n          throw new Error(\"Validation didn't fail\");\n        }\n      }\n\n      expect(response.status()).toMatchSnapshot(\"response status\");\n\n      expect(consoleMessages.map((message) => message.text())).toMatchSnapshot(\n        \"console messages\",\n      );\n\n      expect(pageErrors).toMatchSnapshot(\"page errors\");\n    });\n  });\n});\n"
  },
  {
    "path": "test/e2e/api.test.js",
    "content": "\"use strict\";\n\nconst path = require(\"node:path\");\nconst webpack = require(\"webpack\");\nconst Server = require(\"../../lib/Server\");\nconst config = require(\"../fixtures/client-config/webpack.config\");\nconst runBrowser = require(\"../helpers/run-browser\");\nconst sessionSubscribe = require(\"../helpers/session-subscribe\");\nconst port = require(\"../ports-map\").api;\n\ndescribe(\"API\", () => {\n  describe(\"WEBPACK_SERVE environment variable\", () => {\n    const OLD_ENV = process.env;\n    let server;\n    let page;\n    let browser;\n    let pageErrors;\n    let consoleMessages;\n\n    beforeEach(async () => {\n      // this is important - it clears the cache\n      jest.resetModules();\n\n      process.env = { ...OLD_ENV };\n\n      delete process.env.WEBPACK_SERVE;\n\n      ({ page, browser } = await runBrowser());\n\n      pageErrors = [];\n      consoleMessages = [];\n    });\n\n    afterEach(async () => {\n      await browser.close();\n      await server.stop();\n      process.env = OLD_ENV;\n    });\n\n    it(\"should be present\", async () => {\n      expect(process.env.WEBPACK_SERVE).toBeUndefined();\n\n      page\n        .on(\"console\", (message) => {\n          consoleMessages.push(message);\n        })\n        .on(\"pageerror\", (error) => {\n          pageErrors.push(error);\n        });\n\n      const WebpackDevServer = require(\"../../lib/Server\");\n\n      const compiler = webpack(config);\n      server = new WebpackDevServer({ port }, compiler);\n\n      await server.start();\n\n      expect(process.env.WEBPACK_SERVE).toBe(\"true\");\n\n      const response = await page.goto(`http://localhost:${port}/`, {\n        waitUntil: \"networkidle0\",\n      });\n\n      expect(response.status()).toMatchSnapshot(\"response status\");\n\n      expect(consoleMessages.map((message) => message.text())).toMatchSnapshot(\n        \"console messages\",\n      );\n\n      expect(pageErrors).toMatchSnapshot(\"page errors\");\n    });\n  });\n\n  describe(\"latest async API\", () => {\n    it(\"should work with async API\", async () => {\n      const compiler = webpack(config);\n      const server = new Server({ port }, compiler);\n\n      await server.start();\n\n      const { page, browser } = await runBrowser();\n\n      try {\n        const pageErrors = [];\n        const consoleMessages = [];\n\n        page\n          .on(\"console\", (message) => {\n            consoleMessages.push(message);\n          })\n          .on(\"pageerror\", (error) => {\n            pageErrors.push(error);\n          });\n\n        await page.goto(`http://localhost:${port}/`, {\n          waitUntil: \"networkidle0\",\n        });\n\n        expect(\n          consoleMessages.map((message) => message.text()),\n        ).toMatchSnapshot(\"console messages\");\n        expect(pageErrors).toMatchSnapshot(\"page errors\");\n      } finally {\n        await browser.close();\n        await server.stop();\n      }\n    });\n\n    it(\"should work with callback API\", async () => {\n      const compiler = webpack(config);\n      const server = new Server({ port }, compiler);\n\n      await new Promise((resolve) => {\n        server.startCallback(() => {\n          resolve();\n        });\n      });\n\n      const { page, browser } = await runBrowser();\n\n      try {\n        const pageErrors = [];\n        const consoleMessages = [];\n\n        page\n          .on(\"console\", (message) => {\n            consoleMessages.push(message);\n          })\n          .on(\"pageerror\", (error) => {\n            pageErrors.push(error);\n          });\n\n        await page.goto(`http://localhost:${port}/`, {\n          waitUntil: \"networkidle0\",\n        });\n\n        expect(\n          consoleMessages.map((message) => message.text()),\n        ).toMatchSnapshot(\"console messages\");\n        expect(pageErrors).toMatchSnapshot(\"page errors\");\n      } finally {\n        await browser.close();\n        await new Promise((resolve) => {\n          server.stopCallback(() => {\n            resolve();\n          });\n        });\n      }\n    });\n\n    it(\"should catch errors within startCallback\", async () => {\n      const compiler = webpack(config);\n      const server = new Server(\n        { port, static: \"https://absolute-url.com/somewhere\" },\n        compiler,\n      );\n\n      await new Promise((resolve) => {\n        server.startCallback((err) => {\n          expect(err.message).toBe(\n            \"Using a URL as static.directory is not supported\",\n          );\n          resolve();\n        });\n      });\n\n      await new Promise((resolve) => {\n        server.stopCallback(() => {\n          resolve();\n        });\n      });\n    });\n\n    it(\"should work when using configured manually\", async () => {\n      const compiler = webpack({\n        ...config,\n        entry: [\n          \"webpack/hot/dev-server.js\",\n          `${path.resolve(\n            __dirname,\n            \"../../client/index.js\",\n          )}?hot=true&live-reload=true\"`,\n          path.resolve(__dirname, \"../fixtures/client-config/foo.js\"),\n        ],\n        plugins: [...config.plugins, new webpack.HotModuleReplacementPlugin()],\n      });\n      const server = new Server({ port, hot: false, client: false }, compiler);\n\n      await server.start();\n\n      const { page, browser } = await runBrowser();\n      try {\n        const pageErrors = [];\n        const consoleMessages = [];\n\n        page\n          .on(\"console\", (message) => {\n            consoleMessages.push(message);\n          })\n          .on(\"pageerror\", (error) => {\n            pageErrors.push(error);\n          });\n\n        await page.goto(`http://localhost:${port}/`, {\n          waitUntil: \"networkidle0\",\n        });\n\n        expect(\n          consoleMessages.map((message) => message.text()),\n        ).toMatchSnapshot(\"console messages\");\n        expect(pageErrors).toMatchSnapshot(\"page errors\");\n      } finally {\n        await browser.close();\n        await server.stop();\n      }\n    });\n\n    it(\"should work and allow to rerun dev server multiple times\", async () => {\n      const compiler = webpack(config);\n      const server = new Server({ port }, compiler);\n\n      await server.start();\n\n      const { page: firstPage, browser } = await runBrowser();\n\n      try {\n        const firstPageErrors = [];\n        const firstConsoleMessages = [];\n\n        firstPage\n          .on(\"console\", (message) => {\n            firstConsoleMessages.push(message);\n          })\n          .on(\"pageerror\", (error) => {\n            firstPageErrors.push(error);\n          });\n\n        await firstPage.goto(`http://localhost:${port}/`, {\n          waitUntil: \"networkidle0\",\n        });\n\n        expect(\n          firstConsoleMessages.map((message) => message.text()),\n        ).toMatchSnapshot(\"console messages\");\n        expect(firstPageErrors).toMatchSnapshot(\"page errors\");\n      } finally {\n        await server.stop();\n      }\n\n      await server.start();\n\n      const secondPage = await runBrowser.runPage(browser);\n\n      try {\n        const secondPageErrors = [];\n        const secondConsoleMessages = [];\n\n        secondPage\n          .on(\"console\", (message) => {\n            secondConsoleMessages.push(message);\n          })\n          .on(\"pageerror\", (error) => {\n            secondPageErrors.push(error);\n          });\n\n        await secondPage.goto(`http://localhost:${port}/`, {\n          waitUntil: \"networkidle0\",\n        });\n\n        expect(\n          secondConsoleMessages.map((message) => message.text()),\n        ).toMatchSnapshot(\"console messages\");\n        expect(secondPageErrors).toMatchSnapshot(\"page errors\");\n      } finally {\n        await browser.close();\n        await server.stop();\n      }\n    });\n  });\n\n  describe(\"Invalidate callback\", () => {\n    let compiler;\n    let server;\n    let page;\n    let browser;\n    let pageErrors;\n    let consoleMessages;\n\n    beforeEach(async () => {\n      compiler = webpack(config);\n\n      ({ page, browser } = await runBrowser());\n\n      pageErrors = [];\n      consoleMessages = [];\n\n      page\n        .on(\"console\", (message) => {\n          consoleMessages.push(message);\n        })\n        .on(\"pageerror\", (error) => {\n          pageErrors.push(error);\n        });\n\n      server = new Server({ port, static: false }, compiler);\n\n      await server.start();\n    });\n\n    afterEach(async () => {\n      await browser.close();\n      await server.stop();\n    });\n\n    it(\"should use the default `noop` callback when invalidate is called without any callback\", async () => {\n      const callback = jest.fn();\n\n      server.invalidate();\n      server.middleware.context.callbacks[0] = callback;\n\n      const response = await page.goto(`http://localhost:${port}/`, {\n        waitUntil: \"networkidle0\",\n      });\n\n      expect(callback).toHaveBeenCalledTimes(1);\n      expect(response.status()).toMatchSnapshot(\"response status\");\n\n      expect(consoleMessages.map((message) => message.text())).toMatchSnapshot(\n        \"console messages\",\n      );\n      expect(pageErrors).toMatchSnapshot(\"page errors\");\n    });\n\n    it(\"should use the provided `callback` function\", async () => {\n      const callback = jest.fn();\n\n      server.invalidate(callback);\n\n      const response = await page.goto(`http://localhost:${port}/`, {\n        waitUntil: \"networkidle0\",\n      });\n\n      expect(callback).toHaveBeenCalledTimes(1);\n      expect(response.status()).toMatchSnapshot(\"response status\");\n\n      expect(consoleMessages.map((message) => message.text())).toMatchSnapshot(\n        \"console messages\",\n      );\n\n      expect(pageErrors).toMatchSnapshot(\"page errors\");\n    });\n  });\n\n  describe(\"Server.getFreePort\", () => {\n    let dummyServers = [];\n    let devServerPort;\n\n    afterEach(() => {\n      delete process.env.WEBPACK_DEV_SERVER_BASE_PORT;\n      delete process.env.WEBPACK_DEV_SERVER_PORT_RETRY;\n\n      return dummyServers\n        .reduce(\n          (p, server) =>\n            p.then(\n              () =>\n                new Promise((resolve) => {\n                  server.stopCallback(() => {\n                    resolve();\n                  });\n                }),\n            ),\n          Promise.resolve(),\n        )\n        .then(() => {\n          dummyServers = [];\n        });\n    });\n\n    function createDummyServers(n) {\n      const basePort = process.env.WEBPACK_DEV_SERVER_TEST_BASE_PORT || 30000;\n      process.env.WEBPACK_DEV_SERVER_BASE_PORT = basePort;\n\n      return (Array.isArray(n) ? n : Array.from({ length: n })).reduce(\n        (p, _, i) =>\n          p.then(\n            () =>\n              new Promise((resolve) => {\n                devServerPort = basePort + i;\n                const compiler = webpack(config);\n                const server = new Server(\n                  { port: devServerPort, host: \"0.0.0.0\" },\n                  compiler,\n                );\n\n                dummyServers.push(server);\n\n                server.startCallback((err) => {\n                  if (err) {\n                    // If we get EACCES, try again with a higher port range\n                    if (\n                      err.code === \"EACCES\" &&\n                      !process.env.WEBPACK_DEV_SERVER_TEST_RETRY\n                    ) {\n                      process.env.WEBPACK_DEV_SERVER_TEST_RETRY = true;\n                      process.env.WEBPACK_DEV_SERVER_TEST_BASE_PORT = 40000;\n                      // Resolve and let the test restart with the new port range\n                      resolve();\n                    } else {\n                      Promise.reject(err);\n                    }\n                  } else {\n                    resolve();\n                  }\n                });\n              }),\n          ),\n        Promise.resolve(),\n      );\n    }\n\n    it(\"should return the port when the port is specified\", async () => {\n      const retryCount = 1;\n\n      process.env.WEBPACK_DEV_SERVER_PORT_RETRY = retryCount;\n\n      const freePort = await Server.getFreePort(9082);\n\n      expect(freePort).toBe(9082);\n    });\n\n    it(\"should return the port when the port is `null`\", async () => {\n      const retryCount = 2;\n\n      process.env.WEBPACK_DEV_SERVER_PORT_RETRY = retryCount;\n      try {\n        await createDummyServers(retryCount);\n        const basePort = Number.parseInt(\n          process.env.WEBPACK_DEV_SERVER_BASE_PORT,\n          10,\n        );\n        const freePort = await Server.getFreePort(null);\n\n        expect(freePort).toEqual(basePort + retryCount);\n\n        const { page, browser } = await runBrowser();\n\n        try {\n          const pageErrors = [];\n          const consoleMessages = [];\n\n          page\n            .on(\"console\", (message) => {\n              consoleMessages.push(message);\n            })\n            .on(\"pageerror\", (error) => {\n              pageErrors.push(error);\n            });\n\n          const response = await page.goto(\n            `http://localhost:${devServerPort}/`,\n            {\n              waitUntil: \"networkidle0\",\n            },\n          );\n\n          expect(response.status()).toMatchSnapshot(\"response status\");\n\n          expect(\n            consoleMessages.map((message) => message.text()),\n          ).toMatchSnapshot(\"console messages\");\n\n          expect(pageErrors).toMatchSnapshot(\"page errors\");\n        } catch (error) {\n          if (error.code === \"EACCES\") {\n            // Retry mechanism for EACCES errors\n            const maxRetries = 3;\n            const retryKey = `retry_${expect.getState().currentTestName}`;\n\n            // Get current retry count or initialize to 0\n            global[retryKey] ||= 0;\n            global[retryKey] += 1;\n\n            if (global[retryKey] < maxRetries) {\n              console.warn(\n                `EACCES error encountered (attempt ${global[retryKey]}/${maxRetries}): ${error.message}. Retrying...`,\n              );\n              // Re-run the current test\n              return it.currentTest.fn();\n            }\n          }\n          throw error;\n        } finally {\n          await browser.close();\n        }\n      } catch (err) {\n        if (err.code === \"EACCES\") {\n          console.warn(\n            `Skipping test due to permission issues: ${err.message}`,\n          );\n          return;\n        }\n        throw err;\n      }\n    });\n\n    it(\"should return the port when the port is undefined\", async () => {\n      const retryCount = 3;\n\n      process.env.WEBPACK_DEV_SERVER_PORT_RETRY = retryCount;\n      try {\n        await createDummyServers(retryCount);\n        const basePort = Number.parseInt(\n          process.env.WEBPACK_DEV_SERVER_BASE_PORT,\n          10,\n        );\n\n        const freePort = await Server.getFreePort(undefined);\n\n        expect(freePort).toEqual(basePort + retryCount);\n\n        const { page, browser } = await runBrowser();\n\n        try {\n          const pageErrors = [];\n          const consoleMessages = [];\n\n          page\n            .on(\"console\", (message) => {\n              consoleMessages.push(message);\n            })\n            .on(\"pageerror\", (error) => {\n              pageErrors.push(error);\n            });\n\n          const response = await page.goto(\n            `http://localhost:${devServerPort}/`,\n            {\n              waitUntil: \"networkidle0\",\n            },\n          );\n\n          expect(response.status()).toMatchSnapshot(\"response status\");\n\n          expect(\n            consoleMessages.map((message) => message.text()),\n          ).toMatchSnapshot(\"console messages\");\n\n          expect(pageErrors).toMatchSnapshot(\"page errors\");\n        } catch (error) {\n          if (error.code === \"EACCES\") {\n            // Retry mechanism for EACCES errors\n            const maxRetries = 3;\n            const retryKey = `retry_${expect.getState().currentTestName}`;\n\n            // Get current retry count or initialize to 0\n            global[retryKey] ||= 0;\n            global[retryKey] += 1;\n\n            if (global[retryKey] < maxRetries) {\n              console.warn(\n                `EACCES error encountered (attempt ${global[retryKey]}/${maxRetries}): ${error.message}. Retrying...`,\n              );\n              // Re-run the current test\n              return it.currentTest.fn();\n            }\n          }\n          throw error;\n        } finally {\n          await browser.close();\n        }\n      } catch (err) {\n        if (err.code === \"EACCES\") {\n          console.warn(\n            `Skipping test due to permission issues: ${err.message}`,\n          );\n          return;\n        }\n        throw err;\n      }\n    });\n\n    it(\"should retry finding the port for up to defaultPortRetry times (number)\", async () => {\n      const retryCount = 4;\n\n      process.env.WEBPACK_DEV_SERVER_PORT_RETRY = retryCount;\n\n      try {\n        await createDummyServers(retryCount);\n        const basePort = Number.parseInt(\n          process.env.WEBPACK_DEV_SERVER_BASE_PORT,\n          10,\n        );\n        const freePort = await Server.getFreePort();\n\n        expect(freePort).toEqual(basePort + retryCount);\n\n        const { page, browser } = await runBrowser();\n\n        try {\n          const pageErrors = [];\n          const consoleMessages = [];\n\n          page\n            .on(\"console\", (message) => {\n              consoleMessages.push(message);\n            })\n            .on(\"pageerror\", (error) => {\n              pageErrors.push(error);\n            });\n\n          const response = await page.goto(\n            `http://localhost:${devServerPort}/`,\n            {\n              waitUntil: \"networkidle0\",\n            },\n          );\n\n          expect(response.status()).toMatchSnapshot(\"response status\");\n\n          expect(\n            consoleMessages.map((message) => message.text()),\n          ).toMatchSnapshot(\"console messages\");\n\n          expect(pageErrors).toMatchSnapshot(\"page errors\");\n        } catch (error) {\n          if (error.code === \"EACCES\") {\n            // Retry mechanism for EACCES errors\n            const maxRetries = 3;\n            const retryKey = `retry_${expect.getState().currentTestName}`;\n\n            // Get current retry count or initialize to 0\n            global[retryKey] ||= 0;\n            global[retryKey] += 1;\n\n            if (global[retryKey] < maxRetries) {\n              console.warn(\n                `EACCES error encountered (attempt ${global[retryKey]}/${maxRetries}): ${error.message}. Retrying...`,\n              );\n              // Re-run the current test\n              return it.currentTest.fn();\n            }\n          }\n          throw error;\n        } finally {\n          await browser.close();\n        }\n      } catch (err) {\n        // If it's a permission error on the port, mark the test as skipped rather than failed\n        if (err.code === \"EACCES\") {\n          console.warn(\n            `Skipping test due to permission issues: ${err.message}`,\n          );\n          return;\n        }\n        throw err;\n      }\n    });\n\n    it(\"should retry finding the port for up to defaultPortRetry times (string)\", async () => {\n      const retryCount = 5;\n\n      process.env.WEBPACK_DEV_SERVER_PORT_RETRY = retryCount;\n\n      try {\n        await createDummyServers(retryCount);\n        const basePort = Number.parseInt(\n          process.env.WEBPACK_DEV_SERVER_BASE_PORT,\n          10,\n        );\n        const freePort = await Server.getFreePort();\n\n        expect(freePort).toEqual(basePort + retryCount);\n\n        const { page, browser } = await runBrowser();\n\n        try {\n          const pageErrors = [];\n          const consoleMessages = [];\n\n          page\n            .on(\"console\", (message) => {\n              consoleMessages.push(message);\n            })\n            .on(\"pageerror\", (error) => {\n              pageErrors.push(error);\n            });\n\n          const response = await page.goto(\n            `http://localhost:${devServerPort}/`,\n            {\n              waitUntil: \"networkidle0\",\n            },\n          );\n\n          expect(response.status()).toMatchSnapshot(\"response status\");\n\n          expect(\n            consoleMessages.map((message) => message.text()),\n          ).toMatchSnapshot(\"console messages\");\n\n          expect(pageErrors).toMatchSnapshot(\"page errors\");\n        } catch (error) {\n          if (error.code === \"EACCES\") {\n            // Retry mechanism for EACCES errors\n            const maxRetries = 3;\n            const retryKey = `retry_${expect.getState().currentTestName}`;\n\n            // Get current retry count or initialize to 0\n            global[retryKey] ||= 0;\n            global[retryKey] += 1;\n\n            if (global[retryKey] < maxRetries) {\n              console.warn(\n                `EACCES error encountered (attempt ${global[retryKey]}/${maxRetries}): ${error.message}. Retrying...`,\n              );\n              // Re-run the current test\n              return it.currentTest.fn();\n            }\n          }\n          throw error;\n        } finally {\n          await browser.close();\n        }\n      } catch (err) {\n        // If it's a permission error on the port, mark the test as skipped rather than failed\n        if (err.code === \"EACCES\") {\n          console.warn(\n            `Skipping test due to permission issues: ${err.message}`,\n          );\n          return;\n        }\n        throw err;\n      }\n    });\n\n    it(\"should retry finding the port when serial ports are busy\", async () => {\n      const basePort = Number.parseInt(\n        process.env.WEBPACK_DEV_SERVER_TEST_BASE_PORT || 30000,\n        10,\n      );\n      const busyPorts = Array.from({ length: 6 }, (_, i) => basePort + i);\n\n      process.env.WEBPACK_DEV_SERVER_PORT_RETRY = 1000;\n\n      await createDummyServers(busyPorts);\n\n      const freePort = await Server.getFreePort();\n      // to use the last port in the busyPorts array\n      const lastBusyPort = busyPorts[busyPorts.length - 1];\n      expect(freePort).toBeGreaterThan(lastBusyPort);\n\n      const { page, browser } = await runBrowser();\n\n      try {\n        const pageErrors = [];\n        const consoleMessages = [];\n\n        page\n          .on(\"console\", (message) => {\n            consoleMessages.push(message);\n          })\n          .on(\"pageerror\", (error) => {\n            pageErrors.push(error);\n          });\n\n        try {\n          const response = await page.goto(\n            `http://localhost:${devServerPort}/`,\n            {\n              waitUntil: \"networkidle0\",\n            },\n          );\n\n          expect(response.status()).toMatchSnapshot(\"response status\");\n\n          expect(\n            consoleMessages.map((message) => message.text()),\n          ).toMatchSnapshot(\"console messages\");\n\n          expect(pageErrors).toMatchSnapshot(\"page errors\");\n        } catch (error) {\n          if (error.code === \"EACCES\") {\n            // Retry mechanism for EACCES errors\n            const maxRetries = 3;\n            const retryKey = `retry_${expect.getState().currentTestName}`;\n\n            // Get current retry count or initialize to 0\n            global[retryKey] ||= 0;\n            global[retryKey] += 1;\n\n            if (global[retryKey] < maxRetries) {\n              console.warn(\n                `EACCES error encountered (attempt ${global[retryKey]}/${maxRetries}): ${error.message}. Retrying...`,\n              );\n              // Re-run the current test\n              return it.currentTest.fn();\n            }\n          }\n          throw error;\n        }\n      } catch (error) {\n        if (error.code === \"EACCES\") {\n          // Retry mechanism for EACCES errors\n          const maxRetries = 3;\n          const retryKey = `retry_${expect.getState().currentTestName}`;\n\n          // Get current retry count or initialize to 0\n          global[retryKey] ||= 0;\n          global[retryKey] += 1;\n\n          if (global[retryKey] < maxRetries) {\n            console.warn(\n              `EACCES error encountered (attempt ${global[retryKey]}/${maxRetries}): ${error.message}. Retrying...`,\n            );\n            // Re-run the current test\n            return it.currentTest.fn();\n          }\n        }\n        throw error;\n      } finally {\n        await browser.close();\n      }\n    });\n\n    it(\"should throw the error when the port isn't found\", async () => {\n      expect.assertions(1);\n\n      jest.mock(\n        \"../../lib/getPort\",\n        () => () => Promise.reject(new Error(\"busy\")),\n      );\n\n      process.env.WEBPACK_DEV_SERVER_PORT_RETRY = 1;\n\n      try {\n        await Server.getFreePort();\n      } catch (error) {\n        expect(error.message).toMatchSnapshot();\n      }\n    });\n  });\n\n  describe(\"Server.checkHostHeader\", () => {\n    it(\"should allow access for every requests using an IP\", () => {\n      const options = {\n        allowedHosts: \"all\",\n      };\n\n      const tests = [\n        \"192.168.1.123\",\n        \"192.168.1.2:8080\",\n        \"[::1]\",\n        \"[::1]:8080\",\n        \"[ad42::1de2:54c2:c2fa:1234]\",\n        \"[ad42::1de2:54c2:c2fa:1234]:8080\",\n      ];\n\n      const compiler = webpack(config);\n      const server = new Server(options, compiler);\n\n      let isValidHost = true;\n\n      for (const test of tests) {\n        const headers = { host: test };\n\n        if (!server.isValidHost(headers, \"host\")) {\n          isValidHost = false;\n        }\n      }\n\n      expect(isValidHost).toBe(true);\n    });\n\n    it('should allow URLs with scheme for checking origin when the \"option.client.webSocketURL\" is object', async () => {\n      const options = {\n        port,\n        client: {\n          reconnect: false,\n          webSocketURL: {\n            hostname: \"test.host\",\n          },\n        },\n        webSocketServer: \"ws\",\n      };\n      const headers = {\n        origin: \"https://test.host\",\n      };\n\n      const compiler = webpack(config);\n      const server = new Server(options, compiler);\n\n      await server.start();\n\n      const { page, browser } = await runBrowser();\n\n      try {\n        const pageErrors = [];\n        const consoleMessages = [];\n\n        page\n          .on(\"console\", (message) => {\n            consoleMessages.push(message);\n          })\n          .on(\"pageerror\", (error) => {\n            pageErrors.push(error);\n          });\n\n        const webSocketRequests = [];\n        const session = await page.target().createCDPSession();\n\n        session.on(\"Network.webSocketCreated\", (test) => {\n          webSocketRequests.push(test);\n        });\n\n        await session.send(\"Target.setAutoAttach\", {\n          autoAttach: true,\n          flatten: true,\n          waitForDebuggerOnStart: true,\n        });\n\n        sessionSubscribe(session);\n\n        try {\n          const response = await page.goto(`http://localhost:${port}/`, {\n            waitUntil: \"networkidle0\",\n          });\n\n          if (!server.isValidHost(headers, \"origin\")) {\n            throw new Error(\"Validation didn't fail\");\n          }\n\n          await new Promise((resolve) => {\n            const interval = setInterval(() => {\n              const needFinish = consoleMessages.filter((message) =>\n                /Trying to reconnect/.test(message.text()),\n              );\n\n              if (needFinish.length > 0) {\n                clearInterval(interval);\n                resolve();\n              }\n            }, 100);\n          });\n\n          expect(webSocketRequests[0].url).toMatchSnapshot(\"web socket URL\");\n\n          expect(response.status()).toMatchSnapshot(\"response status\");\n\n          expect(\n            // net::ERR_NAME_NOT_RESOLVED can be multiple times\n            consoleMessages.map((message) => message.text()).slice(0, 7),\n          ).toMatchSnapshot(\"console messages\");\n\n          expect(pageErrors).toMatchSnapshot(\"page errors\");\n        } catch (error) {\n          if (error.code === \"EACCES\") {\n            // Retry mechanism for EACCES errors\n            const maxRetries = 3;\n            const retryKey = `retry_${expect.getState().currentTestName}`;\n\n            // Get current retry count or initialize to 0\n            global[retryKey] ||= 0;\n            global[retryKey] += 1;\n\n            if (global[retryKey] < maxRetries) {\n              console.warn(\n                `EACCES error encountered (attempt ${global[retryKey]}/${maxRetries}): ${error.message}. Retrying...`,\n              );\n              // Re-run the current test\n              return it.currentTest.fn();\n            }\n          }\n          throw error;\n        }\n      } catch (error) {\n        if (error.code === \"EACCES\") {\n          // Retry mechanism for EACCES errors\n          const maxRetries = 3;\n          const retryKey = `retry_${expect.getState().currentTestName}`;\n\n          // Get current retry count or initialize to 0\n          global[retryKey] ||= 0;\n          global[retryKey] += 1;\n\n          if (global[retryKey] < maxRetries) {\n            console.warn(\n              `EACCES error encountered (attempt ${global[retryKey]}/${maxRetries}): ${error.message}. Retrying...`,\n            );\n            // Re-run the current test\n            return it.currentTest.fn();\n          }\n        }\n        throw error;\n      } finally {\n        await browser.close();\n        await server.stop();\n      }\n    });\n  });\n});\n"
  },
  {
    "path": "test/e2e/app.test.js",
    "content": "\"use strict\";\n\nconst fs = require(\"node:fs\");\nconst path = require(\"node:path\");\nconst webpack = require(\"webpack\");\nconst wdm = require(\"webpack-dev-middleware\");\nconst Server = require(\"../../lib/Server\");\nconst config = require(\"../fixtures/client-config/webpack.config\");\nconst runBrowser = require(\"../helpers/run-browser\");\nconst port = require(\"../ports-map\").app;\n\nconst staticDirectory = path.resolve(\n  __dirname,\n  \"../fixtures/static-config/public\",\n);\n\nconst apps = [\n  [\"express\", () => require(\"express\")(), \"http\"],\n  [\"express\", () => require(\"express\")(), \"https\"],\n  [\"connect\", () => require(\"connect\")(), \"http\"],\n  [\"connect\", () => require(\"connect\")(), \"https\"],\n  [\"connect\", () => require(\"connect\")(), \"http2\"],\n  [\"connect (async)\", () => require(\"connect\")(), \"http\"],\n  [\n    \"hono\",\n    () => new (require(\"hono\").Hono)(),\n    (options, app) =>\n      require(\"@hono/node-server\").createAdaptorServer({\n        fetch: app.fetch,\n      }),\n    (_, devServer) => [\n      {\n        name: \"webpack-dev-middleware\",\n        middleware: wdm.honoWrapper(devServer.compiler),\n      },\n    ],\n  ],\n  [\n    \"hono\",\n    () => new (require(\"hono\").Hono)(),\n    (_, app) =>\n      require(\"@hono/node-server\").createAdaptorServer({\n        fetch: app.fetch,\n        createServer: require(\"node:https\").createServer,\n        serverOptions: {\n          key: fs.readFileSync(\n            path.resolve(__dirname, \"../fixtures/ssl/localhost-privkey.pem\"),\n          ),\n          cert: fs.readFileSync(\n            path.resolve(__dirname, \"../fixtures/ssl/localhost-cert.pem\"),\n          ),\n        },\n      }),\n    (_, devServer) => [\n      {\n        name: \"webpack-dev-middleware\",\n        middleware: wdm.honoWrapper(devServer.compiler),\n      },\n    ],\n  ],\n  [\n    \"hono\",\n    () => new (require(\"hono\").Hono)(),\n    {\n      type: (options, app) =>\n        require(\"@hono/node-server\").createAdaptorServer({\n          fetch: app.fetch,\n          createServer: require(\"node:http2\").createSecureServer,\n          serverOptions: options,\n        }),\n      options: {\n        allowHTTP1: true,\n        key: fs.readFileSync(\n          path.resolve(__dirname, \"../fixtures/ssl/localhost-privkey.pem\"),\n        ),\n        cert: fs.readFileSync(\n          path.resolve(__dirname, \"../fixtures/ssl/localhost-cert.pem\"),\n        ),\n      },\n    },\n    (_, devServer) => [\n      {\n        name: \"webpack-dev-middleware\",\n        middleware: wdm.honoWrapper(devServer.compiler),\n      },\n    ],\n  ],\n];\n\nconst [major] = process.versions.node.split(\".\").map(Number);\n\nif (major < 24) {\n  apps.push(\n    [\"express\", () => require(\"express\")(), \"spdy\"],\n    [\"connect\", () => require(\"connect\")(), \"spdy\"],\n  );\n}\n\ndescribe(\"app option\", () => {\n  for (const [appName, app, server, setupMiddlewares] of apps) {\n    let compiler;\n    let devServer;\n    let page;\n    let browser;\n    let pageErrors;\n    let consoleMessages;\n\n    describe(`should work using \"${appName}\" application and \"${typeof server === \"function\" ? \"custom server\" : server}\" server`, () => {\n      beforeEach(async () => {\n        compiler = webpack(config);\n\n        devServer = new Server(\n          {\n            static: {\n              directory: staticDirectory,\n              watch: false,\n            },\n            app,\n            server,\n            port,\n            setupMiddlewares:\n              typeof setupMiddlewares !== \"undefined\"\n                ? setupMiddlewares\n                : undefined,\n          },\n          compiler,\n        );\n\n        await devServer.start();\n\n        ({ page, browser } = await runBrowser());\n\n        pageErrors = [];\n        consoleMessages = [];\n      });\n\n      afterEach(async () => {\n        await browser.close();\n        await devServer.stop();\n        await new Promise((resolve) => {\n          compiler.close(() => {\n            resolve();\n          });\n        });\n      });\n\n      it(\"should handle GET request to index route (/)\", async () => {\n        page\n          .on(\"console\", (message) => {\n            consoleMessages.push(message);\n          })\n          .on(\"pageerror\", (error) => {\n            pageErrors.push(error);\n          });\n\n        const pageUrl = devServer.isTlsServer\n          ? `https://localhost:${port}/`\n          : `http://localhost:${port}/`;\n\n        const response = await page.goto(pageUrl, {\n          waitUntil: \"networkidle0\",\n        });\n\n        const HTTPVersion = await page.evaluate(\n          () => performance.getEntries()[0].nextHopProtocol,\n        );\n\n        if (\n          server === \"spdy\" ||\n          server === \"http2\" ||\n          (server.options && server.options.allowHTTP1)\n        ) {\n          expect(HTTPVersion).toBe(\"h2\");\n        } else {\n          expect(HTTPVersion).toBe(\"http/1.1\");\n        }\n\n        expect(response.status()).toBe(200);\n\n        const text = await response.text();\n\n        expect(text).toContain(\n          '<script type=\"text/javascript\" charset=\"utf-8\" src=\"/main.js\"></script>',\n        );\n        expect(consoleMessages.map((message) => message.text())).toEqual([\n          \"[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.\",\n          \"[HMR] Waiting for update signal from WDS...\",\n          \"Hey.\",\n        ]);\n        expect(pageErrors).toHaveLength(0);\n      });\n    });\n  }\n});\n"
  },
  {
    "path": "test/e2e/bonjour.test.js",
    "content": "\"use strict\";\n\nconst os = require(\"node:os\");\nconst webpack = require(\"webpack\");\nconst Server = require(\"../../lib/Server\");\nconst config = require(\"../fixtures/simple-config/webpack.config\");\nconst runBrowser = require(\"../helpers/run-browser\");\nconst port = require(\"../ports-map\").bonjour;\n\ndescribe(\"bonjour option\", () => {\n  let mockPublish;\n  let mockUnpublishAll;\n  let mockDestroy;\n\n  beforeEach(() => {\n    mockPublish = jest.fn();\n    mockUnpublishAll = jest.fn((callback) => {\n      callback();\n    });\n    mockDestroy = jest.fn();\n  });\n\n  describe(\"as true\", () => {\n    let compiler;\n    let server;\n    let page;\n    let browser;\n    let pageErrors;\n    let consoleMessages;\n\n    beforeEach(async () => {\n      jest.mock(\"bonjour-service\", () => ({\n        Bonjour: jest.fn().mockImplementation(() => ({\n          publish: mockPublish,\n          unpublishAll: mockUnpublishAll,\n          destroy: mockDestroy,\n        })),\n      }));\n\n      compiler = webpack(config);\n\n      server = new Server({ port, bonjour: true }, compiler);\n\n      await server.start();\n\n      ({ page, browser } = await runBrowser());\n\n      pageErrors = [];\n      consoleMessages = [];\n    });\n\n    afterEach(async () => {\n      await browser.close();\n      await server.stop();\n\n      mockPublish.mockReset();\n      mockUnpublishAll.mockReset();\n      mockDestroy.mockReset();\n    });\n\n    it(\"should call bonjour with correct params\", async () => {\n      page\n        .on(\"console\", (message) => {\n          consoleMessages.push(message);\n        })\n        .on(\"pageerror\", (error) => {\n          pageErrors.push(error);\n        });\n\n      const response = await page.goto(`http://localhost:${port}/`, {\n        waitUntil: \"networkidle0\",\n      });\n\n      expect(mockPublish).toHaveBeenCalledTimes(1);\n\n      expect(mockPublish).toHaveBeenCalledWith({\n        name: `Webpack Dev Server ${os.hostname()}:${port}`,\n        port,\n        type: \"http\",\n        subtypes: [\"webpack\"],\n      });\n\n      expect(mockUnpublishAll).toHaveBeenCalledTimes(0);\n      expect(mockDestroy).toHaveBeenCalledTimes(0);\n\n      expect(response.status()).toMatchSnapshot(\"response status\");\n\n      expect(consoleMessages.map((message) => message.text())).toMatchSnapshot(\n        \"console messages\",\n      );\n\n      expect(pageErrors).toMatchSnapshot(\"page errors\");\n    });\n  });\n\n  describe(\"with 'server' option\", () => {\n    let compiler;\n    let server;\n    let page;\n    let browser;\n    let pageErrors;\n    let consoleMessages;\n\n    beforeEach(async () => {\n      jest.mock(\"bonjour-service\", () => ({\n        Bonjour: jest.fn().mockImplementation(() => ({\n          publish: mockPublish,\n          unpublishAll: mockUnpublishAll,\n          destroy: mockDestroy,\n        })),\n      }));\n\n      compiler = webpack(config);\n\n      server = new Server({ bonjour: true, port, server: \"https\" }, compiler);\n\n      await server.start();\n\n      ({ page, browser } = await runBrowser());\n\n      pageErrors = [];\n      consoleMessages = [];\n    });\n\n    afterEach(async () => {\n      await browser.close();\n      await server.stop();\n    });\n\n    it(\"should call bonjour with 'https' type\", async () => {\n      page\n        .on(\"console\", (message) => {\n          consoleMessages.push(message);\n        })\n        .on(\"pageerror\", (error) => {\n          pageErrors.push(error);\n        });\n\n      const response = await page.goto(`https://localhost:${port}/`, {\n        waitUntil: \"networkidle0\",\n      });\n\n      expect(mockPublish).toHaveBeenCalledTimes(1);\n\n      expect(mockPublish).toHaveBeenCalledWith({\n        name: `Webpack Dev Server ${os.hostname()}:${port}`,\n        port,\n        type: \"https\",\n        subtypes: [\"webpack\"],\n      });\n\n      expect(mockUnpublishAll).toHaveBeenCalledTimes(0);\n      expect(mockDestroy).toHaveBeenCalledTimes(0);\n\n      expect(response.status()).toMatchSnapshot(\"response status\");\n\n      expect(consoleMessages.map((message) => message.text())).toMatchSnapshot(\n        \"console messages\",\n      );\n\n      expect(pageErrors).toMatchSnapshot(\"page errors\");\n    });\n  });\n\n  describe(\"as object\", () => {\n    let compiler;\n    let server;\n    let page;\n    let browser;\n    let pageErrors;\n    let consoleMessages;\n\n    beforeEach(async () => {\n      jest.mock(\"bonjour-service\", () => ({\n        Bonjour: jest.fn().mockImplementation(() => ({\n          publish: mockPublish,\n          unpublishAll: mockUnpublishAll,\n          destroy: mockDestroy,\n        })),\n      }));\n\n      compiler = webpack(config);\n\n      server = new Server(\n        {\n          port,\n          bonjour: {\n            type: \"https\",\n            protocol: \"udp\",\n          },\n        },\n        compiler,\n      );\n\n      await server.start();\n\n      ({ page, browser } = await runBrowser());\n\n      pageErrors = [];\n      consoleMessages = [];\n    });\n\n    afterEach(async () => {\n      await browser.close();\n      await server.stop();\n    });\n\n    it(\"should apply bonjour options\", async () => {\n      page\n        .on(\"console\", (message) => {\n          consoleMessages.push(message);\n        })\n        .on(\"pageerror\", (error) => {\n          pageErrors.push(error);\n        });\n\n      const response = await page.goto(`http://localhost:${port}/`, {\n        waitUntil: \"networkidle0\",\n      });\n\n      expect(mockPublish).toHaveBeenCalledTimes(1);\n\n      expect(mockPublish).toHaveBeenCalledWith({\n        name: `Webpack Dev Server ${os.hostname()}:${port}`,\n        port,\n        type: \"https\",\n        protocol: \"udp\",\n        subtypes: [\"webpack\"],\n      });\n\n      expect(mockUnpublishAll).toHaveBeenCalledTimes(0);\n      expect(mockDestroy).toHaveBeenCalledTimes(0);\n\n      expect(response.status()).toMatchSnapshot(\"response status\");\n\n      expect(consoleMessages.map((message) => message.text())).toMatchSnapshot(\n        \"console messages\",\n      );\n\n      expect(pageErrors).toMatchSnapshot(\"page errors\");\n    });\n  });\n\n  describe(\"bonjour object and 'server' option\", () => {\n    let compiler;\n    let server;\n    let page;\n    let browser;\n    let pageErrors;\n    let consoleMessages;\n\n    beforeEach(async () => {\n      jest.mock(\"bonjour-service\", () => ({\n        Bonjour: jest.fn().mockImplementation(() => ({\n          publish: mockPublish,\n          unpublishAll: mockUnpublishAll,\n          destroy: mockDestroy,\n        })),\n      }));\n\n      compiler = webpack(config);\n\n      server = new Server(\n        {\n          port,\n          bonjour: {\n            type: \"http\",\n            protocol: \"udp\",\n          },\n          server: {\n            type: \"https\",\n          },\n        },\n        compiler,\n      );\n\n      await server.start();\n\n      ({ page, browser } = await runBrowser());\n\n      pageErrors = [];\n      consoleMessages = [];\n    });\n\n    afterEach(async () => {\n      await browser.close();\n      await server.stop();\n    });\n\n    it(\"should apply bonjour options\", async () => {\n      page\n        .on(\"console\", (message) => {\n          consoleMessages.push(message);\n        })\n        .on(\"pageerror\", (error) => {\n          pageErrors.push(error);\n        });\n\n      const response = await page.goto(`https://localhost:${port}/`, {\n        waitUntil: \"networkidle0\",\n      });\n\n      expect(mockPublish).toHaveBeenCalledTimes(1);\n\n      expect(mockPublish).toHaveBeenCalledWith({\n        name: `Webpack Dev Server ${os.hostname()}:${port}`,\n        port,\n        type: \"http\",\n        protocol: \"udp\",\n        subtypes: [\"webpack\"],\n      });\n\n      expect(mockUnpublishAll).toHaveBeenCalledTimes(0);\n      expect(mockDestroy).toHaveBeenCalledTimes(0);\n\n      expect(response.status()).toMatchSnapshot(\"response status\");\n\n      expect(consoleMessages.map((message) => message.text())).toMatchSnapshot(\n        \"console messages\",\n      );\n\n      expect(pageErrors).toMatchSnapshot(\"page errors\");\n    });\n  });\n});\n"
  },
  {
    "path": "test/e2e/built-in-routes.test.js",
    "content": "\"use strict\";\n\nconst webpack = require(\"webpack\");\nconst Server = require(\"../../lib/Server\");\nconst config = require(\"../fixtures/client-config/webpack.config\");\nconst multiConfig = require(\"../fixtures/multi-public-path-config/webpack.config\");\nconst runBrowser = require(\"../helpers/run-browser\");\nconst port = require(\"../ports-map\").routes;\n\ndescribe(\"Built in routes\", () => {\n  describe(\"with simple config\", () => {\n    let compiler;\n    let server;\n    let page;\n    let browser;\n    let pageErrors;\n    let consoleMessages;\n\n    beforeEach(async () => {\n      compiler = webpack(config);\n      server = new Server({ port }, compiler);\n\n      await server.start();\n\n      ({ page, browser } = await runBrowser());\n\n      pageErrors = [];\n      consoleMessages = [];\n    });\n\n    afterEach(async () => {\n      await browser.close();\n      await server.stop();\n    });\n\n    it(\"should handles GET request to sockjs bundle\", async () => {\n      page\n        .on(\"console\", (message) => {\n          consoleMessages.push(message);\n        })\n        .on(\"pageerror\", (error) => {\n          pageErrors.push(error);\n        });\n\n      const response = await page.goto(\n        `http://localhost:${port}/__webpack_dev_server__/sockjs.bundle.js`,\n        {\n          waitUntil: \"networkidle0\",\n        },\n      );\n\n      expect(response.headers()[\"content-type\"]).toMatchSnapshot(\n        \"response headers content-type\",\n      );\n\n      expect(response.status()).toMatchSnapshot(\"response status\");\n\n      expect(consoleMessages.map((message) => message.text())).toMatchSnapshot(\n        \"console messages\",\n      );\n\n      expect(pageErrors).toMatchSnapshot(\"page errors\");\n    });\n\n    it(\"should handles HEAD request to sockjs bundle\", async () => {\n      page\n        .on(\"console\", (message) => {\n          consoleMessages.push(message);\n        })\n        .on(\"pageerror\", (error) => {\n          pageErrors.push(error);\n        })\n        .on(\"request\", (interceptedRequest) => {\n          if (interceptedRequest.isInterceptResolutionHandled()) return;\n\n          interceptedRequest.continue({ method: \"HEAD\" }, 10);\n        });\n\n      const response = await page.goto(\n        `http://localhost:${port}/__webpack_dev_server__/sockjs.bundle.js`,\n        {\n          waitUntil: \"networkidle0\",\n        },\n      );\n\n      expect(response.headers()[\"content-type\"]).toMatchSnapshot(\n        \"response headers content-type\",\n      );\n\n      expect(response.status()).toMatchSnapshot(\"response status\");\n\n      expect(consoleMessages.map((message) => message.text())).toMatchSnapshot(\n        \"console messages\",\n      );\n\n      expect(pageErrors).toMatchSnapshot(\"page errors\");\n    });\n\n    it(\"should handle GET request to invalidate endpoint\", async () => {\n      page\n        .on(\"console\", (message) => {\n          consoleMessages.push(message);\n        })\n        .on(\"pageerror\", (error) => {\n          pageErrors.push(error);\n        });\n\n      const response = await page.goto(\n        `http://localhost:${port}/webpack-dev-server/invalidate`,\n        {\n          waitUntil: \"networkidle0\",\n        },\n      );\n\n      expect(response.headers()[\"content-type\"]).not.toBe(\"text/html\");\n\n      expect(response.status()).toMatchSnapshot(\"response status\");\n\n      expect(consoleMessages.map((message) => message.text())).toMatchSnapshot(\n        \"console messages\",\n      );\n\n      expect(pageErrors).toMatchSnapshot(\"page errors\");\n    });\n\n    it(\"should handle GET request to directory index and list all middleware directories\", async () => {\n      page\n        .on(\"console\", (message) => {\n          consoleMessages.push(message);\n        })\n        .on(\"pageerror\", (error) => {\n          pageErrors.push(error);\n        });\n\n      const response = await page.goto(\n        `http://localhost:${port}/webpack-dev-server/`,\n        {\n          waitUntil: \"networkidle0\",\n        },\n      );\n\n      expect(response.headers()[\"content-type\"]).toMatchSnapshot(\n        \"response headers content-type\",\n      );\n\n      expect(response.status()).toMatchSnapshot(\"response status\");\n\n      expect(await response.text()).toMatchSnapshot(\"directory list\");\n\n      expect(consoleMessages.map((message) => message.text())).toMatchSnapshot(\n        \"console messages\",\n      );\n\n      expect(pageErrors).toMatchSnapshot(\"page errors\");\n    });\n\n    it(\"should handle HEAD request to directory index\", async () => {\n      page\n        .on(\"console\", (message) => {\n          consoleMessages.push(message);\n        })\n        .on(\"pageerror\", (error) => {\n          pageErrors.push(error);\n        })\n        .on(\"request\", (interceptedRequest) => {\n          if (interceptedRequest.isInterceptResolutionHandled()) return;\n\n          interceptedRequest.continue({ method: \"HEAD\" });\n        });\n\n      const response = await page.goto(\n        `http://localhost:${port}/webpack-dev-server/`,\n        {\n          waitUntil: \"networkidle0\",\n        },\n      );\n\n      expect(response.headers()[\"content-type\"]).toMatchSnapshot(\n        \"response headers content-type\",\n      );\n\n      expect(response.status()).toMatchSnapshot(\"response status\");\n\n      expect(await response.text()).toMatchSnapshot(\"directory list\");\n\n      expect(consoleMessages.map((message) => message.text())).toMatchSnapshot(\n        \"console messages\",\n      );\n\n      expect(pageErrors).toMatchSnapshot(\"page errors\");\n    });\n\n    it(\"should handle GET request to magic async chunk\", async () => {\n      page\n        .on(\"console\", (message) => {\n          consoleMessages.push(message);\n        })\n        .on(\"pageerror\", (error) => {\n          pageErrors.push(error);\n        });\n\n      const response = await page.goto(`http://localhost:${port}/main.js`, {\n        waitUntil: \"networkidle0\",\n      });\n\n      expect(response.headers()[\"content-type\"]).toMatchSnapshot(\n        \"response headers content-type\",\n      );\n\n      expect(response.status()).toMatchSnapshot(\"response status\");\n\n      expect(consoleMessages.map((message) => message.text())).toMatchSnapshot(\n        \"console messages\",\n      );\n    });\n\n    it(\"should handle HEAD request to magic async chunk\", async () => {\n      page\n        .on(\"console\", (message) => {\n          consoleMessages.push(message);\n        })\n        .on(\"pageerror\", (error) => {\n          pageErrors.push(error);\n        })\n        .on(\"request\", (interceptedRequest) => {\n          if (interceptedRequest.isInterceptResolutionHandled()) return;\n\n          interceptedRequest.continue({ method: \"HEAD\" });\n        });\n\n      const response = await page.goto(`http://localhost:${port}/main.js`, {\n        waitUntil: \"networkidle0\",\n      });\n\n      expect(response.headers()[\"content-type\"]).toMatchSnapshot(\n        \"response headers content-type\",\n      );\n\n      expect(response.status()).toMatchSnapshot(\"response status\");\n\n      expect(consoleMessages.map((message) => message.text())).toMatchSnapshot(\n        \"console messages\",\n      );\n    });\n  });\n\n  describe(\"with multi config\", () => {\n    let compiler;\n    let server;\n    let page;\n    let browser;\n    let pageErrors;\n    let consoleMessages;\n\n    beforeEach(async () => {\n      compiler = webpack(multiConfig);\n      server = new Server({ port }, compiler);\n\n      await server.start();\n\n      ({ page, browser } = await runBrowser());\n\n      pageErrors = [];\n      consoleMessages = [];\n    });\n\n    afterEach(async () => {\n      await browser.close();\n      await server.stop();\n    });\n\n    it(\"should handle GET request to directory index and list all middleware directories\", async () => {\n      page\n        .on(\"console\", (message) => {\n          consoleMessages.push(message);\n        })\n        .on(\"pageerror\", (error) => {\n          pageErrors.push(error);\n        });\n\n      const response = await page.goto(\n        `http://localhost:${port}/webpack-dev-server/`,\n        {\n          waitUntil: \"networkidle0\",\n        },\n      );\n\n      expect(response.headers()[\"content-type\"]).toMatchSnapshot(\n        \"response headers content-type\",\n      );\n\n      expect(response.status()).toMatchSnapshot(\"response status\");\n\n      expect(await response.text()).toMatchSnapshot(\"directory list\");\n\n      expect(consoleMessages.map((message) => message.text())).toMatchSnapshot(\n        \"console messages\",\n      );\n\n      expect(pageErrors).toMatchSnapshot(\"page errors\");\n    });\n  });\n});\n"
  },
  {
    "path": "test/e2e/client-reconnect.test.js",
    "content": "\"use strict\";\n\nconst webpack = require(\"webpack\");\nconst Server = require(\"../../lib/Server\");\nconst config = require(\"../fixtures/simple-config/webpack.config\");\nconst runBrowser = require(\"../helpers/run-browser\");\nconst port = require(\"../ports-map\")[\"client-reconnect-option\"];\n\ndescribe(\"client.reconnect option\", () => {\n  describe(\"specified as true\", () => {\n    let compiler;\n    let server;\n    let page;\n    let browser;\n    let pageErrors;\n    let consoleMessages;\n\n    beforeEach(async () => {\n      compiler = webpack(config);\n\n      server = new Server({ port, client: { reconnect: true } }, compiler);\n\n      await server.start();\n\n      ({ page, browser } = await runBrowser());\n\n      pageErrors = [];\n      consoleMessages = [];\n    });\n\n    afterEach(async () => {\n      await browser.close();\n    });\n\n    it(\"should try to reconnect unlimited times\", async () => {\n      page\n        .on(\"console\", (message) => {\n          consoleMessages.push(message);\n        })\n        .on(\"pageerror\", (error) => {\n          pageErrors.push(error);\n        });\n\n      const response = await page.goto(`http://localhost:${port}/`, {\n        waitUntil: \"networkidle0\",\n      });\n\n      try {\n        expect(response.status()).toMatchSnapshot(\"response status\");\n      } finally {\n        await server.stop();\n      }\n\n      let interval;\n\n      await new Promise((resolve) => {\n        interval = setInterval(() => {\n          const retryingMessages = consoleMessages.filter((message) =>\n            message.text().includes(\"Trying to reconnect...\"),\n          );\n\n          if (retryingMessages.length >= 5) {\n            clearInterval(interval);\n\n            resolve();\n          }\n        }, 1000);\n      });\n\n      expect(pageErrors).toMatchSnapshot(\"page errors\");\n    });\n  });\n\n  describe(\"specified as false\", () => {\n    let compiler;\n    let server;\n    let page;\n    let browser;\n    let pageErrors;\n    let consoleMessages;\n\n    beforeEach(async () => {\n      compiler = webpack(config);\n\n      server = new Server({ port, client: { reconnect: false } }, compiler);\n\n      await server.start();\n\n      ({ page, browser } = await runBrowser());\n\n      pageErrors = [];\n      consoleMessages = [];\n    });\n\n    afterEach(async () => {\n      await browser.close();\n    });\n\n    it(\"should not try to reconnect\", async () => {\n      page\n        .on(\"console\", (message) => {\n          consoleMessages.push(message);\n        })\n        .on(\"pageerror\", (error) => {\n          pageErrors.push(error);\n        });\n\n      const response = await page.goto(`http://localhost:${port}/`, {\n        waitUntil: \"networkidle0\",\n      });\n\n      try {\n        expect(response.status()).toMatchSnapshot(\"response status\");\n      } finally {\n        await server.stop();\n      }\n\n      // Can't wait to check for unlimited times so wait only for couple retries\n      await new Promise((resolve) => {\n        setTimeout(\n          () => {\n            resolve();\n          },\n          1000 * 2 ** 3,\n        );\n      });\n\n      expect(consoleMessages.map((message) => message.text())).toMatchSnapshot(\n        \"console messages\",\n      );\n\n      expect(pageErrors).toMatchSnapshot(\"page errors\");\n    });\n  });\n\n  describe(\"specified as number\", () => {\n    let compiler;\n    let server;\n    let page;\n    let browser;\n    let pageErrors;\n    let consoleMessages;\n\n    beforeEach(async () => {\n      compiler = webpack(config);\n\n      server = new Server({ port, client: { reconnect: 2 } }, compiler);\n\n      await server.start();\n\n      ({ page, browser } = await runBrowser());\n\n      pageErrors = [];\n      consoleMessages = [];\n    });\n\n    afterEach(async () => {\n      await browser.close();\n    });\n\n    it(\"should try to reconnect 2 times\", async () => {\n      page\n        .on(\"console\", (message) => {\n          consoleMessages.push(message);\n        })\n        .on(\"pageerror\", (error) => {\n          pageErrors.push(error);\n        });\n\n      const response = await page.goto(`http://localhost:${port}/`, {\n        waitUntil: \"networkidle0\",\n      });\n\n      try {\n        expect(response.status()).toMatchSnapshot(\"response status\");\n      } finally {\n        await server.stop();\n      }\n\n      // Can't wait to check for unlimited times so wait only for couple retries\n      await new Promise((resolve) => {\n        setTimeout(\n          () => {\n            resolve();\n          },\n          1000 * 2 ** 3,\n        );\n      });\n\n      expect(consoleMessages.map((message) => message.text())).toMatchSnapshot(\n        \"console messages\",\n      );\n\n      expect(pageErrors).toMatchSnapshot(\"page errors\");\n    });\n  });\n});\n"
  },
  {
    "path": "test/e2e/client.test.js",
    "content": "\"use strict\";\n\nconst webpack = require(\"webpack\");\nconst Server = require(\"../../lib/Server\");\nconst config = require(\"../fixtures/simple-config-other/webpack.config\");\nconst runBrowser = require(\"../helpers/run-browser\");\nconst port = require(\"../ports-map\")[\"client-option\"];\n\ndescribe(\"client option\", () => {\n  describe(\"default behaviour\", () => {\n    let compiler;\n    let server;\n    let page;\n    let browser;\n    let pageErrors;\n    let consoleMessages;\n\n    beforeEach(async () => {\n      compiler = webpack(config);\n\n      server = new Server(\n        {\n          client: {\n            webSocketTransport: \"sockjs\",\n          },\n          webSocketServer: \"sockjs\",\n          port,\n        },\n        compiler,\n      );\n\n      await server.start();\n\n      ({ page, browser } = await runBrowser());\n\n      pageErrors = [];\n      consoleMessages = [];\n    });\n\n    afterEach(async () => {\n      await browser.close();\n      await server.stop();\n    });\n\n    it(\"responds with a 200 status code for /ws path\", async () => {\n      page\n        .on(\"console\", (message) => {\n          consoleMessages.push(message);\n        })\n        .on(\"pageerror\", (error) => {\n          pageErrors.push(error);\n        });\n\n      const response = await page.goto(`http://localhost:${port}/ws`, {\n        waitUntil: \"networkidle0\",\n      });\n\n      // overlay should be true by default\n      expect(server.options.client.overlay).toBe(true);\n\n      expect(response.status()).toMatchSnapshot(\"response status\");\n\n      expect(consoleMessages.map((message) => message.text())).toMatchSnapshot(\n        \"console messages\",\n      );\n\n      expect(pageErrors).toMatchSnapshot(\"page errors\");\n    });\n  });\n\n  describe(\"should respect path option\", () => {\n    let compiler;\n    let server;\n    let page;\n    let browser;\n    let pageErrors;\n    let consoleMessages;\n\n    beforeEach(async () => {\n      compiler = webpack(config);\n\n      server = new Server(\n        {\n          client: {\n            webSocketTransport: \"sockjs\",\n          },\n          webSocketServer: {\n            type: \"sockjs\",\n            options: {\n              host: \"localhost\",\n              port,\n              path: \"/foo/test/bar\",\n            },\n          },\n          port,\n        },\n        compiler,\n      );\n\n      await server.start();\n\n      ({ page, browser } = await runBrowser());\n\n      pageErrors = [];\n      consoleMessages = [];\n    });\n\n    afterEach(async () => {\n      await browser.close();\n      await server.stop();\n    });\n\n    it(\"responds with a 200 status code for /foo/test/bar path\", async () => {\n      page\n        .on(\"console\", (message) => {\n          consoleMessages.push(message);\n        })\n        .on(\"pageerror\", (error) => {\n          pageErrors.push(error);\n        });\n\n      const response = await page.goto(\n        `http://localhost:${port}/foo/test/bar`,\n        {\n          waitUntil: \"networkidle0\",\n        },\n      );\n\n      expect(response.status()).toMatchSnapshot(\"response status\");\n\n      expect(consoleMessages.map((message) => message.text())).toMatchSnapshot(\n        \"console messages\",\n      );\n\n      expect(pageErrors).toMatchSnapshot(\"page errors\");\n    });\n  });\n\n  describe(\"configure client entry\", () => {\n    let compiler;\n    let server;\n    let page;\n    let browser;\n    let pageErrors;\n    let consoleMessages;\n\n    beforeEach(async () => {\n      compiler = webpack(config);\n\n      server = new Server(\n        {\n          client: false,\n          port,\n        },\n        compiler,\n      );\n\n      await server.start();\n\n      ({ page, browser } = await runBrowser());\n\n      pageErrors = [];\n      consoleMessages = [];\n    });\n\n    afterEach(async () => {\n      await browser.close();\n      await server.stop();\n    });\n\n    it(\"should disable client entry\", async () => {\n      page\n        .on(\"console\", (message) => {\n          consoleMessages.push(message);\n        })\n        .on(\"pageerror\", (error) => {\n          pageErrors.push(error);\n        });\n\n      const response = await page.goto(`http://localhost:${port}/main.js`, {\n        waitUntil: \"networkidle0\",\n      });\n\n      expect(response.status()).toMatchSnapshot(\"response status\");\n\n      expect(await response.text()).not.toMatch(/client\\/index\\.js/);\n\n      expect(consoleMessages.map((message) => message.text())).toMatchSnapshot(\n        \"console messages\",\n      );\n\n      expect(pageErrors).toMatchSnapshot(\"page errors\");\n    });\n  });\n\n  describe(\"override client entry\", () => {\n    let compiler;\n    let server;\n    let page;\n    let browser;\n\n    class OverrideServer extends Server {\n      getClientEntry() {\n        return require.resolve(\n          \"../fixtures/custom-client/CustomClientEntry.js\",\n        );\n      }\n\n      getClientHotEntry() {\n        return require.resolve(\n          \"../fixtures/custom-client/CustomClientHotEntry.js\",\n        );\n      }\n    }\n\n    beforeEach(async () => {\n      compiler = webpack(config);\n\n      server = new OverrideServer(\n        {\n          port,\n        },\n        compiler,\n      );\n\n      await server.start();\n\n      ({ page, browser } = await runBrowser());\n    });\n\n    afterEach(async () => {\n      await browser.close();\n      await server.stop();\n    });\n\n    it(\"should disable client entry\", async () => {\n      const response = await page.goto(`http://localhost:${port}/main.js`, {\n        waitUntil: \"networkidle0\",\n      });\n\n      expect(response.status()).toMatchSnapshot(\"response status\");\n\n      const content = await response.text();\n      expect(content).toContain(\"CustomClientEntry.js\");\n      expect(content).toContain(\"CustomClientHotEntry.js\");\n    });\n  });\n\n  describe(\"webSocketTransport\", () => {\n    const clientModes = [\n      {\n        title: 'as a string (\"sockjs\")',\n        client: {\n          webSocketTransport: \"sockjs\",\n        },\n        webSocketServer: \"sockjs\",\n        shouldThrow: false,\n      },\n      {\n        title: 'as a string (\"ws\")',\n        client: {\n          webSocketTransport: \"ws\",\n        },\n        webSocketServer: \"ws\",\n        shouldThrow: false,\n      },\n      {\n        title: 'as a path (\"sockjs\")',\n        client: {\n          webSocketTransport: require.resolve(\n            \"../../client-src/clients/SockJSClient\",\n          ),\n        },\n        webSocketServer: \"sockjs\",\n        shouldThrow: false,\n      },\n      {\n        title: 'as a path (\"ws\")',\n        client: {\n          webSocketTransport: require.resolve(\n            \"../../client-src/clients/WebSocketClient\",\n          ),\n        },\n        webSocketServer: \"ws\",\n        shouldThrow: false,\n      },\n      {\n        title: \"as a nonexistent path (sockjs)\",\n        client: {\n          webSocketTransport: \"/bad/path/to/implementation\",\n        },\n        webSocketServer: \"sockjs\",\n        shouldThrow: true,\n      },\n      {\n        title: \"as a nonexistent path (ws)\",\n        client: {\n          webSocketTransport: \"/bad/path/to/implementation\",\n        },\n        webSocketServer: \"ws\",\n        shouldThrow: true,\n      },\n    ];\n\n    describe(\"passed to server\", () => {\n      for (const data of clientModes) {\n        it(`${data.title} ${\n          data.shouldThrow ? \"should throw\" : \"should not throw\"\n        }`, async () => {\n          const compiler = webpack(config);\n\n          const server = new Server(\n            {\n              client: data.client,\n              port,\n            },\n            compiler,\n          );\n\n          let thrownError;\n\n          try {\n            await server.start();\n          } catch (error) {\n            thrownError = error;\n          }\n\n          if (data.shouldThrow) {\n            expect(thrownError.message).toMatch(\n              /client\\.webSocketTransport must be a string/,\n            );\n          }\n\n          await server.stop();\n        });\n      }\n    });\n  });\n});\n"
  },
  {
    "path": "test/e2e/compress.test.js",
    "content": "\"use strict\";\n\nconst webpack = require(\"webpack\");\nconst Server = require(\"../../lib/Server\");\nconst config = require(\"../fixtures/simple-config-other/webpack.config\");\nconst runBrowser = require(\"../helpers/run-browser\");\nconst port = require(\"../ports-map\")[\"compress-option\"];\n\ndescribe(\"compress option\", () => {\n  describe(\"enabled by default when not specified\", () => {\n    let compiler;\n    let server;\n    let page;\n    let browser;\n    let pageErrors;\n    let consoleMessages;\n\n    beforeEach(async () => {\n      compiler = webpack(config);\n\n      server = new Server({ port }, compiler);\n\n      await server.start();\n\n      ({ page, browser } = await runBrowser());\n\n      pageErrors = [];\n      consoleMessages = [];\n    });\n\n    afterEach(async () => {\n      await browser.close();\n      await server.stop();\n    });\n\n    it(\"should handle GET request to bundle file\", async () => {\n      page\n        .on(\"console\", (message) => {\n          consoleMessages.push(message);\n        })\n        .on(\"pageerror\", (error) => {\n          pageErrors.push(error);\n        });\n\n      const response = await page.goto(`http://localhost:${port}/main.js`, {\n        waitUntil: \"networkidle0\",\n      });\n\n      expect(response.status()).toMatchSnapshot(\"response status\");\n\n      expect(response.headers()[\"content-encoding\"]).toMatchSnapshot(\n        \"response headers content-encoding\",\n      );\n\n      expect(consoleMessages.map((message) => message.text())).toMatchSnapshot(\n        \"console messages\",\n      );\n\n      expect(pageErrors).toMatchSnapshot(\"page errors\");\n    });\n  });\n\n  describe(\"as true\", () => {\n    let compiler;\n    let server;\n    let page;\n    let browser;\n    let pageErrors;\n    let consoleMessages;\n\n    beforeEach(async () => {\n      compiler = webpack(config);\n\n      server = new Server(\n        {\n          compress: true,\n          port,\n        },\n        compiler,\n      );\n\n      await server.start();\n\n      ({ page, browser } = await runBrowser());\n\n      pageErrors = [];\n      consoleMessages = [];\n    });\n\n    afterEach(async () => {\n      await browser.close();\n      await server.stop();\n    });\n\n    it(\"should handle GET request to bundle file\", async () => {\n      page\n        .on(\"console\", (message) => {\n          consoleMessages.push(message);\n        })\n        .on(\"pageerror\", (error) => {\n          pageErrors.push(error);\n        });\n\n      const response = await page.goto(`http://localhost:${port}/main.js`, {\n        waitUntil: \"networkidle0\",\n      });\n\n      expect(response.status()).toMatchSnapshot(\"response status\");\n\n      expect(response.headers()[\"content-encoding\"]).toMatchSnapshot(\n        \"response headers content-encoding\",\n      );\n\n      expect(consoleMessages.map((message) => message.text())).toMatchSnapshot(\n        \"console messages\",\n      );\n\n      expect(pageErrors).toMatchSnapshot(\"page errors\");\n    });\n  });\n\n  describe(\"as false\", () => {\n    let compiler;\n    let server;\n    let page;\n    let browser;\n    let pageErrors;\n    let consoleMessages;\n\n    beforeEach(async () => {\n      compiler = webpack(config);\n\n      server = new Server(\n        {\n          compress: false,\n          port,\n        },\n        compiler,\n      );\n\n      await server.start();\n\n      ({ page, browser } = await runBrowser());\n\n      pageErrors = [];\n      consoleMessages = [];\n    });\n\n    afterEach(async () => {\n      await browser.close();\n      await server.stop();\n    });\n\n    it(\"should handle GET request to bundle file\", async () => {\n      page\n        .on(\"console\", (message) => {\n          consoleMessages.push(message);\n        })\n        .on(\"pageerror\", (error) => {\n          pageErrors.push(error);\n        });\n\n      const response = await page.goto(`http://localhost:${port}/main.js`, {\n        waitUntil: \"networkidle0\",\n      });\n\n      expect(response.status()).toMatchSnapshot(\"response status\");\n\n      expect(response.headers()[\"content-encoding\"]).toMatchSnapshot(\n        \"response headers content-encoding\",\n      );\n\n      expect(consoleMessages.map((message) => message.text())).toMatchSnapshot(\n        \"console messages\",\n      );\n\n      expect(pageErrors).toMatchSnapshot(\"page errors\");\n    });\n  });\n});\n"
  },
  {
    "path": "test/e2e/cross-origin-request.test.js",
    "content": "\"use strict\";\n\nconst webpack = require(\"webpack\");\nconst Server = require(\"../../lib/Server\");\nconst config = require(\"../fixtures/client-config/webpack.config\");\nconst runBrowser = require(\"../helpers/run-browser\");\nconst [port1, port2] = require(\"../ports-map\")[\"cross-origin-request\"];\n\ndescribe(\"cross-origin requests\", () => {\n  const devServerPort = port1;\n  const htmlServerPort = port2;\n  const htmlServerHost = \"127.0.0.1\";\n\n  it(\"should return 403 for cross-origin no-cors non-module script tag requests\", async () => {\n    const compiler = webpack(config);\n    const devServerOptions = {\n      port: devServerPort,\n      allowedHosts: \"auto\",\n    };\n    const server = new Server(devServerOptions, compiler);\n\n    await server.start();\n\n    // Start a separate server for serving the HTML file\n    const http = require(\"node:http\");\n\n    const htmlServer = http.createServer((req, res) => {\n      res.writeHead(200, { \"Content-Type\": \"text/html\" });\n      res.end(`\n        <html>\n          <head>\n            <script src=\"http://localhost:${devServerPort}/main.js\"></script>\n          </head>\n          <body></body>\n        </html>\n      `);\n    });\n    htmlServer.listen(htmlServerPort, htmlServerHost);\n\n    const { page, browser } = await runBrowser();\n\n    try {\n      const pageErrors = [];\n\n      page.on(\"pageerror\", (error) => {\n        pageErrors.push(error);\n      });\n\n      const scriptTagRequest = page.waitForResponse(\n        `http://localhost:${devServerPort}/main.js`,\n      );\n\n      await page.goto(`http://${htmlServerHost}:${htmlServerPort}`);\n\n      const response = await scriptTagRequest;\n\n      expect(response.status()).toBe(403);\n    } finally {\n      await browser.close();\n      await server.stop();\n      htmlServer.close();\n    }\n  });\n\n  it(\"should return 200 for cross-origin cors non-module script tag requests\", async () => {\n    const compiler = webpack(config);\n    const devServerOptions = {\n      port: devServerPort,\n      allowedHosts: \"auto\",\n      headers: {\n        \"Access-Control-Allow-Origin\": \"*\",\n      },\n    };\n    const server = new Server(devServerOptions, compiler);\n\n    await server.start();\n\n    // Start a separate server for serving the HTML file\n    const http = require(\"node:http\");\n\n    const htmlServer = http.createServer((req, res) => {\n      res.writeHead(200, { \"Content-Type\": \"text/html\" });\n      res.end(`\n        <html>\n          <head>\n            <script src=\"http://localhost:${devServerPort}/main.js\" crossorigin></script>\n          </head>\n          <body></body>\n        </html>\n      `);\n    });\n    htmlServer.listen(htmlServerPort, htmlServerHost);\n\n    const { page, browser } = await runBrowser();\n\n    try {\n      const pageErrors = [];\n\n      page.on(\"pageerror\", (error) => {\n        pageErrors.push(error);\n      });\n\n      const scriptTagRequest = page.waitForResponse(\n        `http://localhost:${devServerPort}/main.js`,\n      );\n\n      await page.goto(`http://${htmlServerHost}:${htmlServerPort}`);\n\n      const response = await scriptTagRequest;\n\n      expect(response.status()).toBe(200);\n    } finally {\n      await browser.close();\n      await server.stop();\n      htmlServer.close();\n    }\n  });\n\n  it(\"should return 200 for cross-origin no-cors non-module script tag requests with the 'allowedHost' option and 'all' value\", async () => {\n    const compiler = webpack(config);\n    const devServerOptions = {\n      port: devServerPort,\n      allowedHosts: \"all\",\n    };\n    const server = new Server(devServerOptions, compiler);\n\n    await server.start();\n\n    // Start a separate server for serving the HTML file\n    const http = require(\"node:http\");\n\n    const htmlServer = http.createServer((req, res) => {\n      res.writeHead(200, { \"Content-Type\": \"text/html\" });\n      res.end(`\n        <html>\n          <head>\n            <script src=\"http://localhost:${devServerPort}/main.js\"></script>\n          </head>\n          <body></body>\n        </html>\n      `);\n    });\n    htmlServer.listen(htmlServerPort, htmlServerHost);\n\n    const { page, browser } = await runBrowser();\n\n    try {\n      const pageErrors = [];\n\n      page.on(\"pageerror\", (error) => {\n        pageErrors.push(error);\n      });\n\n      const scriptTagRequest = page.waitForResponse(\n        `http://localhost:${devServerPort}/main.js`,\n      );\n\n      await page.goto(`http://${htmlServerHost}:${htmlServerPort}`);\n\n      const response = await scriptTagRequest;\n\n      expect(response.status()).toBe(200);\n    } finally {\n      await browser.close();\n      await server.stop();\n      htmlServer.close();\n    }\n  });\n\n  it(\"should return 200 for cross-origin no-cors non-module script tag requests with the `allowedHost` option and the `localhost` value\", async () => {\n    const compiler = webpack(config);\n    const devServerOptions = {\n      port: devServerPort,\n      allowedHosts: [\"localhost\"],\n    };\n    const server = new Server(devServerOptions, compiler);\n\n    await server.start();\n\n    // Start a separate server for serving the HTML file\n    const http = require(\"node:http\");\n\n    const htmlServer = http.createServer((req, res) => {\n      res.writeHead(200, { \"Content-Type\": \"text/html\" });\n      res.end(`\n        <html>\n          <head>\n            <script src=\"http://localhost:${devServerPort}/main.js\"></script>\n          </head>\n          <body></body>\n        </html>\n      `);\n    });\n    htmlServer.listen(htmlServerPort, htmlServerHost);\n\n    const { page, browser } = await runBrowser();\n\n    try {\n      const pageErrors = [];\n\n      page.on(\"pageerror\", (error) => {\n        pageErrors.push(error);\n      });\n\n      const scriptTagRequest = page.waitForResponse(\n        `http://localhost:${devServerPort}/main.js`,\n      );\n\n      await page.goto(`http://${htmlServerHost}:${htmlServerPort}`);\n\n      const response = await scriptTagRequest;\n\n      expect(response.status()).toBe(200);\n    } finally {\n      await browser.close();\n      await server.stop();\n      htmlServer.close();\n    }\n  });\n});\n"
  },
  {
    "path": "test/e2e/entry.test.js",
    "content": "\"use strict\";\n\nconst path = require(\"node:path\");\nconst webpack = require(\"webpack\");\nconst Server = require(\"../../lib/Server\");\nconst config = require(\"../fixtures/client-config/webpack.config\");\nconst runBrowser = require(\"../helpers/run-browser\");\nconst port = require(\"../ports-map\").entry;\n\nconst HOT_ENABLED_MESSAGE =\n  \"[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.\";\n\nconst waitForConsoleLogFinished = async (consoleLogs) => {\n  await new Promise((resolve) => {\n    const interval = setInterval(() => {\n      if (consoleLogs.includes(HOT_ENABLED_MESSAGE)) {\n        clearInterval(interval);\n\n        resolve();\n      }\n    }, 100);\n  });\n};\n\ndescribe(\"entry\", () => {\n  const entryFirst = path.resolve(\n    __dirname,\n    \"../fixtures/client-config/foo.js\",\n  );\n  const entrySecond = path.resolve(\n    __dirname,\n    \"../fixtures/client-config/bar.js\",\n  );\n\n  it(\"should work with single entry\", async () => {\n    const compiler = webpack({ ...config, entry: entryFirst });\n    const devServerOptions = {\n      port,\n    };\n    const server = new Server(devServerOptions, compiler);\n\n    await server.start();\n\n    const { page, browser } = await runBrowser();\n\n    try {\n      const pageErrors = [];\n      const consoleMessages = [];\n\n      page\n        .on(\"console\", (message) => {\n          consoleMessages.push(message);\n        })\n        .on(\"pageerror\", (error) => {\n          pageErrors.push(error);\n        });\n\n      await page.goto(`http://localhost:${port}/`, {\n        waitUntil: \"networkidle0\",\n      });\n\n      expect(consoleMessages.map((message) => message.text())).toMatchSnapshot(\n        \"console messages\",\n      );\n      expect(pageErrors).toMatchSnapshot(\"page errors\");\n    } finally {\n      await browser.close();\n      await server.stop();\n    }\n  });\n\n  it(\"should work with single array entry\", async () => {\n    const compiler = webpack({ ...config, entry: [entryFirst, entrySecond] });\n    const devServerOptions = {\n      port,\n    };\n    const server = new Server(devServerOptions, compiler);\n\n    await server.start();\n\n    const { page, browser } = await runBrowser();\n\n    try {\n      const pageErrors = [];\n      const consoleMessages = [];\n\n      page\n        .on(\"console\", (message) => {\n          consoleMessages.push(message);\n        })\n        .on(\"pageerror\", (error) => {\n          pageErrors.push(error);\n        });\n\n      await page.goto(`http://localhost:${port}/`, {\n        waitUntil: \"networkidle0\",\n      });\n\n      expect(consoleMessages.map((message) => message.text())).toMatchSnapshot(\n        \"console messages\",\n      );\n      expect(pageErrors).toMatchSnapshot(\"page errors\");\n    } finally {\n      await browser.close();\n      await server.stop();\n    }\n  });\n\n  it(\"should work with object entry\", async () => {\n    const compiler = webpack({\n      ...config,\n      entry: {\n        main: { import: entryFirst },\n      },\n    });\n    const devServerOptions = {\n      port,\n    };\n    const server = new Server(devServerOptions, compiler);\n\n    await server.start();\n\n    const { page, browser } = await runBrowser();\n\n    try {\n      const pageErrors = [];\n      const consoleMessages = [];\n\n      page\n        .on(\"console\", (message) => {\n          consoleMessages.push(message);\n        })\n        .on(\"pageerror\", (error) => {\n          pageErrors.push(error);\n        });\n\n      await page.goto(`http://localhost:${port}/`, {\n        waitUntil: \"networkidle0\",\n      });\n\n      expect(consoleMessages.map((message) => message.text())).toMatchSnapshot(\n        \"console messages\",\n      );\n      expect(pageErrors).toMatchSnapshot(\"page errors\");\n    } finally {\n      await browser.close();\n      await server.stop();\n    }\n  });\n\n  it(\"should work with dynamic entry\", async () => {\n    const compiler = webpack({ ...config, entry: () => entryFirst });\n    const devServerOptions = {\n      port,\n    };\n    const server = new Server(devServerOptions, compiler);\n\n    await server.start();\n\n    const { page, browser } = await runBrowser();\n\n    try {\n      const pageErrors = [];\n      const consoleMessages = [];\n\n      page\n        .on(\"console\", (message) => {\n          consoleMessages.push(message);\n        })\n        .on(\"pageerror\", (error) => {\n          pageErrors.push(error);\n        });\n\n      await page.goto(`http://localhost:${port}/`, {\n        waitUntil: \"networkidle0\",\n      });\n\n      expect(consoleMessages.map((message) => message.text())).toMatchSnapshot(\n        \"console messages\",\n      );\n      expect(pageErrors).toMatchSnapshot(\"page errors\");\n    } finally {\n      await browser.close();\n      await server.stop();\n    }\n  });\n\n  it(\"should work with dynamic async entry\", async () => {\n    const compiler = webpack({\n      ...config,\n      entry: () =>\n        new Promise((resolve) => {\n          resolve([entryFirst]);\n        }),\n    });\n    const devServerOptions = {\n      port,\n    };\n    const server = new Server(devServerOptions, compiler);\n\n    await server.start();\n\n    const { page, browser } = await runBrowser();\n\n    try {\n      const pageErrors = [];\n      const consoleMessages = [];\n\n      page\n        .on(\"console\", (message) => {\n          consoleMessages.push(message);\n        })\n        .on(\"pageerror\", (error) => {\n          pageErrors.push(error);\n        });\n\n      await page.goto(`http://localhost:${port}/`, {\n        waitUntil: \"networkidle0\",\n      });\n\n      expect(consoleMessages.map((message) => message.text())).toMatchSnapshot(\n        \"console messages\",\n      );\n      expect(pageErrors).toMatchSnapshot(\"page errors\");\n    } finally {\n      await browser.close();\n      await server.stop();\n    }\n  });\n\n  it(\"should work with multiple entries\", async () => {\n    const compiler = webpack({\n      ...config,\n      entry: {\n        foo: entryFirst,\n        bar: entrySecond,\n      },\n      optimization: {\n        runtimeChunk: {\n          name: \"runtime\",\n        },\n      },\n    });\n    const devServerOptions = {\n      port,\n    };\n    const server = new Server(devServerOptions, compiler);\n\n    await server.start();\n\n    const { page, browser } = await runBrowser();\n\n    try {\n      const pageErrors = [];\n      const consoleMessages = [];\n\n      page\n        .on(\"console\", (message) => {\n          consoleMessages.push(message.text());\n        })\n        .on(\"pageerror\", (error) => {\n          pageErrors.push(error);\n        });\n\n      await page.goto(`http://localhost:${port}/test.html`, {\n        waitUntil: \"networkidle0\",\n      });\n      await page.addScriptTag({ url: `http://localhost:${port}/runtime.js` });\n      await page.addScriptTag({ url: `http://localhost:${port}/foo.js` });\n      await waitForConsoleLogFinished(consoleMessages);\n\n      expect(consoleMessages).toMatchSnapshot(\"console messages\");\n      expect(pageErrors).toMatchSnapshot(\"page errors\");\n    } finally {\n      await browser.close();\n      await server.stop();\n    }\n  });\n\n  it(\"should work with multiple entries #2\", async () => {\n    const compiler = webpack({\n      ...config,\n      entry: {\n        foo: entryFirst,\n        bar: entrySecond,\n      },\n      optimization: {\n        runtimeChunk: {\n          name: \"runtime\",\n        },\n      },\n    });\n    const devServerOptions = {\n      port,\n    };\n    const server = new Server(devServerOptions, compiler);\n\n    await server.start();\n\n    const { page, browser } = await runBrowser();\n\n    try {\n      const pageErrors = [];\n      const consoleMessages = [];\n\n      page\n        .on(\"console\", (message) => {\n          consoleMessages.push(message.text());\n        })\n        .on(\"pageerror\", (error) => {\n          pageErrors.push(error);\n        });\n\n      await page.goto(`http://localhost:${port}/test.html`, {\n        waitUntil: \"networkidle0\",\n      });\n      await page.addScriptTag({ url: `http://localhost:${port}/runtime.js` });\n      await page.addScriptTag({ url: `http://localhost:${port}/bar.js` });\n      await waitForConsoleLogFinished(consoleMessages);\n\n      expect(consoleMessages).toMatchSnapshot(\"console messages\");\n      expect(pageErrors).toMatchSnapshot(\"page errors\");\n    } finally {\n      await browser.close();\n      await server.stop();\n    }\n  });\n\n  it('should work with multiple entries and \"dependOn\"', async () => {\n    const compiler = webpack({\n      ...config,\n      entry: {\n        foo: {\n          import: entryFirst,\n          dependOn: \"bar\",\n        },\n        bar: entrySecond,\n      },\n    });\n    const devServerOptions = {\n      port,\n    };\n    const server = new Server(devServerOptions, compiler);\n\n    await server.start();\n\n    const { page, browser } = await runBrowser();\n\n    try {\n      const pageErrors = [];\n      const consoleMessages = [];\n\n      page\n        .on(\"console\", (message) => {\n          consoleMessages.push(message.text());\n        })\n        .on(\"pageerror\", (error) => {\n          pageErrors.push(error);\n        });\n\n      await page.goto(`http://localhost:${port}/test.html`, {\n        waitUntil: \"networkidle0\",\n      });\n      await page.addScriptTag({ url: `http://localhost:${port}/bar.js` });\n      await page.addScriptTag({ url: `http://localhost:${port}/foo.js` });\n      await waitForConsoleLogFinished(consoleMessages);\n\n      expect(consoleMessages).toMatchSnapshot(\"console messages\");\n      expect(pageErrors).toMatchSnapshot(\"page errors\");\n    } finally {\n      await browser.close();\n      await server.stop();\n    }\n  });\n\n  it(\"should work with empty\", async () => {\n    const compiler = webpack({\n      ...config,\n      entry: {},\n    });\n\n    new webpack.EntryPlugin(compiler.context, entryFirst, {\n      name: \"main\",\n    }).apply(compiler);\n\n    const devServerOptions = {\n      port,\n    };\n    const server = new Server(devServerOptions, compiler);\n\n    await server.start();\n\n    const { page, browser } = await runBrowser();\n\n    try {\n      const pageErrors = [];\n      const consoleMessages = [];\n\n      page\n        .on(\"console\", (message) => {\n          consoleMessages.push(message);\n        })\n        .on(\"pageerror\", (error) => {\n          pageErrors.push(error);\n        });\n\n      await page.goto(`http://localhost:${port}/`, {\n        waitUntil: \"networkidle0\",\n      });\n\n      expect(consoleMessages.map((message) => message.text())).toMatchSnapshot(\n        \"console messages\",\n      );\n      expect(pageErrors).toMatchSnapshot(\"page errors\");\n    } finally {\n      await browser.close();\n      await server.stop();\n    }\n  });\n});\n"
  },
  {
    "path": "test/e2e/headers.test.js",
    "content": "\"use strict\";\n\nconst request = require(\"supertest\");\nconst webpack = require(\"webpack\");\nconst Server = require(\"../../lib/Server\");\nconst config = require(\"../fixtures/simple-config/webpack.config\");\nconst runBrowser = require(\"../helpers/run-browser\");\nconst port = require(\"../ports-map\")[\"headers-option\"];\n\ndescribe(\"headers option\", () => {\n  describe(\"as a string\", () => {\n    let compiler;\n    let server;\n    let page;\n    let browser;\n    let pageErrors;\n    let consoleMessages;\n\n    beforeEach(async () => {\n      compiler = webpack(config);\n\n      server = new Server(\n        {\n          headers: { \"X-Foo\": \"dev-server headers\" },\n          port,\n        },\n        compiler,\n      );\n\n      await server.start();\n\n      ({ page, browser } = await runBrowser());\n\n      pageErrors = [];\n      consoleMessages = [];\n    });\n\n    afterEach(async () => {\n      await browser.close();\n      await server.stop();\n    });\n\n    it(\"should handle GET request with headers\", async () => {\n      page\n        .on(\"console\", (message) => {\n          consoleMessages.push(message);\n        })\n        .on(\"pageerror\", (error) => {\n          pageErrors.push(error);\n        });\n\n      const response = await page.goto(`http://localhost:${port}/`, {\n        waitUntil: \"networkidle0\",\n      });\n\n      expect(response.headers()[\"x-foo\"]).toMatchSnapshot(\n        \"response headers x-foo\",\n      );\n\n      expect(response.status()).toMatchSnapshot(\"response status\");\n\n      expect(consoleMessages.map((message) => message.text())).toMatchSnapshot(\n        \"console messages\",\n      );\n\n      expect(pageErrors).toMatchSnapshot(\"page errors\");\n    });\n  });\n\n  describe(\"as an array of objects\", () => {\n    let compiler;\n    let server;\n    let page;\n    let browser;\n    let pageErrors;\n    let consoleMessages;\n\n    beforeEach(async () => {\n      compiler = webpack(config);\n\n      server = new Server(\n        {\n          headers: [\n            {\n              key: \"X-Foo\",\n              value: \"value1\",\n            },\n            {\n              key: \"X-Bar\",\n              value: \"value2\",\n            },\n          ],\n          port,\n        },\n        compiler,\n      );\n\n      await server.start();\n\n      ({ page, browser } = await runBrowser());\n\n      pageErrors = [];\n      consoleMessages = [];\n    });\n\n    afterEach(async () => {\n      await browser.close();\n      await server.stop();\n    });\n\n    it(\"should handle GET request with headers\", async () => {\n      page\n        .on(\"console\", (message) => {\n          consoleMessages.push(message);\n        })\n        .on(\"pageerror\", (error) => {\n          pageErrors.push(error);\n        });\n\n      const response = await page.goto(`http://localhost:${port}/`, {\n        waitUntil: \"networkidle0\",\n      });\n\n      expect(response.headers()[\"x-foo\"]).toMatchSnapshot(\n        \"response headers x-foo\",\n      );\n\n      expect(response.headers()[\"x-bar\"]).toMatchSnapshot(\n        \"response headers x-bar\",\n      );\n\n      expect(response.status()).toMatchSnapshot(\"response status\");\n\n      expect(consoleMessages.map((message) => message.text())).toMatchSnapshot(\n        \"console messages\",\n      );\n\n      expect(pageErrors).toMatchSnapshot(\"page errors\");\n    });\n  });\n\n  describe(\"as an array\", () => {\n    let compiler;\n    let server;\n    let page;\n    let browser;\n    let pageErrors;\n    let consoleMessages;\n\n    beforeEach(async () => {\n      compiler = webpack(config);\n\n      server = new Server(\n        {\n          headers: { \"X-Bar\": [\"key1=value1\", \"key2=value2\"] },\n          port,\n        },\n        compiler,\n      );\n\n      await server.start();\n\n      ({ page, browser } = await runBrowser());\n\n      pageErrors = [];\n      consoleMessages = [];\n    });\n\n    afterEach(async () => {\n      await browser.close();\n      await server.stop();\n    });\n\n    it(\"should handle GET request with headers as an array\", async () => {\n      page\n        .on(\"console\", (message) => {\n          consoleMessages.push(message);\n        })\n        .on(\"pageerror\", (error) => {\n          pageErrors.push(error);\n        });\n\n      const response = await page.goto(`http://localhost:${port}/`, {\n        waitUntil: \"networkidle0\",\n      });\n\n      expect(response.headers()[\"x-bar\"]).toMatchSnapshot(\n        \"response headers x-bar\",\n      );\n\n      expect(response.status()).toMatchSnapshot(\"response status\");\n\n      expect(consoleMessages.map((message) => message.text())).toMatchSnapshot(\n        \"console messages\",\n      );\n\n      expect(pageErrors).toMatchSnapshot(\"page errors\");\n    });\n  });\n\n  describe(\"as a function\", () => {\n    let compiler;\n    let server;\n    let page;\n    let browser;\n    let pageErrors;\n    let consoleMessages;\n\n    beforeEach(async () => {\n      compiler = webpack(config);\n\n      server = new Server(\n        {\n          headers: () => ({ \"X-Bar\": [\"key1=value1\", \"key2=value2\"] }),\n          port,\n        },\n        compiler,\n      );\n\n      await server.start();\n\n      ({ page, browser } = await runBrowser());\n\n      pageErrors = [];\n      consoleMessages = [];\n    });\n\n    afterEach(async () => {\n      await browser.close();\n      await server.stop();\n    });\n\n    it(\"should handle GET request with headers as a function\", async () => {\n      page\n        .on(\"console\", (message) => {\n          consoleMessages.push(message);\n        })\n        .on(\"pageerror\", (error) => {\n          pageErrors.push(error);\n        });\n\n      const response = await page.goto(`http://localhost:${port}/`, {\n        waitUntil: \"networkidle0\",\n      });\n\n      expect(response.headers()[\"x-bar\"]).toMatchSnapshot(\n        \"response headers x-bar\",\n      );\n\n      expect(response.status()).toMatchSnapshot(\"response status\");\n\n      expect(consoleMessages.map((message) => message.text())).toMatchSnapshot(\n        \"console messages\",\n      );\n\n      expect(pageErrors).toMatchSnapshot(\"page errors\");\n    });\n  });\n\n  describe(\"as a function returning an array\", () => {\n    let compiler;\n    let server;\n    let page;\n    let browser;\n    let pageErrors;\n    let consoleMessages;\n\n    beforeEach(async () => {\n      compiler = webpack(config);\n\n      server = new Server(\n        {\n          headers: () => [\n            {\n              key: \"X-Foo\",\n              value: \"value1\",\n            },\n            {\n              key: \"X-Bar\",\n              value: \"value2\",\n            },\n          ],\n          port,\n        },\n        compiler,\n      );\n\n      await server.start();\n\n      ({ page, browser } = await runBrowser());\n\n      pageErrors = [];\n      consoleMessages = [];\n    });\n\n    afterEach(async () => {\n      await browser.close();\n      await server.stop();\n    });\n\n    it(\"should handle GET request with headers\", async () => {\n      page\n        .on(\"console\", (message) => {\n          consoleMessages.push(message);\n        })\n        .on(\"pageerror\", (error) => {\n          pageErrors.push(error);\n        });\n\n      const response = await page.goto(`http://localhost:${port}/`, {\n        waitUntil: \"networkidle0\",\n      });\n\n      expect(response.headers()[\"x-foo\"]).toMatchSnapshot(\n        \"response headers x-foo\",\n      );\n\n      expect(response.headers()[\"x-bar\"]).toMatchSnapshot(\n        \"response headers x-bar\",\n      );\n\n      expect(response.status()).toMatchSnapshot(\"response status\");\n\n      expect(consoleMessages.map((message) => message.text())).toMatchSnapshot(\n        \"console messages\",\n      );\n\n      expect(pageErrors).toMatchSnapshot(\"page errors\");\n    });\n  });\n\n  describe(\"dev middleware headers take precedence for dev middleware output files\", () => {\n    let compiler;\n    let server;\n    let page;\n    let browser;\n    let pageErrors;\n    let consoleMessages;\n\n    beforeEach(async () => {\n      compiler = webpack(config);\n\n      server = new Server(\n        {\n          headers: { \"X-Foo\": \"dev-server-headers\" },\n          devMiddleware: {\n            headers: { \"X-Foo\": \"dev-middleware-headers\" },\n          },\n          port,\n        },\n        compiler,\n      );\n\n      await server.start();\n\n      ({ page, browser } = await runBrowser());\n\n      pageErrors = [];\n      consoleMessages = [];\n    });\n\n    afterEach(async () => {\n      await browser.close();\n      await server.stop();\n    });\n\n    it(\"should handle GET request with headers as a function\", async () => {\n      page\n        .on(\"console\", (message) => {\n          consoleMessages.push(message);\n        })\n        .on(\"pageerror\", (error) => {\n          pageErrors.push(error);\n        });\n\n      const response = await page.goto(`http://localhost:${port}/`, {\n        waitUntil: \"networkidle0\",\n      });\n\n      expect(response.headers()[\"x-foo\"]).toMatchSnapshot(\n        \"response headers x-foo\",\n      );\n\n      expect(response.status()).toMatchSnapshot(\"response status\");\n\n      expect(consoleMessages.map((message) => message.text())).toMatchSnapshot(\n        \"console messages\",\n      );\n\n      expect(pageErrors).toMatchSnapshot(\"page errors\");\n    });\n  });\n\n  describe(\"as a string and support HEAD request\", () => {\n    let compiler;\n    let server;\n    let page;\n    let browser;\n    let pageErrors;\n    let consoleMessages;\n    let req;\n\n    beforeEach(async () => {\n      compiler = webpack(config);\n\n      server = new Server(\n        {\n          headers: { \"X-Foo\": \"dev-server headers\" },\n          port,\n        },\n        compiler,\n      );\n\n      await server.start();\n\n      req = request(server.app);\n\n      ({ page, browser } = await runBrowser());\n\n      pageErrors = [];\n      consoleMessages = [];\n    });\n\n    afterEach(async () => {\n      await browser.close();\n      await server.stop();\n    });\n\n    it(\"should handle HEAD request with headers\", async () => {\n      page\n        .on(\"console\", (message) => {\n          consoleMessages.push(message);\n        })\n        .on(\"pageerror\", (error) => {\n          pageErrors.push(error);\n        });\n\n      const response = await page.goto(`http://localhost:${port}/`, {\n        waitUntil: \"networkidle0\",\n      });\n\n      expect(response.headers()[\"x-foo\"]).toMatchSnapshot(\n        \"response headers x-foo\",\n      );\n      expect(response.status()).toMatchSnapshot(\"response status\");\n      expect(consoleMessages.map((message) => message.text())).toMatchSnapshot(\n        \"console messages\",\n      );\n      expect(pageErrors).toMatchSnapshot(\"page errors\");\n\n      const responseForHead = await req.get(\"/\");\n\n      expect(responseForHead.headers[\"x-foo\"]).toBe(\"dev-server headers\");\n    });\n  });\n});\n"
  },
  {
    "path": "test/e2e/history-api-fallback.test.js",
    "content": "\"use strict\";\n\nconst path = require(\"node:path\");\nconst webpack = require(\"webpack\");\nconst Server = require(\"../../lib/Server\");\nconst config2 = require(\"../fixtures/historyapifallback-2-config/webpack.config\");\nconst config3 = require(\"../fixtures/historyapifallback-3-config/webpack.config\");\nconst config = require(\"../fixtures/historyapifallback-config/webpack.config\");\nconst runBrowser = require(\"../helpers/run-browser\");\nconst port = require(\"../ports-map\")[\"history-api-fallback-option\"];\n\ndescribe(\"historyApiFallback option\", () => {\n  describe(\"as boolean\", () => {\n    let compiler;\n    let server;\n    let page;\n    let browser;\n    let pageErrors;\n    let consoleMessages;\n\n    beforeEach(async () => {\n      compiler = webpack(config);\n\n      server = new Server(\n        {\n          historyApiFallback: true,\n          port,\n        },\n        compiler,\n      );\n\n      await server.start();\n\n      ({ page, browser } = await runBrowser());\n\n      pageErrors = [];\n      consoleMessages = [];\n    });\n\n    afterEach(async () => {\n      await browser.close();\n      await server.stop();\n    });\n\n    it(\"should handle GET request to directory\", async () => {\n      page\n        .on(\"console\", (message) => {\n          consoleMessages.push(message);\n        })\n        .on(\"pageerror\", (error) => {\n          pageErrors.push(error);\n        });\n\n      const response = await page.goto(`http://localhost:${port}/foo`, {\n        waitUntil: \"networkidle0\",\n      });\n\n      expect(response.headers()[\"content-type\"]).toMatchSnapshot(\n        \"response headers content-type\",\n      );\n\n      expect(response.status()).toMatchSnapshot(\"response status\");\n\n      expect(await response.text()).toMatchSnapshot(\"response text\");\n\n      expect(consoleMessages.map((message) => message.text())).toMatchSnapshot(\n        \"console messages\",\n      );\n\n      expect(pageErrors).toMatchSnapshot(\"page errors\");\n    });\n  });\n\n  describe(\"as object\", () => {\n    let compiler;\n    let server;\n    let page;\n    let browser;\n    let pageErrors;\n    let consoleMessages;\n\n    beforeEach(async () => {\n      compiler = webpack(config);\n\n      server = new Server(\n        {\n          historyApiFallback: {\n            index: \"/bar.html\",\n          },\n          port,\n        },\n        compiler,\n      );\n\n      await server.start();\n\n      ({ page, browser } = await runBrowser());\n\n      pageErrors = [];\n      consoleMessages = [];\n    });\n\n    afterEach(async () => {\n      await browser.close();\n      await server.stop();\n    });\n\n    it(\"should handle GET request to directory\", async () => {\n      page\n        .on(\"console\", (message) => {\n          consoleMessages.push(message);\n        })\n        .on(\"pageerror\", (error) => {\n          pageErrors.push(error);\n        });\n\n      const response = await page.goto(`http://localhost:${port}/foo`, {\n        waitUntil: \"networkidle0\",\n      });\n\n      expect(response.headers()[\"content-type\"]).toMatchSnapshot(\n        \"response headers content-type\",\n      );\n\n      expect(response.status()).toMatchSnapshot(\"response status\");\n\n      expect(await response.text()).toMatchSnapshot(\"response text\");\n\n      expect(consoleMessages.map((message) => message.text())).toMatchSnapshot(\n        \"console messages\",\n      );\n\n      expect(pageErrors).toMatchSnapshot(\"page errors\");\n    });\n  });\n\n  describe(\"as object with static\", () => {\n    let compiler;\n    let server;\n    let page;\n    let browser;\n    let pageErrors;\n    let consoleMessages;\n\n    beforeEach(async () => {\n      compiler = webpack(config2);\n\n      server = new Server(\n        {\n          static: path.resolve(\n            __dirname,\n            \"../fixtures/historyapifallback-2-config\",\n          ),\n          historyApiFallback: {\n            index: \"/bar.html\",\n          },\n          port,\n        },\n        compiler,\n      );\n\n      await server.start();\n\n      ({ page, browser } = await runBrowser());\n\n      pageErrors = [];\n      consoleMessages = [];\n    });\n\n    afterEach(async () => {\n      await browser.close();\n      await server.stop();\n    });\n\n    it(\"should handle GET request to directory\", async () => {\n      page\n        .on(\"console\", (message) => {\n          consoleMessages.push(message);\n        })\n        .on(\"pageerror\", (error) => {\n          pageErrors.push(error);\n        });\n\n      const response = await page.goto(`http://localhost:${port}/foo`, {\n        waitUntil: \"networkidle0\",\n      });\n\n      expect(response.headers()[\"content-type\"]).toMatchSnapshot(\n        \"response headers content-type\",\n      );\n\n      expect(response.status()).toMatchSnapshot(\"response status\");\n\n      expect(await response.text()).toMatchSnapshot(\"response text\");\n\n      expect(consoleMessages.map((message) => message.text())).toMatchSnapshot(\n        \"console messages\",\n      );\n\n      expect(pageErrors).toMatchSnapshot(\"page errors\");\n    });\n\n    it(\"should prefer static file over historyApiFallback\", async () => {\n      page\n        .on(\"console\", (message) => {\n          consoleMessages.push(message);\n        })\n        .on(\"pageerror\", (error) => {\n          pageErrors.push(error);\n        });\n\n      const response = await page.goto(\n        `http://localhost:${port}/random-file.txt`,\n        {\n          waitUntil: \"networkidle2\",\n        },\n      );\n\n      expect(response.headers()[\"content-type\"]).toMatchSnapshot(\n        \"response headers content-type\",\n      );\n\n      expect(response.status()).toMatchSnapshot(\"response status\");\n\n      expect(await response.text()).toMatchSnapshot(\"response text\");\n\n      expect(consoleMessages.map((message) => message.text())).toMatchSnapshot(\n        \"console messages\",\n      );\n\n      expect(pageErrors).toMatchSnapshot(\"page errors\");\n    });\n  });\n\n  describe(\"as object with static set to false\", () => {\n    let compiler;\n    let server;\n    let page;\n    let browser;\n    let pageErrors;\n    let consoleMessages;\n\n    beforeEach(async () => {\n      compiler = webpack(config3);\n\n      server = new Server(\n        {\n          static: false,\n          historyApiFallback: {\n            index: \"/bar.html\",\n          },\n          port,\n        },\n        compiler,\n      );\n\n      await server.start();\n\n      ({ page, browser } = await runBrowser());\n\n      pageErrors = [];\n      consoleMessages = [];\n    });\n\n    afterEach(async () => {\n      await browser.close();\n      await server.stop();\n    });\n\n    it(\"historyApiFallback should work and ignore static content\", async () => {\n      page\n        .on(\"console\", (message) => {\n          consoleMessages.push(message);\n        })\n        .on(\"pageerror\", (error) => {\n          pageErrors.push(error);\n        });\n\n      const response = await page.goto(`http://localhost:${port}/index.html`, {\n        waitUntil: \"networkidle0\",\n      });\n\n      expect(response.headers()[\"content-type\"]).toMatchSnapshot(\n        \"response headers content-type\",\n      );\n\n      expect(response.status()).toMatchSnapshot(\"response status\");\n\n      expect(await response.text()).toMatchSnapshot(\"response text\");\n\n      expect(consoleMessages.map((message) => message.text())).toMatchSnapshot(\n        \"console messages\",\n      );\n\n      expect(pageErrors).toMatchSnapshot(\"page errors\");\n    });\n  });\n\n  describe(\"as object with static and rewrites\", () => {\n    let compiler;\n    let server;\n    let page;\n    let browser;\n    let pageErrors;\n    let consoleMessages;\n\n    beforeEach(async () => {\n      compiler = webpack(config2);\n\n      server = new Server(\n        {\n          port,\n          static: path.resolve(\n            __dirname,\n            \"../fixtures/historyapifallback-2-config\",\n          ),\n          historyApiFallback: {\n            rewrites: [\n              {\n                from: /other/,\n                to: \"/other.html\",\n              },\n              {\n                from: /.*/,\n                to: \"/bar.html\",\n              },\n            ],\n          },\n        },\n        compiler,\n      );\n\n      await server.start();\n\n      ({ page, browser } = await runBrowser());\n\n      pageErrors = [];\n      consoleMessages = [];\n    });\n\n    afterEach(async () => {\n      await browser.close();\n      await server.stop();\n    });\n\n    it(\"historyApiFallback respect rewrites for index\", async () => {\n      page\n        .on(\"console\", (message) => {\n          consoleMessages.push(message);\n        })\n        .on(\"pageerror\", (error) => {\n          pageErrors.push(error);\n        });\n\n      const response = await page.goto(`http://localhost:${port}/`, {\n        waitUntil: \"networkidle0\",\n      });\n\n      expect(response.headers()[\"content-type\"]).toMatchSnapshot(\n        \"response headers content-type\",\n      );\n\n      expect(response.status()).toMatchSnapshot(\"response status\");\n\n      expect(await response.text()).toMatchSnapshot(\"response text\");\n\n      expect(consoleMessages.map((message) => message.text())).toMatchSnapshot(\n        \"console messages\",\n      );\n\n      expect(pageErrors).toMatchSnapshot(\"page errors\");\n    });\n\n    it(\"historyApiFallback respect rewrites and shows index for unknown urls\", async () => {\n      page\n        .on(\"console\", (message) => {\n          consoleMessages.push(message);\n        })\n        .on(\"pageerror\", (error) => {\n          pageErrors.push(error);\n        });\n\n      const response = await page.goto(`http://localhost:${port}/acme`, {\n        waitUntil: \"networkidle0\",\n      });\n\n      expect(response.headers()[\"content-type\"]).toMatchSnapshot(\n        \"response headers content-type\",\n      );\n\n      expect(response.status()).toMatchSnapshot(\"response status\");\n\n      expect(await response.text()).toMatchSnapshot(\"response text\");\n\n      expect(consoleMessages.map((message) => message.text())).toMatchSnapshot(\n        \"console messages\",\n      );\n\n      expect(pageErrors).toMatchSnapshot(\"page errors\");\n    });\n\n    it(\"historyApiFallback respect any other specified rewrites\", async () => {\n      page\n        .on(\"console\", (message) => {\n          consoleMessages.push(message);\n        })\n        .on(\"pageerror\", (error) => {\n          pageErrors.push(error);\n        });\n\n      const response = await page.goto(`http://localhost:${port}/other`, {\n        waitUntil: \"networkidle0\",\n      });\n\n      expect(response.headers()[\"content-type\"]).toMatchSnapshot(\n        \"response headers content-type\",\n      );\n\n      expect(response.status()).toMatchSnapshot(\"response status\");\n\n      expect(await response.text()).toMatchSnapshot(\"response text\");\n\n      expect(consoleMessages.map((message) => message.text())).toMatchSnapshot(\n        \"console messages\",\n      );\n\n      expect(pageErrors).toMatchSnapshot(\"page errors\");\n    });\n  });\n\n  describe('as object with the \"verbose\" option', () => {\n    let compiler;\n    let server;\n    let page;\n    let browser;\n    let pageErrors;\n    let consoleMessages;\n    let consoleSpy;\n\n    beforeEach(async () => {\n      consoleSpy = jest.spyOn(globalThis.console, \"log\");\n\n      compiler = webpack(config);\n\n      server = new Server(\n        {\n          historyApiFallback: {\n            index: \"/bar.html\",\n            verbose: true,\n          },\n          port,\n        },\n        compiler,\n      );\n\n      await server.start();\n\n      ({ page, browser } = await runBrowser());\n\n      pageErrors = [];\n      consoleMessages = [];\n    });\n\n    afterEach(async () => {\n      consoleSpy.mockRestore();\n      await browser.close();\n      await server.stop();\n    });\n\n    it(\"request to directory and log\", async () => {\n      page\n        .on(\"console\", (message) => {\n          consoleMessages.push(message);\n        })\n        .on(\"pageerror\", (error) => {\n          pageErrors.push(error);\n        });\n\n      const response = await page.goto(`http://localhost:${port}/foo`, {\n        waitUntil: \"networkidle0\",\n      });\n\n      expect(response.headers()[\"content-type\"]).toMatchSnapshot(\n        \"response headers content-type\",\n      );\n\n      expect(response.status()).toMatchSnapshot(\"response status\");\n\n      expect(await response.text()).toMatchSnapshot(\"response text\");\n\n      expect(consoleSpy).toHaveBeenCalledWith(\n        \"Rewriting\",\n        \"GET\",\n        \"/foo\",\n        \"to\",\n        \"/bar.html\",\n      );\n\n      expect(consoleMessages.map((message) => message.text())).toMatchSnapshot(\n        \"console messages\",\n      );\n\n      expect(pageErrors).toMatchSnapshot(\"page errors\");\n    });\n  });\n\n  describe('as object with the \"logger\" option', () => {\n    let compiler;\n    let server;\n    let page;\n    let browser;\n    let pageErrors;\n    let consoleMessages;\n    let consoleSpy;\n\n    beforeEach(async () => {\n      consoleSpy = jest.spyOn(globalThis.console, \"log\");\n\n      compiler = webpack(config);\n\n      server = new Server(\n        {\n          historyApiFallback: {\n            index: \"/bar.html\",\n            logger: consoleSpy,\n          },\n          port,\n        },\n        compiler,\n      );\n\n      await server.start();\n\n      ({ page, browser } = await runBrowser());\n\n      pageErrors = [];\n      consoleMessages = [];\n    });\n\n    afterEach(async () => {\n      consoleSpy.mockRestore();\n      await browser.close();\n      await server.stop();\n    });\n\n    it(\"request to directory and log\", async () => {\n      page\n        .on(\"console\", (message) => {\n          consoleMessages.push(message);\n        })\n        .on(\"pageerror\", (error) => {\n          pageErrors.push(error);\n        });\n\n      const response = await page.goto(`http://localhost:${port}/foo`, {\n        waitUntil: \"networkidle0\",\n      });\n\n      expect(response.headers()[\"content-type\"]).toMatchSnapshot(\n        \"response headers content-type\",\n      );\n\n      expect(response.status()).toMatchSnapshot(\"response status\");\n\n      expect(await response.text()).toMatchSnapshot(\"response text\");\n\n      expect(consoleSpy).toHaveBeenCalledWith(\n        \"Rewriting\",\n        \"GET\",\n        \"/foo\",\n        \"to\",\n        \"/bar.html\",\n      );\n\n      expect(consoleMessages.map((message) => message.text())).toMatchSnapshot(\n        \"console messages\",\n      );\n\n      expect(pageErrors).toMatchSnapshot(\"page errors\");\n    });\n  });\n\n  describe(\"in-memory files\", () => {\n    let compiler;\n    let server;\n    let page;\n    let browser;\n    let pageErrors;\n    let consoleMessages;\n\n    beforeEach(async () => {\n      compiler = webpack(config3);\n\n      server = new Server(\n        {\n          static: path.resolve(\n            __dirname,\n            \"../fixtures/historyapifallback-3-config\",\n          ),\n          historyApiFallback: true,\n          port,\n        },\n        compiler,\n      );\n\n      await server.start();\n\n      ({ page, browser } = await runBrowser());\n\n      pageErrors = [];\n      consoleMessages = [];\n    });\n\n    afterEach(async () => {\n      await browser.close();\n      await server.stop();\n    });\n\n    it(\"should take precedence over static files\", async () => {\n      page\n        .on(\"console\", (message) => {\n          consoleMessages.push(message);\n        })\n        .on(\"pageerror\", (error) => {\n          pageErrors.push(error);\n        });\n\n      const response = await page.goto(`http://localhost:${port}/foo`, {\n        waitUntil: \"networkidle0\",\n      });\n\n      expect(response.headers()[\"content-type\"]).toMatchSnapshot(\n        \"response headers content-type\",\n      );\n\n      expect(response.status()).toMatchSnapshot(\"response status\");\n\n      expect(await response.text()).toMatchSnapshot(\"response text\");\n\n      expect(consoleMessages.map((message) => message.text())).toMatchSnapshot(\n        \"console messages\",\n      );\n\n      expect(pageErrors).toMatchSnapshot(\"page errors\");\n    });\n\n    it(\"should perform HEAD request in same way as GET\", async () => {\n      await page.goto(`http://localhost:${port}/foo`, {\n        waitUntil: \"networkidle0\",\n      });\n\n      const responseGet = await page.evaluate(async () => {\n        const response = await fetch(\"/foo\", { method: \"GET\" });\n\n        return {\n          contentType: response.headers.get(\"content-type\"),\n          statusText: response.statusText,\n          text: await response.text(),\n        };\n      });\n\n      expect(responseGet.contentType).toMatchSnapshot(\n        \"response headers content-type\",\n      );\n\n      expect(responseGet.statusText).toMatchSnapshot(\"response status\");\n\n      expect(responseGet.text).toMatchSnapshot(\"response text\");\n\n      const responseHead = await page.evaluate(async () => {\n        const response = await fetch(\"/foo\", { method: \"HEAD\" });\n\n        return {\n          contentType: response.headers.get(\"content-type\"),\n          statusText: response.statusText,\n          text: await response.text(),\n        };\n      });\n\n      expect(responseHead).toMatchObject({\n        ...responseGet,\n        // HEAD response has an empty body\n        text: \"\",\n      });\n    });\n  });\n});\n"
  },
  {
    "path": "test/e2e/host.test.js",
    "content": "\"use strict\";\n\nconst http = require(\"node:http\");\nconst webpack = require(\"webpack\");\nconst Server = require(\"../../lib/Server\");\nconst config = require(\"../fixtures/client-config/webpack.config\");\nconst runBrowser = require(\"../helpers/run-browser\");\nconst port = require(\"../ports-map\").host;\n\nconst ipv4 = Server.findIp(\"v4\", false);\nconst ipv6 = Server.findIp(\"v6\", false);\n\nasync function getAddress(host, hostname) {\n  let address;\n\n  if (\n    typeof host === \"undefined\" ||\n    (typeof host === \"string\" && (host === \"<not-specified>\" || host === \"::\"))\n  ) {\n    address = \"::\";\n  } else if (host === \"0.0.0.0\") {\n    address = \"0.0.0.0\";\n  } else if (host === \"::1\") {\n    address = \"::1\";\n  } else if (host === \"localhost\") {\n    // It can be `127.0.0.1` or `::1` on different OS\n    const server = http.createServer((req, res) => {\n      res.statusCode = 200;\n      res.setHeader(\"Content-Type\", \"text/plain\");\n      res.end(\"Hello World\\n\");\n    });\n\n    await new Promise((resolve) => {\n      server.listen({ host: \"localhost\", port: 23100 }, resolve);\n    });\n\n    address = server.address().address;\n\n    await new Promise((resolve, reject) => {\n      server.close((err) => {\n        if (err) {\n          reject(err);\n          return;\n        }\n\n        resolve();\n      });\n    });\n  } else if (host === \"local-ipv6\") {\n    address = \"::\";\n  } else {\n    address = hostname;\n  }\n\n  return { address };\n}\n\ndescribe(\"host\", () => {\n  const hosts = [\n    \"<not-specified>\",\n\n    undefined,\n    \"0.0.0.0\",\n    \"::\",\n    \"::1\",\n    \"localhost\",\n    \"127.0.0.1\",\n    \"local-ip\",\n    \"local-ipv4\",\n    \"local-ipv6\",\n  ];\n\n  for (const host of hosts) {\n    it(`should work using \"${host}\" host and port as number`, async () => {\n      const compiler = webpack(config);\n      const devServerOptions = { port };\n\n      if (host !== \"<not-specified>\") {\n        devServerOptions.host = host;\n      }\n\n      if (\n        host === \"<not-specified>\" ||\n        typeof host === \"undefined\" ||\n        host === \"0.0.0.0\" ||\n        host === \"::\" ||\n        host === \"local-ipv6\"\n      ) {\n        devServerOptions.allowedHosts = \"all\";\n      }\n\n      const server = new Server(devServerOptions, compiler);\n\n      let hostname = host;\n\n      if (hostname === \"<not-specified>\" || typeof hostname === \"undefined\") {\n        // If host is omitted, the server will accept connections on the unspecified IPv6 address (::) when IPv6 is available, or the unspecified IPv4 address (0.0.0.0) otherwise.\n        hostname = ipv6 ? `[${ipv6}]` : ipv4;\n      } else if (hostname === \"0.0.0.0\") {\n        hostname = ipv4;\n      } else if (hostname === \"::\") {\n        // In most operating systems, listening to the unspecified IPv6 address (::) may cause the net.Server to also listen on the unspecified IPv4 address (0.0.0.0).\n        hostname = ipv6 ? `[${ipv6}]` : ipv4;\n      } else if (hostname === \"::1\") {\n        hostname = \"[::1]\";\n      } else if (hostname === \"local-ip\" || hostname === \"local-ipv4\") {\n        hostname = ipv4;\n      } else if (hostname === \"local-ipv6\") {\n        // For test env where network ipv6 doesn't work\n        hostname = ipv6 ? `[${ipv6}]` : \"[::1]\";\n      }\n\n      await server.start();\n\n      expect(server.server.address()).toMatchObject(\n        await getAddress(host, hostname),\n      );\n\n      const { page, browser } = await runBrowser();\n\n      try {\n        const pageErrors = [];\n        const consoleMessages = [];\n\n        page\n          .on(\"console\", (message) => {\n            consoleMessages.push(message);\n          })\n          .on(\"pageerror\", (error) => {\n            pageErrors.push(error);\n          });\n\n        await page.goto(`http://${hostname}:${port}/`, {\n          waitUntil: \"networkidle0\",\n        });\n\n        expect(\n          consoleMessages.map((message) => message.text()),\n        ).toMatchSnapshot(\"console messages\");\n\n        expect(pageErrors).toMatchSnapshot(\"page errors\");\n      } finally {\n        await browser.close();\n        await server.stop();\n      }\n    });\n\n    it(`should work using \"${host}\" host and port as string`, async () => {\n      const compiler = webpack(config);\n      const devServerOptions = { port: `${port}` };\n\n      if (host !== \"<not-specified>\") {\n        devServerOptions.host = host;\n      }\n\n      if (\n        host === \"<not-specified>\" ||\n        typeof host === \"undefined\" ||\n        host === \"0.0.0.0\" ||\n        host === \"::\" ||\n        host === \"local-ipv6\"\n      ) {\n        devServerOptions.allowedHosts = \"all\";\n      }\n\n      const server = new Server(devServerOptions, compiler);\n\n      let hostname = host;\n\n      if (hostname === \"<not-specified>\" || typeof hostname === \"undefined\") {\n        // If host is omitted, the server will accept connections on the unspecified IPv6 address (::) when IPv6 is available, or the unspecified IPv4 address (0.0.0.0) otherwise.\n        hostname = ipv6 ? `[${ipv6}]` : ipv4;\n      } else if (hostname === \"0.0.0.0\") {\n        hostname = ipv4;\n      } else if (hostname === \"::\") {\n        // In most operating systems, listening to the unspecified IPv6 address (::) may cause the net.Server to also listen on the unspecified IPv4 address (0.0.0.0).\n        hostname = ipv6 ? `[${ipv6}]` : ipv4;\n      } else if (hostname === \"::1\") {\n        hostname = \"[::1]\";\n      } else if (hostname === \"local-ip\" || hostname === \"local-ipv4\") {\n        hostname = ipv4;\n      } else if (hostname === \"local-ipv6\") {\n        // For test env where network ipv6 doesn't work\n        hostname = ipv6 ? `[${ipv6}]` : \"[::1]\";\n      }\n\n      await server.start();\n\n      expect(server.server.address()).toMatchObject(\n        await getAddress(host, hostname),\n      );\n\n      const { page, browser } = await runBrowser();\n\n      try {\n        const pageErrors = [];\n        const consoleMessages = [];\n\n        page\n          .on(\"console\", (message) => {\n            consoleMessages.push(message);\n          })\n          .on(\"pageerror\", (error) => {\n            pageErrors.push(error);\n          });\n\n        await page.goto(`http://${hostname}:${port}/`, {\n          waitUntil: \"networkidle0\",\n        });\n\n        expect(\n          consoleMessages.map((message) => message.text()),\n        ).toMatchSnapshot(\"console messages\");\n\n        expect(pageErrors).toMatchSnapshot(\"page errors\");\n      } finally {\n        await browser.close();\n        await server.stop();\n      }\n    });\n\n    it(`should work using \"${host}\" host and \"auto\" port`, async () => {\n      const compiler = webpack(config);\n\n      process.env.WEBPACK_DEV_SERVER_BASE_PORT = port;\n\n      const devServerOptions = { port: \"auto\" };\n\n      if (host !== \"<not-specified>\") {\n        devServerOptions.host = host;\n      }\n\n      if (\n        host === \"<not-specified>\" ||\n        typeof host === \"undefined\" ||\n        host === \"0.0.0.0\" ||\n        host === \"::\" ||\n        host === \"local-ipv6\"\n      ) {\n        devServerOptions.allowedHosts = \"all\";\n      }\n\n      const server = new Server(devServerOptions, compiler);\n\n      let hostname = host;\n\n      if (hostname === \"<not-specified>\" || typeof hostname === \"undefined\") {\n        // If host is omitted, the server will accept connections on the unspecified IPv6 address (::) when IPv6 is available, or the unspecified IPv4 address (0.0.0.0) otherwise.\n        hostname = ipv6 ? `[${ipv6}]` : ipv4;\n      } else if (hostname === \"0.0.0.0\") {\n        hostname = ipv4;\n      } else if (hostname === \"::\") {\n        // In most operating systems, listening to the unspecified IPv6 address (::) may cause the net.Server to also listen on the unspecified IPv4 address (0.0.0.0).\n        hostname = ipv6 ? `[${ipv6}]` : ipv4;\n      } else if (hostname === \"::1\") {\n        hostname = \"[::1]\";\n      } else if (hostname === \"local-ip\" || hostname === \"local-ipv4\") {\n        hostname = ipv4;\n      } else if (hostname === \"local-ipv6\") {\n        // For test env where network ipv6 doesn't work\n        hostname = ipv6 ? `[${ipv6}]` : \"[::1]\";\n      }\n\n      await server.start();\n\n      expect(server.server.address()).toMatchObject(\n        await getAddress(host, hostname),\n      );\n\n      const address = server.server.address();\n      const { page, browser } = await runBrowser();\n\n      try {\n        const pageErrors = [];\n        const consoleMessages = [];\n\n        page\n          .on(\"console\", (message) => {\n            consoleMessages.push(message);\n          })\n          .on(\"pageerror\", (error) => {\n            pageErrors.push(error);\n          });\n\n        await page.goto(`http://${hostname}:${address.port}/`, {\n          waitUntil: \"networkidle0\",\n        });\n\n        expect(\n          consoleMessages.map((message) => message.text()),\n        ).toMatchSnapshot(\"console messages\");\n\n        expect(pageErrors).toMatchSnapshot(\"page errors\");\n      } finally {\n        delete process.env.WEBPACK_DEV_SERVER_BASE_PORT;\n\n        await browser.close();\n        await server.stop();\n      }\n    });\n  }\n\n  // TODO need test on error\n  // eslint-disable-next-line jest/no-commented-out-tests\n  // it(`should throw an error on invalid host`, async () => {\n  //   const compiler = webpack(config);\n  //   const server = new Server({ port, host: \"unknown.unknown\" }, compiler);\n  //   const runDevServer = async () => {\n  //     await server.start();\n  //   };\n  //\n  //   return expect(runDevServer()).toBeDefined();\n  // });\n});\n"
  },
  {
    "path": "test/e2e/hot-and-live-reload.test.js",
    "content": "/**\n * @jest-environment node\n */\n\n\"use strict\";\n\nconst path = require(\"node:path\");\nconst fs = require(\"graceful-fs\");\nconst SockJS = require(\"sockjs-client\");\nconst webpack = require(\"webpack\");\nconst WebSocket = require(\"ws\");\nconst Server = require(\"../../lib/Server\");\nconst config = require(\"../fixtures/client-config/webpack.config\");\nconst multiCompilerConfig = require(\"../fixtures/multi-compiler-one-configuration/webpack.config\");\nconst reloadConfig = require(\"../fixtures/reload-config/webpack.config\");\nconst HTMLGeneratorPlugin = require(\"../helpers/html-generator-plugin\");\nconst runBrowser = require(\"../helpers/run-browser\");\nconst port = require(\"../ports-map\")[\"hot-and-live-reload\"];\n\nconst cssFilePath = path.resolve(\n  __dirname,\n  \"../fixtures/reload-config/main.css\",\n);\n\nconst INVALID_MESSAGE = \"[webpack-dev-server] App updated. Recompiling...\";\n\ndescribe(\"hot and live reload\", () => {\n  // \"sockjs\" client cannot add additional headers\n  const modes = [\n    {\n      title: \"should work and refresh content using hot module replacement\",\n    },\n    {\n      title: \"should work and do nothing when web socket server disabled\",\n      options: {\n        webSocketServer: false,\n      },\n    },\n    // Default web socket serve (\"ws\")\n    {\n      title:\n        \"should work and refresh content using hot module replacement when hot enabled\",\n      options: {\n        hot: true,\n      },\n    },\n    {\n      title:\n        \"should work and refresh content using hot module replacement when live reload enabled\",\n      options: {\n        liveReload: true,\n      },\n    },\n    {\n      title: \"should not refresh content when hot and no live reload disabled\",\n      options: {\n        hot: false,\n        liveReload: false,\n      },\n    },\n    {\n      title:\n        \"should work and refresh content using hot module replacement when live reload disabled and hot enabled\",\n      options: {\n        liveReload: false,\n        hot: true,\n      },\n    },\n    {\n      title: \"should work and refresh content using live reload\",\n      options: {\n        liveReload: true,\n        hot: false,\n      },\n    },\n    {\n      title:\n        \"should work and refresh content using hot module replacement when live reload enabled and hot disabled\",\n      options: {\n        liveReload: true,\n        hot: true,\n      },\n    },\n    // \"ws\" web socket serve\n    {\n      title:\n        \"should work and refresh content using hot module replacement when hot enabled\",\n      options: {\n        webSocketServer: \"ws\",\n        hot: true,\n      },\n    },\n    {\n      title:\n        \"should work and refresh content using hot module replacement when live reload enabled\",\n      options: {\n        webSocketServer: \"ws\",\n        liveReload: true,\n      },\n    },\n    {\n      title: \"should not refresh content when hot and no live reload disabled\",\n      options: {\n        webSocketServer: \"ws\",\n        hot: false,\n        liveReload: false,\n      },\n    },\n    {\n      title:\n        \"should work and refresh content using hot module replacement when live reload disabled and hot enabled\",\n      options: {\n        webSocketServer: \"ws\",\n        liveReload: false,\n        hot: true,\n      },\n    },\n    {\n      title:\n        \"should work and refresh content using live reload when live reload enabled and hot disabled\",\n      options: {\n        webSocketServer: \"ws\",\n        liveReload: true,\n        hot: false,\n      },\n    },\n    {\n      title:\n        \"should work and refresh content using hot module replacement when live reload and hot enabled\",\n      options: {\n        webSocketServer: \"ws\",\n        liveReload: true,\n        hot: true,\n      },\n    },\n    // \"sockjs\" web socket serve\n    {\n      title:\n        \"should work and refresh content using hot module replacement when hot enabled\",\n      options: {\n        allowedHosts: \"all\",\n\n        webSocketServer: \"sockjs\",\n        hot: true,\n      },\n    },\n    {\n      title:\n        \"should work and refresh content using hot module replacement when live reload enabled\",\n      options: {\n        allowedHosts: \"all\",\n\n        webSocketServer: \"sockjs\",\n        liveReload: true,\n      },\n    },\n    {\n      title: \"should not refresh content when hot and no live reload disabled\",\n      options: {\n        allowedHosts: \"all\",\n\n        webSocketServer: \"sockjs\",\n        hot: false,\n        liveReload: false,\n      },\n    },\n    {\n      title:\n        \"should work and refresh content using hot module replacement when live reload disabled and hot enabled\",\n      options: {\n        allowedHosts: \"all\",\n\n        webSocketServer: \"sockjs\",\n        liveReload: false,\n        hot: true,\n      },\n    },\n    {\n      title:\n        \"should work and refresh content using live reload when live reload disabled and hot enabled\",\n      options: {\n        allowedHosts: \"all\",\n\n        webSocketServer: \"sockjs\",\n        liveReload: true,\n        hot: false,\n      },\n    },\n    {\n      title:\n        \"should work and refresh content using hot module replacement when live reload and hot enabled\",\n      options: {\n        allowedHosts: \"all\",\n\n        webSocketServer: \"sockjs\",\n        liveReload: true,\n        hot: true,\n      },\n    },\n    {\n      title:\n        'should work and allow to disable hot module replacement using the \"webpack-dev-server-hot=false\"',\n      query: \"?webpack-dev-server-hot=false\",\n      options: {\n        liveReload: true,\n        hot: true,\n      },\n    },\n    {\n      title:\n        'should work and allow to disable live reload using the \"webpack-dev-server-live-reload=false\"',\n      query: \"?webpack-dev-server-live-reload=false\",\n      options: {\n        liveReload: true,\n        hot: false,\n      },\n    },\n    {\n      title:\n        'should work and allow to disable hot module replacement and live reload using the \"webpack-dev-server-hot=false&webpack-dev-server-live-reload=false\"',\n      query:\n        \"?webpack-dev-server-hot=false&webpack-dev-server-live-reload=false\",\n      options: {\n        liveReload: true,\n        hot: true,\n      },\n    },\n    {\n      title: \"should work with manual client setup\",\n      webpackOptions: {\n        entry: [\n          require.resolve(\"../../client-src/index.js\"),\n          require.resolve(\"../fixtures/reload-config/foo.js\"),\n        ],\n      },\n      options: {\n        client: false,\n        liveReload: true,\n        hot: true,\n      },\n    },\n    // TODO we still output logs from webpack, need to improve this\n    {\n      title:\n        \"should work with manual client setup and allow to enable hot module replacement\",\n      webpackOptions: {\n        entry: [\n          \"webpack/hot/dev-server\",\n          `${require.resolve(\"../../client-src/index.js\")}?hot=true`,\n          require.resolve(\"../fixtures/reload-config/foo.js\"),\n        ],\n        plugins: [\n          new webpack.HotModuleReplacementPlugin(),\n          new HTMLGeneratorPlugin(),\n        ],\n      },\n      options: {\n        client: false,\n        liveReload: false,\n        hot: false,\n      },\n    },\n    {\n      title:\n        \"should work with manual client setup and allow to disable hot module replacement\",\n      webpackOptions: {\n        entry: [\n          `${require.resolve(\"../../client-src/index.js\")}?hot=false`,\n          require.resolve(\"../fixtures/reload-config/foo.js\"),\n        ],\n      },\n      options: {\n        client: false,\n        liveReload: true,\n        hot: true,\n      },\n    },\n    {\n      title:\n        \"should work with manual client setup and allow to enable live reload\",\n      webpackOptions: {\n        entry: [\n          `${require.resolve(\"../../client-src/index.js\")}?live-reload=true`,\n          require.resolve(\"../fixtures/reload-config/foo.js\"),\n        ],\n      },\n      options: {\n        client: false,\n        liveReload: false,\n        hot: false,\n      },\n    },\n    {\n      title:\n        \"should work with manual client setup and allow to disable live reload\",\n      webpackOptions: {\n        entry: [\n          `${require.resolve(\"../../client-src/index.js\")}?live-reload=false`,\n          require.resolve(\"../fixtures/reload-config/foo.js\"),\n        ],\n      },\n      options: {\n        client: false,\n        liveReload: true,\n        hot: false,\n      },\n    },\n  ];\n\n  let browser;\n  let server;\n\n  beforeEach(() => {\n    fs.writeFileSync(cssFilePath, \"body { background-color: rgb(0, 0, 255); }\");\n  });\n\n  afterEach(async () => {\n    if (browser) {\n      await browser.close();\n    }\n\n    if (server) {\n      await server.stop();\n    }\n\n    fs.unlinkSync(cssFilePath);\n  });\n\n  for (const mode of modes) {\n    const webSocketServerTitle =\n      mode.options && mode.options.webSocketServer\n        ? mode.options.webSocketServer\n        : \"default\";\n\n    // eslint-disable-next-line no-loop-func\n    it(`${mode.title} (${webSocketServerTitle})`, async () => {\n      const webpackOptions = { ...reloadConfig, ...mode.webpackOptions };\n      const compiler = webpack(webpackOptions);\n      const testDevServerOptions = mode.options || {};\n      const devServerOptions = { port, ...testDevServerOptions };\n\n      server = new Server(devServerOptions, compiler);\n\n      await server.start();\n\n      const webSocketServerLaunched =\n        testDevServerOptions.webSocketServer !== false;\n\n      await new Promise((resolve) => {\n        const webSocketTransport =\n          typeof testDevServerOptions.webSocketServer !== \"undefined\" &&\n          testDevServerOptions.webSocketServer !== false\n            ? testDevServerOptions.webSocketServer\n            : \"ws\";\n\n        if (webSocketTransport === \"ws\") {\n          const ws = new WebSocket(\n            `ws://localhost:${devServerOptions.port}/ws`,\n            {\n              headers: {\n                host: `localhost:${devServerOptions.port}`,\n                origin: `http://localhost:${devServerOptions.port}`,\n              },\n            },\n          );\n\n          let opened = false;\n          let received = false;\n          let errored = false;\n\n          ws.on(\"error\", (_error) => {\n            errored = true;\n\n            ws.close();\n          });\n\n          ws.on(\"open\", () => {\n            opened = true;\n          });\n\n          ws.on(\"message\", (data) => {\n            const message = JSON.parse(data);\n\n            if (message.type === \"ok\") {\n              received = true;\n\n              ws.close();\n            }\n          });\n\n          ws.on(\"close\", () => {\n            if (opened && received && !errored) {\n              resolve();\n            } else if (!webSocketServerLaunched && errored) {\n              resolve();\n            }\n          });\n        } else {\n          const sockjs = new SockJS(\n            `http://localhost:${devServerOptions.port}/ws`,\n          );\n\n          let opened = false;\n          let received = false;\n          let errored = false;\n\n          sockjs.onerror = () => {\n            errored = true;\n          };\n\n          sockjs.onopen = () => {\n            opened = true;\n          };\n\n          sockjs.onmessage = ({ data }) => {\n            const message = JSON.parse(data);\n\n            if (message.type === \"ok\") {\n              received = true;\n\n              sockjs.close();\n            }\n          };\n\n          sockjs.onclose = (event) => {\n            if (opened && received && !errored) {\n              resolve();\n            } else if (event && event.reason === \"Cannot connect to server\") {\n              resolve();\n            }\n          };\n        }\n      });\n\n      const launched = await runBrowser();\n\n      ({ browser } = launched);\n\n      const { page } = launched;\n\n      const consoleMessages = [];\n      const pageErrors = [];\n\n      let doneHotUpdate = false;\n      let hasDisconnectedMessage = false;\n\n      page\n        .on(\"console\", (message) => {\n          if (!hasDisconnectedMessage) {\n            const text = message.text();\n\n            hasDisconnectedMessage = /Disconnected!/.test(text);\n            consoleMessages.push(text);\n          }\n        })\n        .on(\"pageerror\", (error) => {\n          pageErrors.push(error);\n        })\n        .on(\"request\", (requestObj) => {\n          if (/\\.hot-update\\.json$/.test(requestObj.url())) {\n            doneHotUpdate = true;\n          }\n        });\n\n      await page.goto(`http://localhost:${port}/${mode.query || \"\"}`, {\n        waitUntil: \"networkidle0\",\n      });\n\n      const backgroundColorBefore = await page.evaluate(() => {\n        const { body } = document;\n\n        return getComputedStyle(body)[\"background-color\"];\n      });\n\n      expect(backgroundColorBefore).toBe(\"rgb(0, 0, 255)\");\n\n      fs.writeFileSync(\n        cssFilePath,\n        \"body { background-color: rgb(255, 0, 0); }\",\n      );\n\n      let waitHot =\n        typeof testDevServerOptions.hot !== \"undefined\"\n          ? testDevServerOptions.hot\n          : true;\n      let waitLiveReload =\n        typeof testDevServerOptions.liveReload !== \"undefined\"\n          ? testDevServerOptions.liveReload\n          : true;\n\n      if (webSocketServerLaunched === false) {\n        waitHot = false;\n        waitLiveReload = false;\n      }\n\n      if (Array.isArray(webpackOptions.entry)) {\n        if (webpackOptions.entry.some((item) => item.includes(\"hot=true\"))) {\n          waitHot = true;\n        } else if (\n          webpackOptions.entry.some((item) => item.includes(\"hot=false\"))\n        ) {\n          waitHot = false;\n        }\n      }\n\n      if (Array.isArray(webpackOptions.entry)) {\n        if (\n          webpackOptions.entry.some((item) => item.includes(\"live-reload=true\"))\n        ) {\n          waitLiveReload = true;\n        } else if (\n          webpackOptions.entry.some((item) =>\n            item.includes(\"live-reload=false\"),\n          )\n        ) {\n          waitLiveReload = false;\n        }\n      }\n\n      const query = mode.query || \"\";\n\n      if (query.includes(\"webpack-dev-server-hot=false\")) {\n        waitHot = false;\n      }\n\n      if (query.includes(\"webpack-dev-server-live-reload=false\")) {\n        waitLiveReload = false;\n      }\n\n      if (waitHot) {\n        await page.waitForFunction(\n          () =>\n            getComputedStyle(document.body)[\"background-color\"] ===\n            \"rgb(255, 0, 0)\",\n        );\n\n        expect(doneHotUpdate).toBe(true);\n      } else if (waitLiveReload) {\n        await page.waitForNavigation({\n          waitUntil: \"networkidle0\",\n        });\n      } else if (webSocketServerLaunched) {\n        await new Promise((resolve) => {\n          const interval = setInterval(() => {\n            if (consoleMessages.includes(INVALID_MESSAGE)) {\n              clearInterval(interval);\n\n              resolve();\n            }\n          }, 100);\n        });\n      }\n\n      const backgroundColorAfter = await page.evaluate(() => {\n        const { body } = document;\n\n        return getComputedStyle(body)[\"background-color\"];\n      });\n\n      if (!waitHot && !waitLiveReload) {\n        expect(backgroundColorAfter).toBe(\"rgb(0, 0, 255)\");\n      } else {\n        expect(backgroundColorAfter).toBe(\"rgb(255, 0, 0)\");\n      }\n\n      expect(consoleMessages).toMatchSnapshot(\"console messages\");\n      expect(pageErrors).toMatchSnapshot(\"page errors\");\n    });\n  }\n});\n\n// the following cases check to make sure that the HMR\n// plugin is actually added\n\ndescribe(\"simple hot config HMR plugin\", () => {\n  let compiler;\n  let server;\n  let page;\n  let browser;\n  let pageErrors;\n  let consoleMessages;\n\n  beforeEach(async () => {\n    compiler = webpack(config);\n\n    ({ page, browser } = await runBrowser());\n\n    pageErrors = [];\n    consoleMessages = [];\n  });\n\n  afterEach(async () => {\n    await browser.close();\n    await server.stop();\n  });\n\n  it(\"should register the HMR plugin before compilation is complete\", async () => {\n    let pluginFound = false;\n\n    compiler.hooks.compilation.intercept({\n      register: (tapInfo) => {\n        if (tapInfo.name === \"HotModuleReplacementPlugin\") {\n          pluginFound = true;\n        }\n\n        return tapInfo;\n      },\n    });\n\n    server = new Server({ port }, compiler);\n\n    await server.start();\n\n    expect(pluginFound).toBe(true);\n\n    page\n      .on(\"console\", (message) => {\n        consoleMessages.push(message);\n      })\n      .on(\"pageerror\", (error) => {\n        pageErrors.push(error);\n      });\n\n    const response = await page.goto(`http://localhost:${port}/`, {\n      waitUntil: \"networkidle0\",\n    });\n\n    expect(response.status()).toMatchSnapshot(\"response status\");\n\n    expect(consoleMessages.map((message) => message.text())).toMatchSnapshot(\n      \"console messages\",\n    );\n\n    expect(pageErrors).toMatchSnapshot(\"page errors\");\n  });\n});\n\ndescribe(\"simple hot config HMR plugin with already added HMR plugin\", () => {\n  let compiler;\n  let server;\n  let page;\n  let browser;\n  let pageErrors;\n  let consoleMessages;\n\n  beforeEach(async () => {\n    compiler = webpack({\n      ...config,\n      plugins: [...config.plugins, new webpack.HotModuleReplacementPlugin()],\n    });\n\n    ({ page, browser } = await runBrowser());\n\n    pageErrors = [];\n    consoleMessages = [];\n  });\n\n  afterEach(async () => {\n    await browser.close();\n    await server.stop();\n  });\n\n  it(\"should register the HMR plugin before compilation is complete\", async () => {\n    let pluginFound = false;\n\n    compiler.hooks.compilation.intercept({\n      register: (tapInfo) => {\n        if (tapInfo.name === \"HotModuleReplacementPlugin\") {\n          pluginFound = true;\n        }\n\n        return tapInfo;\n      },\n    });\n\n    server = new Server({ port }, compiler);\n\n    await server.start();\n\n    expect(compiler.options.plugins).toHaveLength(2);\n    expect(pluginFound).toBe(true);\n\n    page\n      .on(\"console\", (message) => {\n        consoleMessages.push(message);\n      })\n      .on(\"pageerror\", (error) => {\n        pageErrors.push(error);\n      });\n\n    const response = await page.goto(`http://localhost:${port}/`, {\n      waitUntil: \"networkidle0\",\n    });\n\n    expect(response.status()).toMatchSnapshot(\"response status\");\n\n    expect(consoleMessages.map((message) => message.text())).toMatchSnapshot(\n      \"console messages\",\n    );\n\n    expect(pageErrors).toMatchSnapshot(\"page errors\");\n  });\n});\n\ndescribe(\"simple config with already added HMR plugin\", () => {\n  let loggerWarnSpy;\n  let getInfrastructureLoggerSpy;\n  let compiler;\n  let server;\n\n  beforeEach(() => {\n    compiler = webpack({\n      ...config,\n      devServer: { hot: false },\n      plugins: [...config.plugins, new webpack.HotModuleReplacementPlugin()],\n    });\n\n    loggerWarnSpy = jest.fn();\n\n    getInfrastructureLoggerSpy = jest\n      .spyOn(compiler, \"getInfrastructureLogger\")\n      .mockImplementation(() => ({\n        warn: loggerWarnSpy,\n        info: () => {},\n        log: () => {},\n      }));\n  });\n\n  afterEach(() => {\n    getInfrastructureLoggerSpy.mockRestore();\n    loggerWarnSpy.mockRestore();\n  });\n\n  it(\"should show warning with hot normalized as true\", async () => {\n    server = new Server({ port }, compiler);\n\n    await server.start();\n\n    expect(loggerWarnSpy).toHaveBeenCalledWith(\n      '\"hot: true\" automatically applies HMR plugin, you don\\'t have to add it manually to your webpack configuration.',\n    );\n\n    await server.stop();\n  });\n\n  it('should show warning with \"hot: true\"', async () => {\n    server = new Server({ port, hot: true }, compiler);\n\n    await server.start();\n\n    expect(loggerWarnSpy).toHaveBeenCalledWith(\n      '\"hot: true\" automatically applies HMR plugin, you don\\'t have to add it manually to your webpack configuration.',\n    );\n\n    await server.stop();\n  });\n\n  it('should not show warning with \"hot: false\"', async () => {\n    server = new Server({ port, hot: false }, compiler);\n\n    await server.start();\n\n    expect(loggerWarnSpy).not.toHaveBeenCalledWith(\n      '\"hot: true\" automatically applies HMR plugin, you don\\'t have to add it manually to your webpack configuration.',\n    );\n\n    await server.stop();\n  });\n});\n\ndescribe(\"multi compiler hot config HMR plugin\", () => {\n  let compiler;\n  let server;\n  let page;\n  let browser;\n  let pageErrors;\n  let consoleMessages;\n\n  beforeEach(async () => {\n    compiler = webpack(multiCompilerConfig);\n\n    ({ page, browser } = await runBrowser());\n\n    pageErrors = [];\n    consoleMessages = [];\n  });\n\n  afterEach(async () => {\n    await browser.close();\n    await server.stop();\n  });\n\n  it(\"should register the HMR plugin before compilation is complete\", async () => {\n    let pluginFound = false;\n\n    compiler.compilers[0].hooks.compilation.intercept({\n      register: (tapInfo) => {\n        if (tapInfo.name === \"HotModuleReplacementPlugin\") {\n          pluginFound = true;\n        }\n\n        return tapInfo;\n      },\n    });\n\n    server = new Server({ port }, compiler);\n\n    await server.start();\n\n    expect(pluginFound).toBe(true);\n\n    page\n      .on(\"console\", (message) => {\n        consoleMessages.push(message);\n      })\n      .on(\"pageerror\", (error) => {\n        pageErrors.push(error);\n      });\n\n    const response = await page.goto(`http://localhost:${port}/`, {\n      waitUntil: \"networkidle0\",\n    });\n\n    expect(response.status()).toMatchSnapshot(\"response status\");\n\n    expect(consoleMessages.map((message) => message.text())).toMatchSnapshot(\n      \"console messages\",\n    );\n\n    expect(pageErrors).toMatchSnapshot(\"page errors\");\n  });\n});\n\ndescribe(\"hot disabled HMR plugin\", () => {\n  let compiler;\n  let server;\n  let page;\n  let browser;\n  let pageErrors;\n  let consoleMessages;\n\n  beforeEach(async () => {\n    compiler = webpack(config);\n\n    ({ page, browser } = await runBrowser());\n\n    pageErrors = [];\n    consoleMessages = [];\n  });\n\n  afterEach(async () => {\n    await browser.close();\n    await server.stop();\n  });\n\n  it(\"should NOT register the HMR plugin before compilation is complete\", async () => {\n    let pluginFound = false;\n\n    compiler.hooks.compilation.intercept({\n      register: (tapInfo) => {\n        if (tapInfo.name === \"HotModuleReplacementPlugin\") {\n          pluginFound = true;\n        }\n\n        return tapInfo;\n      },\n    });\n\n    server = new Server({ port, hot: false }, compiler);\n\n    await server.start();\n\n    expect(pluginFound).toBe(false);\n\n    page\n      .on(\"console\", (message) => {\n        consoleMessages.push(message);\n      })\n      .on(\"pageerror\", (error) => {\n        pageErrors.push(error);\n      });\n\n    const response = await page.goto(`http://localhost:${port}/`, {\n      waitUntil: \"networkidle0\",\n    });\n\n    expect(response.status()).toMatchSnapshot(\"response status\");\n\n    expect(consoleMessages.map((message) => message.text())).toMatchSnapshot(\n      \"console messages\",\n    );\n\n    expect(pageErrors).toMatchSnapshot(\"page errors\");\n  });\n});\n"
  },
  {
    "path": "test/e2e/ipc.test.js",
    "content": "\"use strict\";\n\nconst http = require(\"node:http\");\nconst net = require(\"node:net\");\nconst os = require(\"node:os\");\nconst path = require(\"node:path\");\nconst httpProxy = require(\"http-proxy\");\nconst webpack = require(\"webpack\");\nconst Server = require(\"../../lib/Server\");\nconst config = require(\"../fixtures/client-config/webpack.config\");\nconst runBrowser = require(\"../helpers/run-browser\");\nconst sessionSubscribe = require(\"../helpers/session-subscribe\");\nconst port1 = require(\"../ports-map\").ipc;\n\nconst webSocketServers = [\"ws\", \"sockjs\"];\n\ndescribe(\"web socket server URL\", () => {\n  for (const webSocketServer of webSocketServers) {\n    const websocketURLProtocol = webSocketServer === \"ws\" ? \"ws\" : \"http\";\n\n    it(`should work with the \"ipc\" option using \"true\" value (\"${webSocketServer}\")`, async () => {\n      const devServerHost = \"localhost\";\n      const proxyHost = devServerHost;\n      const proxyPort = port1;\n\n      const compiler = webpack(config);\n      const devServerOptions = {\n        webSocketServer,\n        ipc: true,\n      };\n      const server = new Server(devServerOptions, compiler);\n\n      await server.start();\n\n      function startProxy(callback) {\n        const proxy = httpProxy.createProxyServer({\n          target: { socketPath: server.options.ipc },\n        });\n\n        const proxyServer = http.createServer((request, response) => {\n          // You can define here your custom logic to handle the request\n          // and then proxy the request.\n          proxy.web(request, response);\n        });\n\n        proxyServer.on(\"upgrade\", (request, socket, head) => {\n          proxy.ws(request, socket, head);\n        });\n\n        return proxyServer.listen(proxyPort, proxyHost, callback);\n      }\n\n      const proxy = await new Promise((resolve) => {\n        const proxyCreated = startProxy(() => {\n          resolve(proxyCreated);\n        });\n      });\n\n      const { page, browser } = await runBrowser();\n\n      try {\n        const pageErrors = [];\n        const consoleMessages = [];\n\n        page\n          .on(\"console\", (message) => {\n            consoleMessages.push(message);\n          })\n          .on(\"pageerror\", (error) => {\n            pageErrors.push(error);\n          });\n\n        const webSocketRequests = [];\n\n        if (webSocketServer === \"ws\") {\n          const session = await page.target().createCDPSession();\n\n          session.on(\"Network.webSocketCreated\", (test) => {\n            webSocketRequests.push(test);\n          });\n\n          await session.send(\"Target.setAutoAttach\", {\n            autoAttach: true,\n            flatten: true,\n            waitForDebuggerOnStart: true,\n          });\n\n          sessionSubscribe(session);\n        } else {\n          page.on(\"request\", (request) => {\n            if (/\\/ws\\//.test(request.url())) {\n              webSocketRequests.push({ url: request.url() });\n            }\n          });\n        }\n\n        await page.goto(`http://${proxyHost}:${proxyPort}/`, {\n          waitUntil: \"networkidle0\",\n        });\n\n        const [webSocketRequest] = webSocketRequests;\n\n        expect(webSocketRequest.url).toContain(\n          `${websocketURLProtocol}://${devServerHost}:${proxyPort}/ws`,\n        );\n        expect(\n          consoleMessages.map((message) => message.text()),\n        ).toMatchSnapshot(\"console messages\");\n        expect(pageErrors).toMatchSnapshot(\"page errors\");\n      } finally {\n        proxy.close();\n\n        await browser.close();\n        await server.stop();\n      }\n    });\n\n    it(`should work with the \"ipc\" option using \"string\" value (\"${webSocketServer}\")`, async () => {\n      const isWindows = process.platform === \"win32\";\n      const pipePrefix = isWindows ? \"\\\\\\\\.\\\\pipe\\\\\" : os.tmpdir();\n      const pipeName = `webpack-dev-server.${process.pid}-1.sock`;\n      const ipc = path.join(pipePrefix, pipeName);\n\n      const devServerHost = \"localhost\";\n      const proxyHost = devServerHost;\n      const proxyPort = port1;\n\n      const compiler = webpack(config);\n      const devServerOptions = {\n        webSocketServer,\n        ipc,\n      };\n      const server = new Server(devServerOptions, compiler);\n\n      await server.start();\n\n      function startProxy(callback) {\n        const proxy = httpProxy.createProxyServer({\n          target: { socketPath: ipc },\n        });\n\n        const proxyServer = http.createServer((request, response) => {\n          // You can define here your custom logic to handle the request\n          // and then proxy the request.\n          proxy.web(request, response);\n        });\n\n        proxyServer.on(\"upgrade\", (request, socket, head) => {\n          proxy.ws(request, socket, head);\n        });\n\n        return proxyServer.listen(proxyPort, proxyHost, callback);\n      }\n\n      const proxy = await new Promise((resolve) => {\n        const proxyCreated = startProxy(() => {\n          resolve(proxyCreated);\n        });\n      });\n\n      const { page, browser } = await runBrowser();\n\n      try {\n        const pageErrors = [];\n        const consoleMessages = [];\n\n        page\n          .on(\"console\", (message) => {\n            consoleMessages.push(message);\n          })\n          .on(\"pageerror\", (error) => {\n            pageErrors.push(error);\n          });\n\n        const webSocketRequests = [];\n\n        if (webSocketServer === \"ws\") {\n          const session = await page.target().createCDPSession();\n\n          session.on(\"Network.webSocketCreated\", (test) => {\n            webSocketRequests.push(test);\n          });\n\n          await session.send(\"Target.setAutoAttach\", {\n            autoAttach: true,\n            flatten: true,\n            waitForDebuggerOnStart: true,\n          });\n\n          sessionSubscribe(session);\n        } else {\n          page.on(\"request\", (request) => {\n            if (/\\/ws\\//.test(request.url())) {\n              webSocketRequests.push({ url: request.url() });\n            }\n          });\n        }\n\n        await page.goto(`http://${proxyHost}:${proxyPort}/`, {\n          waitUntil: \"networkidle0\",\n        });\n\n        const [webSocketRequest] = webSocketRequests;\n\n        expect(webSocketRequest.url).toContain(\n          `${websocketURLProtocol}://${devServerHost}:${proxyPort}/ws`,\n        );\n        expect(\n          consoleMessages.map((message) => message.text()),\n        ).toMatchSnapshot(\"console messages\");\n        expect(pageErrors).toMatchSnapshot(\"page errors\");\n      } finally {\n        proxy.close();\n\n        await browser.close();\n        await server.stop();\n      }\n    });\n\n    // TODO un skip after implement new API\n    // eslint-disable-next-line jest/no-disabled-tests\n    it.skip(`should work with the \"ipc\" option using \"string\" value and remove old (\"${webSocketServer}\")`, async () => {\n      const isWindows = process.platform === \"win32\";\n      const localRelative = path.relative(process.cwd(), `${os.tmpdir()}/`);\n      const pipePrefix = isWindows ? \"\\\\\\\\.\\\\pipe\\\\\" : localRelative;\n      const pipeName = `webpack-dev-server.${process.pid}-2.sock`;\n      const ipc = path.join(pipePrefix, pipeName);\n\n      const ipcServer = await new Promise((resolve, reject) => {\n        // eslint-disable-next-line new-cap\n        const server = net.Server();\n\n        server.on(\"error\", (error) => {\n          reject(error);\n        });\n\n        // eslint-disable-next-line no-promise-executor-return\n        return server.listen(ipc, () => {\n          resolve();\n        });\n      });\n\n      const devServerHost = \"localhost\";\n      const proxyHost = devServerHost;\n      const proxyPort = port1;\n\n      const compiler = webpack(config);\n      const devServerOptions = {\n        webSocketServer,\n        host: devServerHost,\n        ipc,\n      };\n      const server = new Server(devServerOptions, compiler);\n\n      await server.start();\n\n      function startProxy(callback) {\n        const proxy = httpProxy.createProxyServer({\n          target: { socketPath: ipc },\n        });\n\n        const proxyServer = http.createServer((request, response) => {\n          // You can define here your custom logic to handle the request\n          // and then proxy the request.\n          proxy.web(request, response);\n        });\n\n        proxyServer.on(\"upgrade\", (request, socket, head) => {\n          proxy.ws(request, socket, head);\n        });\n\n        return proxyServer.listen(proxyPort, proxyHost, callback);\n      }\n\n      const proxy = await new Promise((resolve) => {\n        const proxyCreated = startProxy(() => {\n          resolve(proxyCreated);\n        });\n      });\n\n      const { page, browser } = await runBrowser();\n\n      try {\n        const pageErrors = [];\n        const consoleMessages = [];\n\n        page\n          .on(\"console\", (message) => {\n            consoleMessages.push(message);\n          })\n          .on(\"pageerror\", (error) => {\n            pageErrors.push(error);\n          });\n\n        const webSocketRequests = [];\n\n        if (webSocketServer === \"ws\") {\n          const session = await page.target().createCDPSession();\n\n          session.on(\"Network.webSocketCreated\", (test) => {\n            webSocketRequests.push(test);\n          });\n\n          await session.send(\"Target.setAutoAttach\", {\n            autoAttach: true,\n            flatten: true,\n            waitForDebuggerOnStart: true,\n          });\n\n          sessionSubscribe(session);\n        } else {\n          page.on(\"request\", (request) => {\n            if (/\\/ws\\//.test(request.url())) {\n              webSocketRequests.push({ url: request.url() });\n            }\n          });\n        }\n\n        await page.goto(`http://${proxyHost}:${proxyPort}/`, {\n          waitUntil: \"networkidle0\",\n        });\n\n        const [webSocketRequest] = webSocketRequests;\n\n        expect(webSocketRequest.url).toContain(\n          `${websocketURLProtocol}://${devServerHost}:${proxyPort}/ws`,\n        );\n        expect(\n          consoleMessages.map((message) => message.text()),\n        ).toMatchSnapshot(\"console messages\");\n        expect(pageErrors).toMatchSnapshot(\"page errors\");\n      } finally {\n        proxy.close();\n\n        await new Promise((resolve, reject) => {\n          ipcServer.close((error) => {\n            if (error) {\n              reject(error);\n\n              return;\n            }\n\n            resolve();\n          });\n        });\n        await browser.close();\n        await server.stop();\n      }\n    });\n  }\n});\n"
  },
  {
    "path": "test/e2e/lazy-compilation.test.js",
    "content": "\"use strict\";\n\nconst webpack = require(\"webpack\");\nconst Server = require(\"../../lib/Server\");\nconst lazyCompilationMultipleEntriesConfig = require(\"../fixtures/lazy-compilation-multiple-entries/webpack.config\");\nconst lazyCompilationSingleEntryConfig = require(\"../fixtures/lazy-compilation-single-entry/webpack.config\");\nconst runBrowser = require(\"../helpers/run-browser\");\nconst port = require(\"../ports-map\")[\"lazy-compilation\"];\n\n/* eslint-disable jest/no-disabled-tests */\ndescribe(\"lazy compilation\", () => {\n  // TODO jest freeze due webpack do not close `eventsource`, we should uncomment this after fix it on webpack side\n  it.skip(\"should work with single entry\", async () => {\n    const compiler = webpack(lazyCompilationSingleEntryConfig);\n    const server = new Server({ port }, compiler);\n\n    await server.start();\n\n    const { page, browser } = await runBrowser();\n\n    try {\n      const pageErrors = [];\n      const consoleMessages = [];\n\n      page\n        .on(\"console\", (message) => {\n          consoleMessages.push(message.text());\n        })\n        .on(\"pageerror\", (error) => {\n          pageErrors.push(error);\n        });\n\n      await page.goto(`http://localhost:${port}/test.html`, {\n        waitUntil: \"domcontentloaded\",\n      });\n      await new Promise((resolve) => {\n        const interval = setInterval(() => {\n          if (consoleMessages.includes(\"Hey.\")) {\n            clearInterval(interval);\n\n            resolve();\n          }\n        }, 100);\n      });\n\n      expect(consoleMessages).toMatchSnapshot(\"console messages\");\n      expect(pageErrors).toMatchSnapshot(\"page errors\");\n    } finally {\n      await browser.close();\n      await server.stop();\n    }\n  });\n\n  it.skip(\"should work with multiple entries\", async () => {\n    const compiler = webpack(lazyCompilationMultipleEntriesConfig);\n    const server = new Server({ port }, compiler);\n\n    await server.start();\n\n    const { page, browser } = await runBrowser();\n\n    try {\n      const pageErrors = [];\n      const consoleMessages = [];\n\n      page\n        .on(\"console\", (message) => {\n          consoleMessages.push(message.text());\n        })\n        .on(\"pageerror\", (error) => {\n          pageErrors.push(error);\n        });\n\n      await page.goto(`http://localhost:${port}/test-one.html`, {\n        waitUntil: \"domcontentloaded\",\n      });\n      await new Promise((resolve) => {\n        const interval = setInterval(() => {\n          console.log(consoleMessages);\n          if (consoleMessages.includes(\"One.\")) {\n            clearInterval(interval);\n\n            resolve();\n          }\n        }, 100);\n      });\n\n      await page.goto(`http://localhost:${port}/test-two.html`, {\n        waitUntil: \"domcontentloaded\",\n      });\n      await new Promise((resolve) => {\n        const interval = setInterval(() => {\n          console.log(consoleMessages);\n          if (consoleMessages.includes(\"Two.\")) {\n            clearInterval(interval);\n\n            resolve();\n          }\n        }, 100);\n      });\n\n      expect(consoleMessages).toMatchSnapshot(\"console messages\");\n      expect(pageErrors).toMatchSnapshot(\"page errors\");\n    } finally {\n      await browser.close();\n      await server.stop();\n    }\n  });\n});\n"
  },
  {
    "path": "test/e2e/logging.test.js",
    "content": "\"use strict\";\n\nconst path = require(\"node:path\");\nconst fs = require(\"graceful-fs\");\nconst webpack = require(\"webpack\");\nconst Server = require(\"../../lib/Server\");\nconst config = require(\"../fixtures/client-config/webpack.config\");\nconst HTMLGeneratorPlugin = require(\"../helpers/html-generator-plugin\");\nconst runBrowser = require(\"../helpers/run-browser\");\nconst port = require(\"../ports-map\").logging;\n\ndescribe(\"logging\", () => {\n  const webSocketServers = [\n    { webSocketServer: \"ws\" },\n    { webSocketServer: \"sockjs\" },\n  ];\n\n  const cases = [\n    {\n      title: \"should work and log message about live reloading is enabled\",\n      devServerOptions: {\n        hot: false,\n      },\n    },\n    {\n      title:\n        \"should work and log messages about hot and live reloading is enabled\",\n      devServerOptions: {\n        hot: true,\n      },\n    },\n    {\n      title: \"should work and log messages about hot is enabled\",\n      devServerOptions: {\n        liveReload: false,\n      },\n    },\n    {\n      title:\n        \"should work and log messages about hot and live reloading is enabled\",\n      devServerOptions: {\n        liveReload: true,\n      },\n    },\n    {\n      title:\n        \"should work and do not log messages about hot and live reloading is enabled\",\n      devServerOptions: {\n        liveReload: false,\n        hot: false,\n      },\n    },\n    {\n      title:\n        \"should work and log messages about hot and live reloading is enabled\",\n      devServerOptions: {\n        liveReload: true,\n        hot: true,\n      },\n    },\n    {\n      title: \"should work and log warnings by default\",\n      webpackOptions: {\n        plugins: [\n          {\n            apply(compiler) {\n              compiler.hooks.thisCompilation.tap(\n                \"warnings-webpack-plugin\",\n                (compilation) => {\n                  compilation.warnings.push(\n                    new Error(\"Warning from compilation\"),\n                  );\n                },\n              );\n            },\n          },\n          new HTMLGeneratorPlugin(),\n        ],\n      },\n    },\n    {\n      title: \"should work and log errors by default\",\n      webpackOptions: {\n        plugins: [\n          {\n            apply(compiler) {\n              compiler.hooks.thisCompilation.tap(\n                \"warnings-webpack-plugin\",\n                (compilation) => {\n                  compilation.errors.push(new Error(\"Error from compilation\"));\n                },\n              );\n            },\n          },\n          new HTMLGeneratorPlugin(),\n        ],\n      },\n    },\n    {\n      title: 'should work when the \"client.logging\" is \"info\"',\n      devServerOptions: {\n        client: {\n          logging: \"info\",\n        },\n      },\n    },\n    {\n      title: 'should work when the \"client.logging\" is \"log\"',\n      devServerOptions: {\n        client: {\n          logging: \"log\",\n        },\n      },\n    },\n    {\n      title: 'should work when the \"client.logging\" is \"verbose\"',\n      devServerOptions: {\n        client: {\n          logging: \"verbose\",\n        },\n      },\n    },\n    {\n      title: 'should work when the \"client.logging\" is \"none\"',\n      devServerOptions: {\n        client: {\n          logging: \"none\",\n        },\n      },\n    },\n    {\n      title: \"should work and log only error\",\n      webpackOptions: {\n        plugins: [\n          {\n            apply(compiler) {\n              compiler.hooks.thisCompilation.tap(\n                \"warnings-webpack-plugin\",\n                (compilation) => {\n                  compilation.warnings.push(\n                    new Error(\"Warning from compilation\"),\n                  );\n                  compilation.errors.push(new Error(\"Error from compilation\"));\n                },\n              );\n            },\n          },\n          new HTMLGeneratorPlugin(),\n        ],\n      },\n      devServerOptions: {\n        client: {\n          logging: \"error\",\n        },\n      },\n    },\n    {\n      title: \"should work and log warning and errors\",\n      webpackOptions: {\n        plugins: [\n          {\n            apply(compiler) {\n              compiler.hooks.thisCompilation.tap(\n                \"warnings-webpack-plugin\",\n                (compilation) => {\n                  compilation.warnings.push(\n                    new Error(\"Warning from compilation\"),\n                  );\n                  compilation.errors.push(new Error(\"Error from compilation\"));\n                },\n              );\n            },\n          },\n          new HTMLGeneratorPlugin(),\n        ],\n      },\n      devServerOptions: {\n        client: {\n          logging: \"warn\",\n        },\n      },\n    },\n    {\n      title: \"should work and log static changes\",\n      devServerOptions: {\n        static: path.resolve(__dirname, \"../fixtures/client-config/static\"),\n      },\n    },\n  ];\n\n  for (const webSocketServer of webSocketServers) {\n    for (const testCase of cases) {\n      it(`${testCase.title} (${\n        webSocketServer.webSocketServer || \"default\"\n      })`, async () => {\n        const compiler = webpack({ ...config, ...testCase.webpackOptions });\n        const devServerOptions = {\n          port,\n          ...testCase.devServerOptions,\n        };\n        const server = new Server(devServerOptions, compiler);\n\n        await server.start();\n\n        const { page, browser } = await runBrowser();\n\n        try {\n          const consoleMessages = [];\n\n          page.on(\"console\", (message) => {\n            consoleMessages.push(message);\n          });\n\n          await page.goto(`http://localhost:${port}/`, {\n            waitUntil: \"networkidle0\",\n          });\n\n          if (testCase.devServerOptions && testCase.devServerOptions.static) {\n            fs.writeFileSync(\n              path.join(testCase.devServerOptions.static, \"./foo.txt\"),\n              \"Text\",\n            );\n\n            await page.waitForNavigation({\n              waitUntil: \"networkidle0\",\n            });\n          }\n\n          expect(\n            consoleMessages.map((message) =>\n              message\n                .text()\n                .replaceAll(\"\\\\\", \"/\")\n                .replaceAll(\n                  new RegExp(process.cwd().replaceAll(\"\\\\\", \"/\"), \"g\"),\n                  \"<cwd>\",\n                ),\n            ),\n          ).toMatchSnapshot();\n        } finally {\n          await browser.close();\n          await server.stop();\n        }\n      });\n    }\n  }\n});\n"
  },
  {
    "path": "test/e2e/mime-types.test.js",
    "content": "\"use strict\";\n\nconst webpack = require(\"webpack\");\nconst Server = require(\"../../lib/Server\");\nconst config = require(\"../fixtures/mime-types-config/webpack.config\");\nconst runBrowser = require(\"../helpers/run-browser\");\nconst port = require(\"../ports-map\")[\"mime-types-option\"];\n\ndescribe(\"mimeTypes option\", () => {\n  describe(\"as an object with a remapped type\", () => {\n    let compiler;\n    let server;\n    let page;\n    let browser;\n    let pageErrors;\n    let consoleMessages;\n\n    beforeEach(async () => {\n      compiler = webpack(config);\n\n      server = new Server(\n        {\n          devMiddleware: {\n            mimeTypes: {\n              js: \"text/plain\",\n            },\n          },\n          port,\n        },\n        compiler,\n      );\n\n      await server.start();\n\n      ({ page, browser } = await runBrowser());\n\n      pageErrors = [];\n      consoleMessages = [];\n    });\n\n    afterEach(async () => {\n      await browser.close();\n      await server.stop();\n    });\n\n    it(\"should request file with different js mime type\", async () => {\n      page\n        .on(\"console\", (message) => {\n          consoleMessages.push(message);\n        })\n        .on(\"pageerror\", (error) => {\n          pageErrors.push(error);\n        });\n\n      const response = await page.goto(`http://localhost:${port}/main.js`, {\n        waitUntil: \"networkidle0\",\n      });\n\n      expect(response.status()).toMatchSnapshot(\"response status\");\n\n      expect(response.headers()[\"content-type\"]).toMatchSnapshot(\n        \"response headers content-type\",\n      );\n\n      expect(consoleMessages.map((message) => message.text())).toMatchSnapshot(\n        \"console messages\",\n      );\n\n      expect(pageErrors).toMatchSnapshot(\"page errors\");\n    });\n  });\n\n  describe(\"as an object with a custom type\", () => {\n    let compiler;\n    let server;\n    let page;\n    let browser;\n    let pageErrors;\n    let consoleMessages;\n\n    beforeEach(async () => {\n      compiler = webpack(config);\n\n      server = new Server(\n        {\n          devMiddleware: {\n            mimeTypes: {\n              custom: \"text/html\",\n            },\n          },\n          port,\n        },\n        compiler,\n      );\n\n      await server.start();\n\n      ({ page, browser } = await runBrowser());\n\n      pageErrors = [];\n      consoleMessages = [];\n    });\n\n    afterEach(async () => {\n      await browser.close();\n      await server.stop();\n    });\n\n    it(\"should request file with different js mime type\", async () => {\n      page\n        .on(\"console\", (message) => {\n          consoleMessages.push(message);\n        })\n        .on(\"pageerror\", (error) => {\n          pageErrors.push(error);\n        });\n\n      const response = await page.goto(`http://localhost:${port}/file.custom`, {\n        waitUntil: \"networkidle0\",\n      });\n\n      expect(response.status()).toMatchSnapshot(\"response status\");\n\n      expect(response.headers()[\"content-type\"]).toMatchSnapshot(\n        \"response headers content-type\",\n      );\n\n      expect(consoleMessages.map((message) => message.text())).toMatchSnapshot(\n        \"console messages\",\n      );\n\n      expect(pageErrors).toMatchSnapshot(\"page errors\");\n    });\n  });\n});\n"
  },
  {
    "path": "test/e2e/module-federation.test.js",
    "content": "\"use strict\";\n\nconst requireFromString = require(\"require-from-string\");\nconst webpack = require(\"webpack\");\nconst Server = require(\"../../lib/Server\");\nconst simpleConfig = require(\"../fixtures/module-federation-config/webpack.config\");\nconst multiConfig = require(\"../fixtures/module-federation-config/webpack.multi.config\");\nconst objectEntryConfig = require(\"../fixtures/module-federation-config/webpack.object-entry.config\");\nconst pluginConfig = require(\"../fixtures/module-federation-config/webpack.plugin\");\nconst runBrowser = require(\"../helpers/run-browser\");\nconst port = require(\"../ports-map\")[\"module-federation\"];\n\ndescribe(\"Module federation\", () => {\n  describe(\"should work with simple multi-entry config\", () => {\n    let compiler;\n    let server;\n    let page;\n    let browser;\n    let pageErrors;\n    let consoleMessages;\n\n    beforeEach(async () => {\n      compiler = webpack(simpleConfig);\n      server = new Server({ port }, compiler);\n\n      await server.start();\n\n      ({ page, browser } = await runBrowser());\n\n      pageErrors = [];\n      consoleMessages = [];\n    });\n\n    afterEach(async () => {\n      await browser.close();\n      await server.stop();\n    });\n\n    it(\"should use the last entry export\", async () => {\n      page\n        .on(\"console\", (message) => {\n          consoleMessages.push(message);\n        })\n        .on(\"pageerror\", (error) => {\n          pageErrors.push(error);\n        });\n\n      const response = await page.goto(`http://localhost:${port}/main.js`, {\n        waitUntil: \"networkidle0\",\n      });\n\n      const textContent = await response.text();\n\n      expect(textContent).toContain(\"entry1\");\n\n      let exports;\n\n      expect(() => {\n        exports = requireFromString(textContent);\n      }).not.toThrow();\n\n      expect(exports).toBe(\"entry2\");\n\n      expect(consoleMessages.map((message) => message.text())).toMatchSnapshot(\n        \"console messages\",\n      );\n\n      expect(pageErrors).toMatchSnapshot(\"page errors\");\n    });\n  });\n\n  describe(\"should work with object multi-entry config\", () => {\n    let compiler;\n    let server;\n    let page;\n    let browser;\n    let pageErrors;\n    let consoleMessages;\n\n    beforeEach(async () => {\n      compiler = webpack(objectEntryConfig);\n      server = new Server({ port }, compiler);\n\n      await server.start();\n\n      ({ page, browser } = await runBrowser());\n\n      pageErrors = [];\n      consoleMessages = [];\n    });\n\n    afterEach(async () => {\n      await browser.close();\n      await server.stop();\n    });\n\n    it(\"should use the last entry export\", async () => {\n      page\n        .on(\"console\", (message) => {\n          consoleMessages.push(message);\n        })\n        .on(\"pageerror\", (error) => {\n          pageErrors.push(error);\n        });\n\n      const response = await page.goto(`http://localhost:${port}/main.js`, {\n        waitUntil: \"networkidle0\",\n      });\n\n      const textContent = await response.text();\n\n      expect(textContent).toContain(\"entry1\");\n\n      let exports;\n\n      expect(() => {\n        exports = requireFromString(textContent);\n      }).not.toThrow();\n\n      expect(exports).toBe(\"entry2\");\n\n      expect(consoleMessages.map((message) => message.text())).toMatchSnapshot(\n        \"console messages\",\n      );\n\n      expect(pageErrors).toMatchSnapshot(\"page errors\");\n    });\n\n    it(\"should support the named entry export\", async () => {\n      page\n        .on(\"console\", (message) => {\n          consoleMessages.push(message);\n        })\n        .on(\"pageerror\", (error) => {\n          pageErrors.push(error);\n        });\n\n      const response = await page.goto(`http://localhost:${port}/foo.js`, {\n        waitUntil: \"networkidle0\",\n      });\n\n      const textContent = await response.text();\n\n      expect(textContent).not.toContain(\"entry2\");\n\n      let exports;\n\n      expect(() => {\n        exports = requireFromString(textContent);\n      }).not.toThrow();\n\n      expect(exports).toBe(\"entry1\");\n\n      expect(consoleMessages.map((message) => message.text())).toMatchSnapshot(\n        \"console messages\",\n      );\n\n      expect(pageErrors).toMatchSnapshot(\"page errors\");\n    });\n  });\n\n  describe(\"should work with multi compiler config\", () => {\n    let compiler;\n    let server;\n    let page;\n    let browser;\n    let pageErrors;\n    let consoleMessages;\n\n    beforeEach(async () => {\n      compiler = webpack(multiConfig);\n      server = new Server({ port }, compiler);\n\n      await server.start();\n\n      ({ page, browser } = await runBrowser());\n\n      pageErrors = [];\n      consoleMessages = [];\n    });\n\n    afterEach(async () => {\n      await browser.close();\n      await server.stop();\n    });\n\n    it(\"should use the last entry export\", async () => {\n      page\n        .on(\"console\", (message) => {\n          consoleMessages.push(message);\n        })\n        .on(\"pageerror\", (error) => {\n          pageErrors.push(error);\n        });\n\n      const response = await page.goto(`http://localhost:${port}/main.js`, {\n        waitUntil: \"networkidle0\",\n      });\n\n      const textContent = await response.text();\n\n      expect(textContent).toContain(\"entry1\");\n\n      let exports;\n\n      expect(() => {\n        exports = requireFromString(textContent);\n      }).not.toThrow();\n\n      expect(exports).toBe(\"entry2\");\n\n      expect(consoleMessages.map((message) => message.text())).toMatchSnapshot(\n        \"console messages\",\n      );\n\n      expect(pageErrors).toMatchSnapshot(\"page errors\");\n    });\n  });\n\n  describe(\"should use plugin\", () => {\n    let compiler;\n    let server;\n    let page;\n    let browser;\n    let pageErrors;\n    let consoleMessages;\n\n    beforeEach(async () => {\n      compiler = webpack(pluginConfig);\n      server = new Server({ port }, compiler);\n\n      await server.start();\n\n      ({ page, browser } = await runBrowser());\n\n      pageErrors = [];\n      consoleMessages = [];\n    });\n\n    afterEach(async () => {\n      await browser.close();\n      await server.stop();\n    });\n\n    it(\"should contain hot script in remoteEntry.js\", async () => {\n      page\n        .on(\"console\", (message) => {\n          consoleMessages.push(message);\n        })\n        .on(\"pageerror\", (error) => {\n          pageErrors.push(error);\n        });\n\n      const response = await page.goto(\n        `http://localhost:${port}/remoteEntry.js`,\n        {\n          waitUntil: \"networkidle0\",\n        },\n      );\n\n      const remoteEntryTextContent = await response.text();\n\n      expect(remoteEntryTextContent).toMatch(/webpack\\/hot\\/dev-server\\.js/);\n\n      expect(consoleMessages.map((message) => message.text())).toMatchSnapshot(\n        \"console messages\",\n      );\n\n      expect(pageErrors).toMatchSnapshot(\"page errors\");\n    });\n\n    it(\"should contain hot script in main.js\", async () => {\n      page\n        .on(\"console\", (message) => {\n          consoleMessages.push(message);\n        })\n        .on(\"pageerror\", (error) => {\n          pageErrors.push(error);\n        });\n\n      const response = await page.goto(`http://localhost:${port}/main.js`, {\n        waitUntil: \"networkidle0\",\n      });\n\n      const mainEntryTextContent = await response.text();\n\n      expect(mainEntryTextContent).toMatch(/webpack\\/hot\\/dev-server\\.js/);\n\n      expect(consoleMessages.map((message) => message.text())).toMatchSnapshot(\n        \"console messages\",\n      );\n\n      expect(pageErrors).toMatchSnapshot(\"page errors\");\n    });\n  });\n});\n"
  },
  {
    "path": "test/e2e/multi-compiler.test.js",
    "content": "\"use strict\";\n\nconst path = require(\"node:path\");\nconst fs = require(\"graceful-fs\");\nconst webpack = require(\"webpack\");\nconst Server = require(\"../../lib/Server\");\nconst oneWebTargetConfiguration = require(\"../fixtures/multi-compiler-one-configuration/webpack.config\");\nconst twoWebTargetConfiguration = require(\"../fixtures/multi-compiler-two-configurations/webpack.config\");\nconst universalConfiguration = require(\"../fixtures/universal-compiler-config/webpack.config\");\nconst runBrowser = require(\"../helpers/run-browser\");\nconst port = require(\"../ports-map\")[\"multi-compiler\"];\n\ndescribe(\"multi compiler\", () => {\n  it(\"should work with one web target configuration and do nothing\", async () => {\n    const compiler = webpack(oneWebTargetConfiguration);\n    const devServerOptions = {\n      port,\n    };\n    const server = new Server(devServerOptions, compiler);\n\n    await server.start();\n\n    const { page, browser } = await runBrowser();\n\n    try {\n      const pageErrors = [];\n      const consoleMessages = [];\n\n      page\n        .on(\"console\", (message) => {\n          consoleMessages.push(message.text());\n        })\n        .on(\"pageerror\", (error) => {\n          pageErrors.push(error);\n        });\n\n      await page.goto(`http://localhost:${port}/`, {\n        waitUntil: \"networkidle0\",\n      });\n\n      expect(consoleMessages).toMatchSnapshot(\"console messages\");\n      expect(pageErrors).toMatchSnapshot(\"page errors\");\n    } finally {\n      await browser.close();\n      await server.stop();\n    }\n  });\n\n  it(\"should work with web target configurations and do nothing\", async () => {\n    const compiler = webpack(twoWebTargetConfiguration);\n    const devServerOptions = {\n      port,\n    };\n\n    const server = new Server(devServerOptions, compiler);\n\n    await server.start();\n\n    const { page, browser } = await runBrowser();\n\n    try {\n      let pageErrors = [];\n      let consoleMessages = [];\n\n      page\n        .on(\"console\", (message) => {\n          consoleMessages.push(message.text());\n        })\n        .on(\"pageerror\", (error) => {\n          pageErrors.push(error);\n        });\n\n      await page.goto(`http://localhost:${port}/one-main.html`, {\n        waitUntil: \"networkidle0\",\n      });\n\n      expect(consoleMessages).toMatchSnapshot(\"console messages\");\n      expect(pageErrors).toMatchSnapshot(\"page errors\");\n\n      pageErrors = [];\n      consoleMessages = [];\n\n      await page.goto(`http://localhost:${port}/two-main.html`, {\n        waitUntil: \"networkidle0\",\n      });\n\n      expect(consoleMessages).toMatchSnapshot(\"console messages\");\n      expect(pageErrors).toMatchSnapshot(\"page errors\");\n    } finally {\n      await browser.close();\n      await server.stop();\n    }\n  });\n\n  it(\"should work with web target configurations when hot and live reloads are enabled, and do hot reload by default when changing own entries\", async () => {\n    const compiler = webpack(twoWebTargetConfiguration);\n    const devServerOptions = {\n      port,\n      hot: true,\n      liveReload: true,\n    };\n    const pathToOneEntry = path.resolve(\n      __dirname,\n      \"../fixtures/multi-compiler-two-configurations/one.js\",\n    );\n    const originalOneEntryContent = fs.readFileSync(pathToOneEntry);\n    const pathToTwoEntry = path.resolve(\n      __dirname,\n      \"../fixtures/multi-compiler-two-configurations/two.js\",\n    );\n    const originalTwoEntryContent = fs.readFileSync(pathToTwoEntry);\n\n    const server = new Server(devServerOptions, compiler);\n\n    await server.start();\n\n    const { page, browser } = await runBrowser();\n\n    try {\n      let pageErrors = [];\n      let consoleMessages = [];\n\n      page\n        .on(\"console\", (message) => {\n          let text = message.text();\n\n          if (/Error: Aborted because/.test(text)) {\n            const splittedText = text.split(\"\\n\");\n\n            text = `${splittedText[0]}\\n${splittedText[1]}\\n    <stack>`;\n          }\n\n          consoleMessages.push(text);\n        })\n        .on(\"pageerror\", (error) => {\n          pageErrors.push(error);\n        });\n\n      await page.goto(`http://localhost:${port}/one-main.html`, {\n        waitUntil: \"networkidle0\",\n      });\n\n      fs.writeFileSync(pathToOneEntry, `${originalOneEntryContent}// comment`);\n\n      await page.waitForNavigation({ waitUntil: \"networkidle0\" });\n\n      expect(consoleMessages).toMatchSnapshot(\"console messages\");\n      expect(pageErrors).toMatchSnapshot(\"page errors\");\n\n      pageErrors = [];\n      consoleMessages = [];\n\n      await page.goto(`http://localhost:${port}/two-main.html`, {\n        waitUntil: \"networkidle0\",\n      });\n\n      fs.writeFileSync(pathToTwoEntry, `${originalTwoEntryContent}// comment`);\n\n      await page.waitForNavigation({ waitUntil: \"networkidle0\" });\n\n      expect(consoleMessages).toMatchSnapshot(\"console messages\");\n      expect(pageErrors).toMatchSnapshot(\"page errors\");\n    } finally {\n      await browser.close();\n      await server.stop();\n\n      fs.writeFileSync(pathToOneEntry, originalOneEntryContent);\n      fs.writeFileSync(pathToTwoEntry, originalTwoEntryContent);\n    }\n  });\n\n  it(\"should work with web target configurations when only hot reload is enabled, and do hot reload when changing own entries\", async () => {\n    const compiler = webpack(twoWebTargetConfiguration);\n    const devServerOptions = {\n      port,\n      hot: true,\n      liveReload: false,\n    };\n    const pathToOneEntry = path.resolve(\n      __dirname,\n      \"../fixtures/multi-compiler-two-configurations/one.js\",\n    );\n    const originalOneEntryContent = fs.readFileSync(pathToOneEntry);\n    const pathToTwoEntry = path.resolve(\n      __dirname,\n      \"../fixtures/multi-compiler-two-configurations/two.js\",\n    );\n    const originalTwoEntryContent = fs.readFileSync(pathToTwoEntry);\n\n    const server = new Server(devServerOptions, compiler);\n\n    await server.start();\n\n    const { page, browser } = await runBrowser();\n\n    try {\n      let pageErrors = [];\n      let consoleMessages = [];\n\n      page\n        .on(\"console\", (message) => {\n          let text = message.text();\n\n          if (/Error: Aborted because/.test(text)) {\n            const splittedText = text.split(\"\\n\");\n\n            text = `${splittedText[0]}\\n${splittedText[1]}\\n    <stack>`;\n          }\n\n          consoleMessages.push(text);\n        })\n        .on(\"pageerror\", (error) => {\n          pageErrors.push(error);\n        });\n\n      await page.goto(`http://localhost:${port}/one-main.html`, {\n        waitUntil: \"networkidle0\",\n      });\n\n      fs.writeFileSync(pathToOneEntry, `${originalOneEntryContent}// comment`);\n\n      await page.waitForNavigation({ waitUntil: \"networkidle0\" });\n\n      expect(consoleMessages).toMatchSnapshot(\"console messages\");\n      expect(pageErrors).toMatchSnapshot(\"page errors\");\n\n      pageErrors = [];\n      consoleMessages = [];\n\n      await page.goto(`http://localhost:${port}/two-main.html`, {\n        waitUntil: \"networkidle0\",\n      });\n\n      fs.writeFileSync(pathToTwoEntry, `${originalTwoEntryContent}// comment`);\n\n      await page.waitForNavigation({ waitUntil: \"networkidle0\" });\n\n      expect(consoleMessages).toMatchSnapshot(\"console messages\");\n      expect(pageErrors).toMatchSnapshot(\"page errors\");\n    } finally {\n      await browser.close();\n      await server.stop();\n\n      fs.writeFileSync(pathToOneEntry, originalOneEntryContent);\n      fs.writeFileSync(pathToTwoEntry, originalTwoEntryContent);\n    }\n  });\n\n  it(\"should work with web target configurations when only live reload is enabled, and do live reload when changing own entries\", async () => {\n    const compiler = webpack(twoWebTargetConfiguration);\n    const devServerOptions = {\n      port,\n      hot: false,\n      liveReload: true,\n    };\n    const pathToOneEntry = path.resolve(\n      __dirname,\n      \"../fixtures/multi-compiler-two-configurations/one.js\",\n    );\n    const originalOneEntryContent = fs.readFileSync(pathToOneEntry);\n    const pathToTwoEntry = path.resolve(\n      __dirname,\n      \"../fixtures/multi-compiler-two-configurations/two.js\",\n    );\n    const originalTwoEntryContent = fs.readFileSync(pathToTwoEntry);\n\n    const server = new Server(devServerOptions, compiler);\n\n    await server.start();\n\n    const { page, browser } = await runBrowser();\n\n    try {\n      let pageErrors = [];\n      let consoleMessages = [];\n\n      page\n        .on(\"console\", (message) => {\n          consoleMessages.push(message.text());\n        })\n        .on(\"pageerror\", (error) => {\n          pageErrors.push(error);\n        });\n\n      await page.goto(`http://localhost:${port}/one-main.html`, {\n        waitUntil: \"networkidle0\",\n      });\n\n      fs.writeFileSync(pathToOneEntry, `${originalOneEntryContent}// comment`);\n\n      await page.waitForNavigation({ waitUntil: \"networkidle0\" });\n\n      expect(consoleMessages).toMatchSnapshot(\"console messages\");\n      expect(pageErrors).toMatchSnapshot(\"page errors\");\n\n      pageErrors = [];\n      consoleMessages = [];\n\n      await page.goto(`http://localhost:${port}/two-main.html`, {\n        waitUntil: \"networkidle0\",\n      });\n\n      fs.writeFileSync(pathToTwoEntry, `${originalTwoEntryContent}// comment`);\n\n      await page.waitForNavigation({ waitUntil: \"networkidle0\" });\n\n      expect(consoleMessages).toMatchSnapshot(\"console messages\");\n      expect(pageErrors).toMatchSnapshot(\"page errors\");\n    } finally {\n      await browser.close();\n      await server.stop();\n\n      fs.writeFileSync(pathToOneEntry, originalOneEntryContent);\n      fs.writeFileSync(pathToTwoEntry, originalTwoEntryContent);\n    }\n  });\n\n  it(\"should work with web target configurations when only live reload is enabled and do live reload when changing other entries\", async () => {\n    const compiler = webpack(twoWebTargetConfiguration);\n    const devServerOptions = {\n      port,\n      hot: false,\n      liveReload: true,\n    };\n    const pathToOneEntry = path.resolve(\n      __dirname,\n      \"../fixtures/multi-compiler-two-configurations/one.js\",\n    );\n    const originalOneEntryContent = fs.readFileSync(pathToOneEntry);\n    const pathToTwoEntry = path.resolve(\n      __dirname,\n      \"../fixtures/multi-compiler-two-configurations/two.js\",\n    );\n    const originalTwoEntryContent = fs.readFileSync(pathToTwoEntry);\n\n    const server = new Server(devServerOptions, compiler);\n\n    await server.start();\n\n    const { page, browser } = await runBrowser();\n\n    try {\n      let pageErrors = [];\n      let consoleMessages = [];\n\n      page\n        .on(\"console\", (message) => {\n          consoleMessages.push(message.text());\n        })\n        .on(\"pageerror\", (error) => {\n          pageErrors.push(error);\n        });\n\n      await page.goto(`http://localhost:${port}/one-main.html`, {\n        waitUntil: \"networkidle0\",\n      });\n\n      fs.writeFileSync(pathToTwoEntry, `${originalTwoEntryContent}// comment`);\n\n      await page.waitForNavigation({ waitUntil: \"networkidle0\" });\n\n      expect(consoleMessages).toMatchSnapshot(\"console messages\");\n      expect(pageErrors).toMatchSnapshot(\"page errors\");\n\n      pageErrors = [];\n      consoleMessages = [];\n\n      await page.goto(`http://localhost:${port}/two-main.html`, {\n        waitUntil: \"networkidle0\",\n      });\n\n      fs.writeFileSync(pathToOneEntry, `${originalOneEntryContent}// comment`);\n\n      await page.waitForNavigation({ waitUntil: \"networkidle0\" });\n\n      expect(consoleMessages).toMatchSnapshot(\"console messages\");\n      expect(pageErrors).toMatchSnapshot(\"page errors\");\n    } finally {\n      await browser.close();\n      await server.stop();\n\n      fs.writeFileSync(pathToOneEntry, originalOneEntryContent);\n      fs.writeFileSync(pathToTwoEntry, originalTwoEntryContent);\n    }\n  });\n\n  it(\"should work with universal configuration and do nothing\", async () => {\n    const compiler = webpack(universalConfiguration);\n    const devServerOptions = {\n      port,\n    };\n    const server = new Server(devServerOptions, compiler);\n\n    await server.start();\n\n    const { page, browser } = await runBrowser();\n\n    const pageErrors = [];\n    const consoleMessages = [];\n    try {\n      const serverResponse = await page.goto(\n        `http://localhost:${port}/server.js`,\n        {\n          waitUntil: \"networkidle0\",\n        },\n      );\n\n      const serverResponseText = await serverResponse.text();\n\n      expect(serverResponseText).toContain(\"Hello from the server\");\n      expect(serverResponseText).not.toContain(\"WebsocketServer\");\n\n      page\n        .on(\"console\", (message) => {\n          consoleMessages.push(message.text());\n        })\n        .on(\"pageerror\", (error) => {\n          pageErrors.push(error);\n        });\n\n      await page.goto(`http://localhost:${port}/browser.html`, {\n        waitUntil: \"networkidle0\",\n      });\n    } finally {\n      await browser.close();\n      await server.stop();\n    }\n\n    expect(consoleMessages).toMatchSnapshot(\"console messages\");\n    expect(pageErrors).toMatchSnapshot(\"page errors\");\n  });\n\n  it(\"should work with universal configuration when hot and live reloads are enabled, and do hot reload for browser compiler by default when browser entry changed\", async () => {\n    const compiler = webpack(universalConfiguration);\n    const devServerOptions = {\n      port,\n      hot: true,\n      liveReload: true,\n    };\n    const pathToBrowserEntry = path.resolve(\n      __dirname,\n      \"../fixtures/universal-compiler-config/browser.js\",\n    );\n    const originalBrowserEntryContent = fs.readFileSync(pathToBrowserEntry);\n    const pathToServerEntry = path.resolve(\n      __dirname,\n      \"../fixtures/universal-compiler-config/server.js\",\n    );\n    const originalServerEntryContent = fs.readFileSync(pathToServerEntry);\n\n    const server = new Server(devServerOptions, compiler);\n\n    await server.start();\n\n    const { page, browser } = await runBrowser();\n\n    try {\n      const serverResponse = await page.goto(\n        `http://localhost:${port}/server.js`,\n        {\n          waitUntil: \"networkidle0\",\n        },\n      );\n\n      const serverResponseText = await serverResponse.text();\n\n      expect(serverResponseText).toContain(\"Hello from the server\");\n      expect(serverResponseText).not.toContain(\"WebsocketServer\");\n\n      const pageErrors = [];\n      const consoleMessages = [];\n\n      page\n        .on(\"console\", (message) => {\n          let text = message.text();\n\n          if (/Error: Aborted because/.test(text)) {\n            const splittedText = text.split(\"\\n\");\n\n            text = `${splittedText[0]}\\n${splittedText[1]}\\n    <stack>`;\n          }\n\n          consoleMessages.push(text);\n        })\n        .on(\"pageerror\", (error) => {\n          pageErrors.push(error);\n        });\n\n      await page.goto(`http://localhost:${port}/browser.html`, {\n        waitUntil: \"networkidle0\",\n      });\n\n      fs.writeFileSync(\n        pathToBrowserEntry,\n        `${originalBrowserEntryContent}// comment`,\n      );\n\n      await page.waitForNavigation({ waitUntil: \"networkidle0\" });\n\n      expect(consoleMessages).toMatchSnapshot(\"console messages\");\n      expect(pageErrors).toMatchSnapshot(\"page errors\");\n    } finally {\n      await browser.close();\n      await server.stop();\n\n      fs.writeFileSync(pathToBrowserEntry, originalBrowserEntryContent);\n      fs.writeFileSync(pathToServerEntry, originalServerEntryContent);\n    }\n  });\n\n  it(\"should work with universal configuration when only hot reload is enabled, and do hot reload for browser compiler when browser entry changed\", async () => {\n    const compiler = webpack(universalConfiguration);\n    const devServerOptions = {\n      port,\n      hot: true,\n      liveReload: false,\n    };\n    const pathToBrowserEntry = path.resolve(\n      __dirname,\n      \"../fixtures/universal-compiler-config/browser.js\",\n    );\n    const originalBrowserEntryContent = fs.readFileSync(pathToBrowserEntry);\n\n    const server = new Server(devServerOptions, compiler);\n\n    await server.start();\n\n    const { page, browser } = await runBrowser();\n\n    try {\n      const serverResponse = await page.goto(\n        `http://localhost:${port}/server.js`,\n        {\n          waitUntil: \"networkidle0\",\n        },\n      );\n\n      const serverResponseText = await serverResponse.text();\n\n      expect(serverResponseText).toContain(\"Hello from the server\");\n      expect(serverResponseText).not.toContain(\"WebsocketServer\");\n\n      const pageErrors = [];\n      const consoleMessages = [];\n\n      page\n        .on(\"console\", (message) => {\n          let text = message.text();\n\n          if (/Error: Aborted because/.test(text)) {\n            const splittedText = text.split(\"\\n\");\n\n            text = `${splittedText[0]}\\n${splittedText[1]}\\n    <stack>`;\n          }\n\n          consoleMessages.push(text);\n        })\n        .on(\"pageerror\", (error) => {\n          pageErrors.push(error);\n        });\n\n      await page.goto(`http://localhost:${port}/browser.html`, {\n        waitUntil: \"networkidle0\",\n      });\n\n      fs.writeFileSync(\n        pathToBrowserEntry,\n        `${originalBrowserEntryContent}// comment`,\n      );\n\n      await page.waitForNavigation({ waitUntil: \"networkidle0\" });\n\n      expect(consoleMessages).toMatchSnapshot(\"console messages\");\n      expect(pageErrors).toMatchSnapshot(\"page errors\");\n    } finally {\n      await browser.close();\n      await server.stop();\n\n      fs.writeFileSync(pathToBrowserEntry, originalBrowserEntryContent);\n    }\n  });\n\n  it(\"should work with universal configuration when only live reload is enabled, and do live reload for browser compiler when changing browser and server entries\", async () => {\n    const compiler = webpack(universalConfiguration);\n    const devServerOptions = {\n      port,\n      hot: false,\n      liveReload: true,\n    };\n    const pathToBrowserEntry = path.resolve(\n      __dirname,\n      \"../fixtures/universal-compiler-config/browser.js\",\n    );\n    const originalBrowserEntryContent = fs.readFileSync(pathToBrowserEntry);\n    const pathToServerEntry = path.resolve(\n      __dirname,\n      \"../fixtures/universal-compiler-config/server.js\",\n    );\n    const originalServerEntryContent = fs.readFileSync(pathToServerEntry);\n\n    const server = new Server(devServerOptions, compiler);\n\n    await server.start();\n\n    const { page, browser } = await runBrowser();\n\n    try {\n      const serverResponse = await page.goto(\n        `http://localhost:${port}/server.js`,\n        {\n          waitUntil: \"networkidle0\",\n        },\n      );\n\n      const serverResponseText = await serverResponse.text();\n\n      expect(serverResponseText).toContain(\"Hello from the server\");\n      expect(serverResponseText).not.toContain(\"WebsocketServer\");\n\n      let pageErrors = [];\n      let consoleMessages = [];\n\n      page\n        .on(\"console\", (message) => {\n          consoleMessages.push(message.text());\n        })\n        .on(\"pageerror\", (error) => {\n          pageErrors.push(error);\n        });\n\n      await page.goto(`http://localhost:${port}/browser.html`, {\n        waitUntil: \"networkidle0\",\n      });\n\n      fs.writeFileSync(\n        pathToBrowserEntry,\n        `${originalBrowserEntryContent}// comment`,\n      );\n\n      await page.waitForNavigation({ waitUntil: \"networkidle0\" });\n\n      expect(consoleMessages).toMatchSnapshot(\"console messages\");\n      expect(pageErrors).toMatchSnapshot(\"page errors\");\n\n      pageErrors = [];\n      consoleMessages = [];\n\n      await page.goto(`http://localhost:${port}/browser.html`, {\n        waitUntil: \"networkidle0\",\n      });\n\n      fs.writeFileSync(\n        pathToServerEntry,\n        `${originalServerEntryContent}// comment`,\n      );\n\n      await page.waitForNavigation({ waitUntil: \"networkidle0\" });\n\n      expect(consoleMessages).toMatchSnapshot(\"console messages\");\n      expect(pageErrors).toMatchSnapshot(\"page errors\");\n    } finally {\n      await browser.close();\n      await server.stop();\n\n      fs.writeFileSync(pathToBrowserEntry, originalBrowserEntryContent);\n      fs.writeFileSync(pathToServerEntry, originalServerEntryContent);\n    }\n  });\n\n  it(\"should work with universal configuration when only live reload is enabled, and do live reload for browser compiler when changing server and browser entries\", async () => {\n    const compiler = webpack(universalConfiguration);\n    const devServerOptions = {\n      port,\n      hot: false,\n      liveReload: true,\n    };\n    const pathToBrowserEntry = path.resolve(\n      __dirname,\n      \"../fixtures/universal-compiler-config/browser.js\",\n    );\n    const originalBrowserEntryContent = fs.readFileSync(pathToBrowserEntry);\n    const pathToServerEntry = path.resolve(\n      __dirname,\n      \"../fixtures/universal-compiler-config/server.js\",\n    );\n    const originalServerEntryContent = fs.readFileSync(pathToServerEntry);\n\n    const server = new Server(devServerOptions, compiler);\n\n    await server.start();\n\n    const { page, browser } = await runBrowser();\n\n    try {\n      const serverResponse = await page.goto(\n        `http://localhost:${port}/server.js`,\n        {\n          waitUntil: \"networkidle0\",\n        },\n      );\n\n      const serverResponseText = await serverResponse.text();\n\n      expect(serverResponseText).toContain(\"Hello from the server\");\n      expect(serverResponseText).not.toContain(\"WebsocketServer\");\n\n      let pageErrors = [];\n      let consoleMessages = [];\n\n      page\n        .on(\"console\", (message) => {\n          consoleMessages.push(message.text());\n        })\n        .on(\"pageerror\", (error) => {\n          pageErrors.push(error);\n        });\n\n      await page.goto(`http://localhost:${port}/browser.html`, {\n        waitUntil: \"networkidle0\",\n      });\n\n      fs.writeFileSync(\n        pathToServerEntry,\n        `${originalServerEntryContent}// comment`,\n      );\n\n      await page.waitForNavigation({ waitUntil: \"networkidle0\" });\n\n      expect(consoleMessages).toMatchSnapshot(\"console messages\");\n      expect(pageErrors).toMatchSnapshot(\"page errors\");\n\n      pageErrors = [];\n      consoleMessages = [];\n\n      await page.goto(`http://localhost:${port}/browser.html`, {\n        waitUntil: \"networkidle0\",\n      });\n\n      fs.writeFileSync(\n        pathToBrowserEntry,\n        `${originalBrowserEntryContent}// comment`,\n      );\n\n      await page.waitForNavigation({ waitUntil: \"networkidle0\" });\n\n      expect(consoleMessages).toMatchSnapshot(\"console messages\");\n      expect(pageErrors).toMatchSnapshot(\"page errors\");\n    } finally {\n      await browser.close();\n      await server.stop();\n\n      fs.writeFileSync(pathToBrowserEntry, originalBrowserEntryContent);\n      fs.writeFileSync(pathToServerEntry, originalServerEntryContent);\n    }\n  });\n});\n"
  },
  {
    "path": "test/e2e/on-listening.test.js",
    "content": "\"use strict\";\n\nconst webpack = require(\"webpack\");\nconst Server = require(\"../../lib/Server\");\nconst config = require(\"../fixtures/client-config/webpack.config\");\nconst runBrowser = require(\"../helpers/run-browser\");\nconst port = require(\"../ports-map\")[\"on-listening-option\"];\n\ndescribe(\"onListening option\", () => {\n  let compiler;\n  let server;\n  let page;\n  let browser;\n  let pageErrors;\n  let consoleMessages;\n  let onListeningIsRunning = false;\n\n  beforeEach(async () => {\n    compiler = webpack(config);\n    server = new Server(\n      {\n        onListening: (devServer) => {\n          if (!devServer) {\n            throw new Error(\"webpack-dev-server is not defined\");\n          }\n\n          onListeningIsRunning = true;\n\n          devServer.app.use(\"/listening/some/path\", (req, res, next) => {\n            if (req.method === \"GET\") {\n              res.setHeader(\"Content-Type\", \"text/html; charset=utf-8\");\n              res.end(\"listening\");\n              return;\n            } else if (req.method === \"POST\") {\n              res.setHeader(\"Content-Type\", \"text/html; charset=utf-8\");\n              res.end(\"listening POST\");\n              return;\n            }\n\n            return next();\n          });\n        },\n        port,\n      },\n      compiler,\n    );\n\n    await server.start();\n\n    ({ page, browser } = await runBrowser());\n\n    pageErrors = [];\n    consoleMessages = [];\n  });\n\n  afterEach(async () => {\n    await browser.close();\n    await server.stop();\n  });\n\n  it(\"should handle GET request to /listening/some/path route\", async () => {\n    page\n      .on(\"console\", (message) => {\n        consoleMessages.push(message);\n      })\n      .on(\"pageerror\", (error) => {\n        pageErrors.push(error);\n      });\n\n    const response = await page.goto(\n      `http://localhost:${port}/listening/some/path`,\n      {\n        waitUntil: \"networkidle0\",\n      },\n    );\n\n    expect(onListeningIsRunning).toBe(true);\n\n    expect(response.headers()[\"content-type\"]).toMatchSnapshot(\n      \"response headers content-type\",\n    );\n\n    expect(response.status()).toMatchSnapshot(\"response status\");\n\n    expect(await response.text()).toMatchSnapshot(\"response text\");\n\n    expect(consoleMessages.map((message) => message.text())).toMatchSnapshot(\n      \"console messages\",\n    );\n\n    expect(pageErrors).toMatchSnapshot(\"page errors\");\n  });\n\n  it(\"should handle POST request to /listening/some/path route\", async () => {\n    await page.setRequestInterception(true);\n\n    page\n      .on(\"console\", (message) => {\n        consoleMessages.push(message);\n      })\n      .on(\"pageerror\", (error) => {\n        pageErrors.push(error);\n      })\n      .on(\"request\", (interceptedRequest) => {\n        if (interceptedRequest.isInterceptResolutionHandled()) return;\n\n        interceptedRequest.continue({ method: \"POST\" });\n      });\n\n    const response = await page.goto(\n      `http://localhost:${port}/listening/some/path`,\n      {\n        waitUntil: \"networkidle0\",\n      },\n    );\n\n    expect(onListeningIsRunning).toBe(true);\n\n    expect(response.headers()[\"content-type\"]).toMatchSnapshot(\n      \"response headers content-type\",\n    );\n\n    expect(response.status()).toMatchSnapshot(\"response status\");\n\n    expect(await response.text()).toMatchSnapshot(\"response text\");\n\n    expect(consoleMessages.map((message) => message.text())).toMatchSnapshot(\n      \"console messages\",\n    );\n\n    expect(pageErrors).toMatchSnapshot(\"page errors\");\n  });\n});\n"
  },
  {
    "path": "test/e2e/options-middleware.test.js",
    "content": "\"use strict\";\n\nconst Express = require(\"express\");\nconst webpack = require(\"webpack\");\nconst Server = require(\"../../lib/Server\");\nconst config = require(\"../fixtures/client-config/webpack.config\");\nconst runBrowser = require(\"../helpers/run-browser\");\nconst port = require(\"../ports-map\")[\"options-request-response\"];\n\nconst createWaiting = () => {\n  let resolve;\n  let reject;\n\n  const waiting = new Promise((resolve$, reject$) => {\n    resolve = resolve$;\n    reject = reject$;\n  });\n\n  return {\n    resolve,\n    reject,\n    waiting,\n  };\n};\n\ndescribe(\"handle options-request correctly\", () => {\n  it(\"should response with 200 http code\", async () => {\n    const compiler = webpack(config);\n    const [portForServer, portForApp] = port;\n    const closeApp = await (async () => {\n      const { resolve, waiting } = createWaiting();\n      const app = new Express();\n\n      app.get(\"/\", (req, res) => {\n        res.sendStatus(200);\n      });\n\n      const server = app.listen(portForApp, () => {\n        resolve();\n      });\n\n      await waiting;\n\n      return async () => {\n        const { resolve: resolve2, waiting: waiting2 } = createWaiting();\n\n        server.close(() => {\n          resolve2();\n        });\n\n        await waiting2;\n      };\n    })();\n    const server = new Server(\n      {\n        port: portForServer,\n        headers: {\n          \"Access-Control-Allow-Origin\": \"*\",\n          \"Access-Control-Allow-Headers\": \"*\",\n        },\n      },\n      compiler,\n    );\n\n    await server.start();\n\n    const { page, browser } = await runBrowser();\n    const prefixUrl = \"http://localhost\";\n    const htmlUrl = `${prefixUrl}:${portForServer}/test.html`;\n    const appUrl = `${prefixUrl}:${portForApp}`;\n\n    try {\n      const responseStatus = [];\n\n      page.on(\"response\", (res) => {\n        if (/test\\.html$/.test(res.url())) {\n          responseStatus.push(res.status());\n        }\n      });\n\n      await page.goto(appUrl, {\n        waitUntil: \"networkidle0\",\n      });\n\n      await page.evaluate(\n        (url) =>\n          globalThis.fetch(url, {\n            headers: {\n              \"another-header\": \"1\",\n            },\n          }),\n        htmlUrl,\n      );\n\n      expect(responseStatus.sort()).toEqual([200, 204]);\n    } finally {\n      await browser.close();\n      await server.stop();\n      await closeApp();\n    }\n  });\n});\n"
  },
  {
    "path": "test/e2e/overlay.test.js",
    "content": "\"use strict\";\n\nconst path = require(\"node:path\");\nconst fs = require(\"graceful-fs\");\nconst waitForExpect = require(\"wait-for-expect\");\nconst webpack = require(\"webpack\");\nconst Server = require(\"../../lib/Server\");\nconst trustedTypesConfig = require(\"../fixtures/overlay-config/trusted-types.webpack.config\");\nconst config = require(\"../fixtures/overlay-config/webpack.config\");\nconst runBrowser = require(\"../helpers/run-browser\");\nconst port = require(\"../ports-map\").overlay;\n\nclass ErrorPlugin {\n  constructor(message, skipCounter) {\n    this.message =\n      message || \"Error from compilation. Can't find 'test' module.\";\n    this.skipCounter = skipCounter;\n    this.counter = 0;\n  }\n\n  apply(compiler) {\n    compiler.hooks.thisCompilation.tap(\n      \"errors-webpack-plugin\",\n      (compilation) => {\n        if (\n          typeof this.skipCounter !== \"undefined\" &&\n          this.counter !== this.skipCounter\n        ) {\n          this.counter += 1;\n\n          return;\n        }\n\n        compilation.errors.push(new Error(this.message));\n      },\n    );\n  }\n}\n\nclass WarningPlugin {\n  constructor(message, skipCounter) {\n    this.message = message || \"Warning from compilation\";\n    this.skipCounter = skipCounter;\n    this.counter = 0;\n  }\n\n  apply(compiler) {\n    compiler.hooks.thisCompilation.tap(\n      \"warnings-webpack-plugin\",\n      (compilation) => {\n        if (\n          typeof this.skipCounter !== \"undefined\" &&\n          this.counter !== this.skipCounter\n        ) {\n          this.counter += 1;\n\n          return;\n        }\n\n        compilation.warnings.push(new Error(this.message));\n      },\n    );\n  }\n}\n\nconst delay = (ms) =>\n  new Promise((resolve) => {\n    setTimeout(resolve, ms);\n  });\n\nlet prettier;\nlet prettierHTML;\nlet prettierCSS;\n\ndescribe(\"overlay\", () => {\n  beforeAll(async () => {\n    // Due problems with ESM modules for Node.js@18\n    // TODO replace it on import/require when Node.js@18 will be dropped\n    prettier = require(\"../../node_modules/prettier/standalone\");\n    prettierHTML = require(\"../../node_modules/prettier/plugins/html\");\n    prettierCSS = require(\"../../node_modules/prettier/plugins/postcss\");\n  });\n\n  it(\"should show a warning for initial compilation\", async () => {\n    const compiler = webpack(config);\n\n    new WarningPlugin().apply(compiler);\n\n    const devServerOptions = {\n      port,\n    };\n    const server = new Server(devServerOptions, compiler);\n\n    await server.start();\n\n    const { page, browser } = await runBrowser();\n\n    try {\n      await page.goto(`http://localhost:${port}/`, {\n        waitUntil: \"networkidle0\",\n      });\n\n      // Delay for the overlay to appear\n      await delay(1000);\n\n      const pageHtml = await page.evaluate(() => document.body.outerHTML);\n      const overlayHandle = await page.$(\"#webpack-dev-server-client-overlay\");\n      const overlayFrame = await overlayHandle.contentFrame();\n      const overlayHtml = await overlayFrame.evaluate(\n        () => document.body.outerHTML,\n      );\n\n      expect(\n        await prettier.format(pageHtml, {\n          parser: \"html\",\n          plugins: [prettierHTML, prettierCSS],\n        }),\n      ).toMatchSnapshot(\"page html\");\n      expect(\n        await prettier.format(overlayHtml, {\n          parser: \"html\",\n          plugins: [prettierHTML, prettierCSS],\n        }),\n      ).toMatchSnapshot(\"overlay html\");\n    } finally {\n      await browser.close();\n      await server.stop();\n    }\n  });\n\n  it(\"should show an error for initial compilation\", async () => {\n    const compiler = webpack(config);\n\n    new ErrorPlugin().apply(compiler);\n\n    const devServerOptions = {\n      port,\n    };\n    const server = new Server(devServerOptions, compiler);\n\n    await server.start();\n\n    const { page, browser } = await runBrowser();\n\n    try {\n      await page.goto(`http://localhost:${port}/`, {\n        waitUntil: \"networkidle0\",\n      });\n\n      // Delay for the overlay to appear\n      await delay(1000);\n\n      const pageHtml = await page.evaluate(() => document.body.outerHTML);\n      const overlayHandle = await page.$(\"#webpack-dev-server-client-overlay\");\n      const overlayFrame = await overlayHandle.contentFrame();\n      const overlayHtml = await overlayFrame.evaluate(\n        () => document.body.outerHTML,\n      );\n\n      expect(\n        await prettier.format(pageHtml, {\n          parser: \"html\",\n          plugins: [prettierHTML, prettierCSS],\n        }),\n      ).toMatchSnapshot(\"page html\");\n      expect(\n        await prettier.format(overlayHtml, {\n          parser: \"html\",\n          plugins: [prettierHTML, prettierCSS],\n        }),\n      ).toMatchSnapshot(\"overlay html\");\n    } finally {\n      await browser.close();\n      await server.stop();\n    }\n  });\n\n  it(\"should show a warning and error for initial compilation\", async () => {\n    const compiler = webpack(config);\n\n    new WarningPlugin().apply(compiler);\n    new WarningPlugin().apply(compiler);\n    new ErrorPlugin().apply(compiler);\n    new ErrorPlugin().apply(compiler);\n    new ErrorPlugin().apply(compiler);\n\n    const devServerOptions = {\n      port,\n    };\n    const server = new Server(devServerOptions, compiler);\n\n    await server.start();\n\n    const { page, browser } = await runBrowser();\n\n    try {\n      await page.goto(`http://localhost:${port}/`, {\n        waitUntil: \"networkidle0\",\n      });\n\n      // Delay for the overlay to appear\n      await delay(1000);\n\n      const pageHtml = await page.evaluate(() => document.body.outerHTML);\n      const overlayHandle = await page.$(\"#webpack-dev-server-client-overlay\");\n      const overlayFrame = await overlayHandle.contentFrame();\n      const overlayHtml = await overlayFrame.evaluate(\n        () => document.body.outerHTML,\n      );\n\n      expect(\n        await prettier.format(pageHtml, {\n          parser: \"html\",\n          plugins: [prettierHTML, prettierCSS],\n        }),\n      ).toMatchSnapshot(\"page html\");\n      expect(\n        await prettier.format(overlayHtml, {\n          parser: \"html\",\n          plugins: [prettierHTML, prettierCSS],\n        }),\n      ).toMatchSnapshot(\"overlay html\");\n    } finally {\n      await browser.close();\n      await server.stop();\n    }\n  });\n\n  it(\"should show an ansi formatted error for initial compilation\", async () => {\n    const compiler = webpack(config);\n\n    new ErrorPlugin(\n      \"\u001b[0m \u001b[90m 18 |\u001b[39m           \u001b[33mRender\u001b[39m \u001b[33mansi formatted text\u001b[39m\u001b[0m\",\n    ).apply(compiler);\n\n    const devServerOptions = {\n      port,\n    };\n    const server = new Server(devServerOptions, compiler);\n\n    await server.start();\n\n    const { page, browser } = await runBrowser();\n\n    try {\n      await page.goto(`http://localhost:${port}/`, {\n        waitUntil: \"networkidle0\",\n      });\n\n      // Delay for the overlay to appear\n      await delay(1000);\n\n      const pageHtml = await page.evaluate(() => document.body.outerHTML);\n      const overlayHandle = await page.$(\"#webpack-dev-server-client-overlay\");\n      const overlayFrame = await overlayHandle.contentFrame();\n      const overlayHtml = await overlayFrame.evaluate(\n        () => document.body.outerHTML,\n      );\n\n      expect(\n        await prettier.format(pageHtml, {\n          parser: \"html\",\n          plugins: [prettierHTML, prettierCSS],\n        }),\n      ).toMatchSnapshot(\"page html\");\n      expect(\n        await prettier.format(overlayHtml, {\n          parser: \"html\",\n          plugins: [prettierHTML, prettierCSS],\n        }),\n      ).toMatchSnapshot(\"overlay html\");\n    } finally {\n      await browser.close();\n      await server.stop();\n    }\n  });\n\n  it(\"should show a warning and error for initial compilation and protects against xss\", async () => {\n    const compiler = webpack(config);\n\n    new WarningPlugin(\"<strong>strong</strong>\").apply(compiler);\n    new ErrorPlugin(\"<strong>strong</strong>\").apply(compiler);\n\n    const devServerOptions = {\n      port,\n    };\n    const server = new Server(devServerOptions, compiler);\n\n    await server.start();\n\n    const { page, browser } = await runBrowser();\n\n    try {\n      await page.goto(`http://localhost:${port}/`, {\n        waitUntil: \"networkidle0\",\n      });\n\n      // Delay for the overlay to appear\n      await delay(1000);\n\n      const pageHtml = await page.evaluate(() => document.body.outerHTML);\n      const overlayHandle = await page.$(\"#webpack-dev-server-client-overlay\");\n      const overlayFrame = await overlayHandle.contentFrame();\n      const overlayHtml = await overlayFrame.evaluate(\n        () => document.body.outerHTML,\n      );\n\n      expect(\n        await prettier.format(pageHtml, {\n          parser: \"html\",\n          plugins: [prettierHTML, prettierCSS],\n        }),\n      ).toMatchSnapshot(\"page html\");\n      expect(\n        await prettier.format(overlayHtml, {\n          parser: \"html\",\n          plugins: [prettierHTML, prettierCSS],\n        }),\n      ).toMatchSnapshot(\"overlay html\");\n    } finally {\n      await browser.close();\n      await server.stop();\n    }\n  });\n\n  it(\"should not show initially, then show on an error, then hide on fix\", async () => {\n    const compiler = webpack(config);\n    const devServerOptions = {\n      port,\n    };\n    const server = new Server(devServerOptions, compiler);\n\n    await server.start();\n\n    const { page, browser } = await runBrowser();\n\n    try {\n      await page.goto(`http://localhost:${port}/`, {\n        waitUntil: \"networkidle0\",\n      });\n\n      let pageHtml = await page.evaluate(() => document.body.outerHTML);\n      let overlayHandle = await page.$(\"#webpack-dev-server-client-overlay\");\n\n      expect(overlayHandle).toBeNull();\n      expect(\n        await prettier.format(pageHtml, {\n          parser: \"html\",\n          plugins: [prettierHTML, prettierCSS],\n        }),\n      ).toMatchSnapshot(\"page html initial\");\n\n      const pathToFile = path.resolve(\n        __dirname,\n        \"../fixtures/overlay-config/foo.js\",\n      );\n      const originalCode = fs.readFileSync(pathToFile);\n\n      fs.writeFileSync(pathToFile, \"`;\");\n\n      await page.waitForSelector(\"#webpack-dev-server-client-overlay\");\n\n      overlayHandle = await page.$(\"#webpack-dev-server-client-overlay\");\n      pageHtml = await page.evaluate(() => document.body.outerHTML);\n\n      const overlayFrame = await overlayHandle.contentFrame();\n      const overlayHtml = await overlayFrame.evaluate(\n        () => document.body.outerHTML,\n      );\n\n      expect(\n        await prettier.format(pageHtml, {\n          parser: \"html\",\n          plugins: [prettierHTML, prettierCSS],\n        }),\n      ).toMatchSnapshot(\"page html with error\");\n      expect(\n        await prettier.format(overlayHtml, {\n          parser: \"html\",\n          plugins: [prettierHTML, prettierCSS],\n        }),\n      ).toMatchSnapshot(\"overlay html\");\n\n      fs.writeFileSync(pathToFile, originalCode);\n\n      await page.waitForSelector(\"#webpack-dev-server-client-overlay\", {\n        hidden: true,\n      });\n\n      pageHtml = await page.evaluate(() => document.body.outerHTML);\n      overlayHandle = await page.$(\"#webpack-dev-server-client-overlay\");\n\n      expect(overlayHandle).toBeNull();\n      expect(\n        await prettier.format(pageHtml, {\n          parser: \"html\",\n          plugins: [prettierHTML, prettierCSS],\n        }),\n      ).toMatchSnapshot(\"page html after fix error\");\n    } finally {\n      await browser.close();\n      await server.stop();\n    }\n  });\n\n  it(\"should not show initially, then show on an error, then show other error, then hide on fix\", async () => {\n    const compiler = webpack(config);\n    const devServerOptions = {\n      port,\n    };\n    const server = new Server(devServerOptions, compiler);\n\n    await server.start();\n\n    const { page, browser } = await runBrowser();\n\n    try {\n      await page.goto(`http://localhost:${port}/`, {\n        waitUntil: \"networkidle0\",\n      });\n\n      let pageHtml = await page.evaluate(() => document.body.outerHTML);\n      let overlayHandle = await page.$(\"#webpack-dev-server-client-overlay\");\n\n      expect(overlayHandle).toBeNull();\n      expect(\n        await prettier.format(pageHtml, {\n          parser: \"html\",\n          plugins: [prettierHTML, prettierCSS],\n        }),\n      ).toMatchSnapshot(\"page html initial\");\n\n      const pathToFile = path.resolve(\n        __dirname,\n        \"../fixtures/overlay-config/foo.js\",\n      );\n      const originalCode = fs.readFileSync(pathToFile);\n\n      fs.writeFileSync(pathToFile, \"`;\");\n\n      await page.waitForSelector(\"#webpack-dev-server-client-overlay\");\n\n      overlayHandle = await page.$(\"#webpack-dev-server-client-overlay\");\n      pageHtml = await page.evaluate(() => document.body.outerHTML);\n\n      let overlayFrame = await overlayHandle.contentFrame();\n      let overlayHtml = await overlayFrame.evaluate(\n        () => document.body.outerHTML,\n      );\n\n      expect(\n        await prettier.format(pageHtml, {\n          parser: \"html\",\n          plugins: [prettierHTML, prettierCSS],\n        }),\n      ).toMatchSnapshot(\"page html with error\");\n      expect(\n        await prettier.format(overlayHtml, {\n          parser: \"html\",\n          plugins: [prettierHTML, prettierCSS],\n        }),\n      ).toMatchSnapshot(\"overlay html\");\n\n      fs.writeFileSync(pathToFile, \"`;a\");\n\n      await page.waitForSelector(\"#webpack-dev-server-client-overlay\", {\n        hidden: true,\n      });\n      await page.waitForSelector(\"#webpack-dev-server-client-overlay\");\n\n      overlayHandle = await page.$(\"#webpack-dev-server-client-overlay\");\n      pageHtml = await page.evaluate(() => document.body.outerHTML);\n\n      overlayFrame = await overlayHandle.contentFrame();\n      overlayHtml = await overlayFrame.evaluate(() => document.body.outerHTML);\n\n      expect(\n        await prettier.format(pageHtml, {\n          parser: \"html\",\n          plugins: [prettierHTML, prettierCSS],\n        }),\n      ).toMatchSnapshot(\"page html with other error\");\n      expect(\n        await prettier.format(overlayHtml, {\n          parser: \"html\",\n          plugins: [prettierHTML, prettierCSS],\n        }),\n      ).toMatchSnapshot(\"overlay html\");\n\n      fs.writeFileSync(pathToFile, originalCode);\n\n      await page.waitForSelector(\"#webpack-dev-server-client-overlay\", {\n        hidden: true,\n      });\n\n      pageHtml = await page.evaluate(() => document.body.outerHTML);\n      overlayHandle = await page.$(\"#webpack-dev-server-client-overlay\");\n\n      expect(overlayHandle).toBeNull();\n      expect(\n        await prettier.format(pageHtml, {\n          parser: \"html\",\n          plugins: [prettierHTML, prettierCSS],\n        }),\n      ).toMatchSnapshot(\"page html after fix error\");\n    } finally {\n      await browser.close();\n      await server.stop();\n    }\n  });\n\n  it(\"should not show initially, then show on an error and allow to close\", async () => {\n    const compiler = webpack(config);\n    const devServerOptions = {\n      port,\n    };\n    const server = new Server(devServerOptions, compiler);\n\n    await server.start();\n\n    const { page, browser } = await runBrowser();\n\n    try {\n      await page.goto(`http://localhost:${port}/`, {\n        waitUntil: \"networkidle0\",\n      });\n\n      let pageHtml = await page.evaluate(() => document.body.outerHTML);\n      let overlayHandle = await page.$(\"#webpack-dev-server-client-overlay\");\n\n      expect(overlayHandle).toBeNull();\n      expect(\n        await prettier.format(pageHtml, {\n          parser: \"html\",\n          plugins: [prettierHTML, prettierCSS],\n        }),\n      ).toMatchSnapshot(\"page html initial\");\n\n      const pathToFile = path.resolve(\n        __dirname,\n        \"../fixtures/overlay-config/foo.js\",\n      );\n      const originalCode = fs.readFileSync(pathToFile);\n\n      fs.writeFileSync(pathToFile, \"`;\");\n\n      await page.waitForSelector(\"#webpack-dev-server-client-overlay\");\n\n      overlayHandle = await page.$(\"#webpack-dev-server-client-overlay\");\n      pageHtml = await page.evaluate(() => document.body.outerHTML);\n\n      const overlayFrame = await overlayHandle.contentFrame();\n      const overlayHtml = await overlayFrame.evaluate(\n        () => document.body.outerHTML,\n      );\n\n      expect(\n        await prettier.format(pageHtml, {\n          parser: \"html\",\n          plugins: [prettierHTML, prettierCSS],\n        }),\n      ).toMatchSnapshot(\"page html with error\");\n      expect(\n        await prettier.format(overlayHtml, {\n          parser: \"html\",\n          plugins: [prettierHTML, prettierCSS],\n        }),\n      ).toMatchSnapshot(\"overlay html\");\n\n      const frame = await page\n        .frames()\n        .find((item) => item.name() === \"webpack-dev-server-client-overlay\");\n\n      const buttonHandle = await frame.$(\"button\");\n\n      await buttonHandle.click();\n\n      await page.waitForSelector(\"#webpack-dev-server-client-overlay\", {\n        hidden: true,\n      });\n\n      pageHtml = await page.evaluate(() => document.body.outerHTML);\n      overlayHandle = await page.$(\"#webpack-dev-server-client-overlay\");\n\n      expect(overlayHandle).toBeNull();\n      expect(\n        await prettier.format(pageHtml, {\n          parser: \"html\",\n          plugins: [prettierHTML, prettierCSS],\n        }),\n      ).toMatchSnapshot(\"page html after close\");\n\n      fs.writeFileSync(pathToFile, originalCode);\n    } finally {\n      await browser.close();\n      await server.stop();\n    }\n  });\n\n  it(\"should open editor when error with file info is clicked\", async () => {\n    const mockLaunchEditorCb = jest.fn();\n    jest.mock(\"launch-editor\", () => mockLaunchEditorCb);\n\n    const compiler = webpack(config);\n    const devServerOptions = {\n      port,\n    };\n    const server = new Server(devServerOptions, compiler);\n\n    await server.start();\n\n    const { page, browser } = await runBrowser();\n\n    try {\n      await page.goto(`http://localhost:${port}/`, {\n        waitUntil: \"networkidle0\",\n      });\n\n      const pathToFile = path.resolve(\n        __dirname,\n        \"../fixtures/overlay-config/foo.js\",\n      );\n      const originalCode = fs.readFileSync(pathToFile);\n\n      fs.writeFileSync(pathToFile, \"`;\");\n\n      await page.waitForSelector(\"#webpack-dev-server-client-overlay\");\n\n      const frame = page\n        .frames()\n        .find((item) => item.name() === \"webpack-dev-server-client-overlay\");\n\n      const errorHandle = await frame.$(\"[data-can-open]\");\n\n      await errorHandle.click();\n\n      await waitForExpect(() => {\n        expect(mockLaunchEditorCb).toHaveBeenCalledTimes(1);\n      });\n\n      fs.writeFileSync(pathToFile, originalCode);\n    } finally {\n      await browser.close();\n      await server.stop();\n    }\n  });\n\n  it('should not show a warning when \"client.overlay\" is \"false\"', async () => {\n    const compiler = webpack(config);\n\n    new WarningPlugin().apply(compiler);\n\n    const devServerOptions = {\n      port,\n      client: {\n        overlay: false,\n      },\n    };\n    const server = new Server(devServerOptions, compiler);\n\n    await server.start();\n\n    const { page, browser } = await runBrowser();\n\n    try {\n      await page.goto(`http://localhost:${port}/`, {\n        waitUntil: \"networkidle0\",\n      });\n\n      // Delay for the overlay to appear\n      await delay(1000);\n\n      const pageHtml = await page.evaluate(() => document.body.outerHTML);\n      const overlayHandle = await page.$(\"#webpack-dev-server-client-overlay\");\n\n      expect(overlayHandle).toBeNull();\n      expect(\n        await prettier.format(pageHtml, {\n          parser: \"html\",\n          plugins: [prettierHTML, prettierCSS],\n        }),\n      ).toMatchSnapshot(\"page html\");\n    } finally {\n      await browser.close();\n      await server.stop();\n    }\n  });\n\n  it('should not show a warning when \"client.overlay.warnings\" is \"false\"', async () => {\n    const compiler = webpack(config);\n\n    new WarningPlugin().apply(compiler);\n\n    const devServerOptions = {\n      port,\n      client: {\n        overlay: {\n          warnings: false,\n        },\n      },\n    };\n    const server = new Server(devServerOptions, compiler);\n\n    await server.start();\n\n    const { page, browser } = await runBrowser();\n\n    try {\n      await page.goto(`http://localhost:${port}/`, {\n        waitUntil: \"networkidle0\",\n      });\n\n      // Delay for the overlay to appear\n      await delay(1000);\n\n      const pageHtml = await page.evaluate(() => document.body.outerHTML);\n      const overlayHandle = await page.$(\"#webpack-dev-server-client-overlay\");\n\n      expect(overlayHandle).toBeNull();\n      expect(\n        await prettier.format(pageHtml, {\n          parser: \"html\",\n          plugins: [prettierHTML, prettierCSS],\n        }),\n      ).toMatchSnapshot(\"page html\");\n    } finally {\n      await browser.close();\n      await server.stop();\n    }\n  });\n\n  it(\"should not show warning when it is filtered\", async () => {\n    const compiler = webpack(config);\n\n    new WarningPlugin(\"My special warning\").apply(compiler);\n\n    const server = new Server(\n      {\n        port,\n        client: {\n          overlay: {\n            warnings: (error) => {\n              // error is string in webpack 4\n              const message = typeof error === \"string\" ? error : error.message;\n              return message !== \"My special warning\";\n            },\n          },\n        },\n      },\n      compiler,\n    );\n\n    await server.start();\n\n    const { page, browser } = await runBrowser();\n\n    try {\n      await page.goto(`http://localhost:${port}/`, {\n        waitUntil: \"networkidle0\",\n      });\n\n      // Delay for the overlay to appear\n      await delay(1000);\n\n      const overlayHandle = await page.$(\"#webpack-dev-server-client-overlay\");\n\n      expect(overlayHandle).toBeNull();\n    } finally {\n      await browser.close();\n      await server.stop();\n    }\n  });\n\n  it(\"should show warning when it is not filtered\", async () => {\n    const compiler = webpack(config);\n\n    new WarningPlugin(\"Unfiltered warning\").apply(compiler);\n\n    const server = new Server(\n      {\n        port,\n        client: {\n          overlay: {\n            warnings: () => true,\n          },\n        },\n      },\n      compiler,\n    );\n\n    await server.start();\n\n    const { page, browser } = await runBrowser();\n\n    try {\n      await page.goto(`http://localhost:${port}/`, {\n        waitUntil: \"networkidle0\",\n      });\n\n      // Delay for the overlay to appear\n      await delay(1000);\n\n      const pageHtml = await page.evaluate(() => document.body.outerHTML);\n      const overlayHandle = await page.$(\"#webpack-dev-server-client-overlay\");\n      const overlayFrame = await overlayHandle.contentFrame();\n      const overlayHtml = await overlayFrame.evaluate(\n        () => document.body.outerHTML,\n      );\n\n      expect(\n        await prettier.format(pageHtml, {\n          parser: \"html\",\n          plugins: [prettierHTML, prettierCSS],\n        }),\n      ).toMatchSnapshot(\"page html\");\n      expect(\n        await prettier.format(overlayHtml, {\n          parser: \"html\",\n          plugins: [prettierHTML, prettierCSS],\n        }),\n      ).toMatchSnapshot(\"overlay html\");\n    } finally {\n      await browser.close();\n      await server.stop();\n    }\n  });\n\n  it('should show a warning when \"client.overlay\" is \"true\"', async () => {\n    const compiler = webpack(config);\n\n    new WarningPlugin().apply(compiler);\n\n    const devServerOptions = {\n      port,\n      client: {\n        overlay: true,\n      },\n    };\n    const server = new Server(devServerOptions, compiler);\n\n    await server.start();\n\n    const { page, browser } = await runBrowser();\n\n    try {\n      await page.goto(`http://localhost:${port}/`, {\n        waitUntil: \"networkidle0\",\n      });\n\n      // Delay for the overlay to appear\n      await delay(1000);\n\n      const pageHtml = await page.evaluate(() => document.body.outerHTML);\n      const overlayHandle = await page.$(\"#webpack-dev-server-client-overlay\");\n      const overlayFrame = await overlayHandle.contentFrame();\n      const overlayHtml = await overlayFrame.evaluate(\n        () => document.body.outerHTML,\n      );\n\n      expect(\n        await prettier.format(pageHtml, {\n          parser: \"html\",\n          plugins: [prettierHTML, prettierCSS],\n        }),\n      ).toMatchSnapshot(\"page html\");\n      expect(\n        await prettier.format(overlayHtml, {\n          parser: \"html\",\n          plugins: [prettierHTML, prettierCSS],\n        }),\n      ).toMatchSnapshot(\"overlay html\");\n    } finally {\n      await browser.close();\n      await server.stop();\n    }\n  });\n\n  it('should show a warning when \"client.overlay.warnings\" is \"true\"', async () => {\n    const compiler = webpack(config);\n\n    new WarningPlugin().apply(compiler);\n\n    const devServerOptions = {\n      port,\n      client: {\n        overlay: {\n          warnings: true,\n        },\n      },\n    };\n    const server = new Server(devServerOptions, compiler);\n\n    await server.start();\n\n    const { page, browser } = await runBrowser();\n\n    try {\n      await page.goto(`http://localhost:${port}/`, {\n        waitUntil: \"networkidle0\",\n      });\n\n      // Delay for the overlay to appear\n      await delay(1000);\n\n      const pageHtml = await page.evaluate(() => document.body.outerHTML);\n      const overlayHandle = await page.$(\"#webpack-dev-server-client-overlay\");\n      const overlayFrame = await overlayHandle.contentFrame();\n      const overlayHtml = await overlayFrame.evaluate(\n        () => document.body.outerHTML,\n      );\n\n      expect(\n        await prettier.format(pageHtml, {\n          parser: \"html\",\n          plugins: [prettierHTML, prettierCSS],\n        }),\n      ).toMatchSnapshot(\"page html\");\n      expect(\n        await prettier.format(overlayHtml, {\n          parser: \"html\",\n          plugins: [prettierHTML, prettierCSS],\n        }),\n      ).toMatchSnapshot(\"overlay html\");\n    } finally {\n      await browser.close();\n      await server.stop();\n    }\n  });\n\n  it('should show a warning when \"client.overlay.errors\" is \"true\"', async () => {\n    const compiler = webpack(config);\n\n    new WarningPlugin().apply(compiler);\n\n    const devServerOptions = {\n      port,\n      client: {\n        overlay: {\n          errors: true,\n        },\n      },\n    };\n    const server = new Server(devServerOptions, compiler);\n\n    await server.start();\n\n    const { page, browser } = await runBrowser();\n\n    try {\n      await page.goto(`http://localhost:${port}/`, {\n        waitUntil: \"networkidle0\",\n      });\n\n      // Delay for the overlay to appear\n      await delay(1000);\n\n      const pageHtml = await page.evaluate(() => document.body.outerHTML);\n      const overlayHandle = await page.$(\"#webpack-dev-server-client-overlay\");\n      const overlayFrame = await overlayHandle.contentFrame();\n      const overlayHtml = await overlayFrame.evaluate(\n        () => document.body.outerHTML,\n      );\n\n      expect(\n        await prettier.format(pageHtml, {\n          parser: \"html\",\n          plugins: [prettierHTML, prettierCSS],\n        }),\n      ).toMatchSnapshot(\"page html\");\n      expect(\n        await prettier.format(overlayHtml, {\n          parser: \"html\",\n          plugins: [prettierHTML, prettierCSS],\n        }),\n      ).toMatchSnapshot(\"overlay html\");\n    } finally {\n      await browser.close();\n      await server.stop();\n    }\n  });\n\n  it('should not show an error when \"client.overlay\" is \"false\"', async () => {\n    const compiler = webpack(config);\n\n    new ErrorPlugin().apply(compiler);\n\n    const devServerOptions = {\n      port,\n      client: {\n        overlay: false,\n      },\n    };\n    const server = new Server(devServerOptions, compiler);\n\n    await server.start();\n\n    const { page, browser } = await runBrowser();\n\n    try {\n      await page.goto(`http://localhost:${port}/`, {\n        waitUntil: \"networkidle0\",\n      });\n\n      // Delay for the overlay to appear\n      await delay(1000);\n\n      const pageHtml = await page.evaluate(() => document.body.outerHTML);\n      const overlayHandle = await page.$(\"#webpack-dev-server-client-overlay\");\n\n      expect(overlayHandle).toBeNull();\n      expect(\n        await prettier.format(pageHtml, {\n          parser: \"html\",\n          plugins: [prettierHTML, prettierCSS],\n        }),\n      ).toMatchSnapshot(\"page html\");\n    } finally {\n      await browser.close();\n      await server.stop();\n    }\n  });\n\n  it('should not show an error when \"client.overlay.errors\" is \"false\"', async () => {\n    const compiler = webpack(config);\n\n    new ErrorPlugin().apply(compiler);\n\n    const devServerOptions = {\n      port,\n      client: {\n        overlay: {\n          errors: false,\n        },\n      },\n    };\n    const server = new Server(devServerOptions, compiler);\n\n    await server.start();\n\n    const { page, browser } = await runBrowser();\n\n    try {\n      await page.goto(`http://localhost:${port}/`, {\n        waitUntil: \"networkidle0\",\n      });\n\n      // Delay for the overlay to appear\n      await delay(1000);\n\n      const pageHtml = await page.evaluate(() => document.body.outerHTML);\n      const overlayHandle = await page.$(\"#webpack-dev-server-client-overlay\");\n\n      expect(overlayHandle).toBeNull();\n      expect(\n        await prettier.format(pageHtml, {\n          parser: \"html\",\n          plugins: [prettierHTML, prettierCSS],\n        }),\n      ).toMatchSnapshot(\"page html\");\n    } finally {\n      await browser.close();\n      await server.stop();\n    }\n  });\n\n  it(\"should not show error when it is filtered\", async () => {\n    const compiler = webpack(config);\n\n    new ErrorPlugin(\"My special error\").apply(compiler);\n\n    const server = new Server(\n      {\n        port,\n        client: {\n          overlay: {\n            errors: (error) => {\n              // error is string in webpack 4\n              const message = typeof error === \"string\" ? error : error.message;\n\n              return message !== \"My special error\";\n            },\n          },\n        },\n      },\n      compiler,\n    );\n\n    await server.start();\n\n    const { page, browser } = await runBrowser();\n\n    try {\n      await page.goto(`http://localhost:${port}/`, {\n        waitUntil: \"networkidle0\",\n      });\n\n      // Delay for the overlay to appear\n      await delay(1000);\n\n      const overlayHandle = await page.$(\"#webpack-dev-server-client-overlay\");\n\n      expect(overlayHandle).toBeNull();\n    } finally {\n      await browser.close();\n      await server.stop();\n    }\n  });\n\n  it(\"should show error when it is not filtered\", async () => {\n    const compiler = webpack(config);\n\n    new ErrorPlugin(\"Unfiltered error\").apply(compiler);\n\n    const server = new Server(\n      {\n        port,\n        client: {\n          overlay: {\n            errors: () => true,\n          },\n        },\n      },\n      compiler,\n    );\n\n    await server.start();\n\n    const { page, browser } = await runBrowser();\n\n    try {\n      await page.goto(`http://localhost:${port}/`, {\n        waitUntil: \"networkidle0\",\n      });\n\n      // Delay for the overlay to appear\n      await delay(1000);\n\n      const pageHtml = await page.evaluate(() => document.body.outerHTML);\n      const overlayHandle = await page.$(\"#webpack-dev-server-client-overlay\");\n      const overlayFrame = await overlayHandle.contentFrame();\n      const overlayHtml = await overlayFrame.evaluate(\n        () => document.body.outerHTML,\n      );\n\n      expect(\n        await prettier.format(pageHtml, {\n          parser: \"html\",\n          plugins: [prettierHTML, prettierCSS],\n        }),\n      ).toMatchSnapshot(\"page html\");\n      expect(\n        await prettier.format(overlayHtml, {\n          parser: \"html\",\n          plugins: [prettierHTML, prettierCSS],\n        }),\n      ).toMatchSnapshot(\"overlay html\");\n    } finally {\n      await browser.close();\n      await server.stop();\n    }\n  });\n\n  it('should show an error when \"client.overlay\" is \"true\"', async () => {\n    const compiler = webpack(config);\n\n    new ErrorPlugin().apply(compiler);\n\n    const devServerOptions = {\n      port,\n      client: {\n        overlay: true,\n      },\n    };\n    const server = new Server(devServerOptions, compiler);\n\n    await server.start();\n\n    const { page, browser } = await runBrowser();\n\n    try {\n      await page.goto(`http://localhost:${port}/`, {\n        waitUntil: \"networkidle0\",\n      });\n\n      // Delay for the overlay to appear\n      await delay(1000);\n\n      const pageHtml = await page.evaluate(() => document.body.outerHTML);\n      const overlayHandle = await page.$(\"#webpack-dev-server-client-overlay\");\n      const overlayFrame = await overlayHandle.contentFrame();\n      const overlayHtml = await overlayFrame.evaluate(\n        () => document.body.outerHTML,\n      );\n\n      expect(\n        await prettier.format(pageHtml, {\n          parser: \"html\",\n          plugins: [prettierHTML, prettierCSS],\n        }),\n      ).toMatchSnapshot(\"page html\");\n      expect(\n        await prettier.format(overlayHtml, {\n          parser: \"html\",\n          plugins: [prettierHTML, prettierCSS],\n        }),\n      ).toMatchSnapshot(\"overlay html\");\n    } finally {\n      await browser.close();\n      await server.stop();\n    }\n  });\n\n  it(\"should show overlay when Trusted Types are enabled\", async () => {\n    const compiler = webpack(trustedTypesConfig);\n\n    new ErrorPlugin().apply(compiler);\n\n    const devServerOptions = {\n      port,\n      client: {\n        overlay: {\n          trustedTypesPolicyName: \"webpack#dev-overlay\",\n        },\n      },\n    };\n    const server = new Server(devServerOptions, compiler);\n\n    await server.start();\n\n    const { page, browser } = await runBrowser();\n\n    try {\n      const consoleMessages = [];\n\n      page.on(\"console\", (message) => {\n        consoleMessages.push(message.text());\n      });\n\n      await page.goto(`http://localhost:${port}/`, {\n        waitUntil: \"networkidle0\",\n      });\n\n      // Delay for the overlay to appear\n      await delay(1000);\n\n      const pageHtml = await page.evaluate(() => document.body.outerHTML);\n      const overlayHandle = await page.$(\"#webpack-dev-server-client-overlay\");\n      const overlayFrame = await overlayHandle.contentFrame();\n      const overlayHtml = await overlayFrame.evaluate(\n        () => document.body.outerHTML,\n      );\n\n      expect(\n        consoleMessages.filter((item) =>\n          /requires 'TrustedHTML' assignment/.test(item),\n        ),\n      ).toHaveLength(0);\n      expect(\n        await prettier.format(pageHtml, {\n          parser: \"html\",\n          plugins: [prettierHTML, prettierCSS],\n        }),\n      ).toMatchSnapshot(\"page html\");\n      expect(\n        await prettier.format(overlayHtml, {\n          parser: \"html\",\n          plugins: [prettierHTML, prettierCSS],\n        }),\n      ).toMatchSnapshot(\"overlay html\");\n    } finally {\n      await browser.close();\n      await server.stop();\n    }\n  });\n\n  it(\"should show overlay when Trusted Types are enabled and the \\\"require-trusted-types-for 'script'\\\" header was used\", async () => {\n    const compiler = webpack(trustedTypesConfig);\n\n    new ErrorPlugin().apply(compiler);\n\n    const devServerOptions = {\n      port,\n      headers: [\n        {\n          key: \"Content-Security-Policy\",\n          value: \"require-trusted-types-for 'script'\",\n        },\n      ],\n      client: {\n        overlay: {\n          trustedTypesPolicyName: \"webpack#dev-overlay\",\n        },\n      },\n    };\n    const server = new Server(devServerOptions, compiler);\n\n    await server.start();\n\n    const { page, browser } = await runBrowser();\n\n    try {\n      const consoleMessages = [];\n\n      page.on(\"console\", (message) => {\n        consoleMessages.push(message.text());\n      });\n\n      await page.goto(`http://localhost:${port}/`, {\n        waitUntil: \"networkidle0\",\n      });\n\n      // Delay for the overlay to appear\n      await delay(1000);\n\n      const pageHtml = await page.evaluate(() => document.body.outerHTML);\n      const overlayHandle = await page.$(\"#webpack-dev-server-client-overlay\");\n      const overlayFrame = await overlayHandle.contentFrame();\n      const overlayHtml = await overlayFrame.evaluate(\n        () => document.body.outerHTML,\n      );\n\n      await page.goto(`http://localhost:${port}/`, {\n        waitUntil: \"networkidle0\",\n      });\n\n      expect(\n        consoleMessages.filter((item) =>\n          /requires 'TrustedHTML' assignment/.test(item),\n        ),\n      ).toHaveLength(0);\n      expect(\n        await prettier.format(pageHtml, {\n          parser: \"html\",\n          plugins: [prettierHTML, prettierCSS],\n        }),\n      ).toMatchSnapshot(\"page html\");\n      expect(\n        await prettier.format(overlayHtml, {\n          parser: \"html\",\n          plugins: [prettierHTML, prettierCSS],\n        }),\n      ).toMatchSnapshot(\"overlay html\");\n    } finally {\n      await browser.close();\n      await server.stop();\n    }\n  });\n\n  it(\"should not show overlay when Trusted Types are enabled, but policy is not allowed\", async () => {\n    const compiler = webpack(trustedTypesConfig);\n\n    new ErrorPlugin().apply(compiler);\n\n    const devServerOptions = {\n      port,\n      client: {\n        overlay: {\n          trustedTypesPolicyName: \"disallowed-policy\",\n        },\n      },\n    };\n    const server = new Server(devServerOptions, compiler);\n\n    await server.start();\n\n    const { page, browser } = await runBrowser();\n\n    try {\n      await page.goto(`http://localhost:${port}/`, {\n        waitUntil: \"networkidle0\",\n      });\n\n      // Delay for the overlay to appear\n      await delay(1000);\n\n      const pageHtml = await page.evaluate(() => document.body.outerHTML);\n      const overlayHandle = await page.$(\"#webpack-dev-server-client-overlay\");\n      expect(overlayHandle).toBeNull();\n      expect(\n        await prettier.format(pageHtml, {\n          parser: \"html\",\n          plugins: [prettierHTML, prettierCSS],\n        }),\n      ).toMatchSnapshot(\"page html\");\n    } finally {\n      await browser.close();\n      await server.stop();\n    }\n  });\n\n  it('should show an error when \"client.overlay.errors\" is \"true\"', async () => {\n    const compiler = webpack(config);\n\n    new ErrorPlugin().apply(compiler);\n\n    const devServerOptions = {\n      port,\n      client: {\n        overlay: {\n          errors: true,\n        },\n      },\n    };\n    const server = new Server(devServerOptions, compiler);\n\n    await server.start();\n\n    const { page, browser } = await runBrowser();\n\n    try {\n      await page.goto(`http://localhost:${port}/`, {\n        waitUntil: \"networkidle0\",\n      });\n\n      // Delay for the overlay to appear\n      await delay(1000);\n\n      const pageHtml = await page.evaluate(() => document.body.outerHTML);\n      const overlayHandle = await page.$(\"#webpack-dev-server-client-overlay\");\n      const overlayFrame = await overlayHandle.contentFrame();\n      const overlayHtml = await overlayFrame.evaluate(\n        () => document.body.outerHTML,\n      );\n\n      expect(\n        await prettier.format(pageHtml, {\n          parser: \"html\",\n          plugins: [prettierHTML, prettierCSS],\n        }),\n      ).toMatchSnapshot(\"page html\");\n      expect(\n        await prettier.format(overlayHtml, {\n          parser: \"html\",\n          plugins: [prettierHTML, prettierCSS],\n        }),\n      ).toMatchSnapshot(\"overlay html\");\n    } finally {\n      await browser.close();\n      await server.stop();\n    }\n  });\n\n  it('should show an error when \"client.overlay.warnings\" is \"true\"', async () => {\n    const compiler = webpack(config);\n\n    new WarningPlugin().apply(compiler);\n\n    const devServerOptions = {\n      port,\n      client: {\n        overlay: {\n          warnings: true,\n        },\n      },\n    };\n    const server = new Server(devServerOptions, compiler);\n\n    await server.start();\n\n    const { page, browser } = await runBrowser();\n\n    try {\n      await page.goto(`http://localhost:${port}/`, {\n        waitUntil: \"networkidle0\",\n      });\n\n      // Delay for the overlay to appear\n      await delay(1000);\n\n      const pageHtml = await page.evaluate(() => document.body.outerHTML);\n      const overlayHandle = await page.$(\"#webpack-dev-server-client-overlay\");\n      const overlayFrame = await overlayHandle.contentFrame();\n      const overlayHtml = await overlayFrame.evaluate(\n        () => document.body.outerHTML,\n      );\n\n      expect(\n        await prettier.format(pageHtml, {\n          parser: \"html\",\n          plugins: [prettierHTML, prettierCSS],\n        }),\n      ).toMatchSnapshot(\"page html\");\n      expect(\n        await prettier.format(overlayHtml, {\n          parser: \"html\",\n          plugins: [prettierHTML, prettierCSS],\n        }),\n      ).toMatchSnapshot(\"overlay html\");\n    } finally {\n      await browser.close();\n      await server.stop();\n    }\n  });\n\n  it(\"should show a warning and hide them after closing connection\", async () => {\n    const compiler = webpack(config);\n\n    new WarningPlugin().apply(compiler);\n\n    const devServerOptions = { port };\n    const server = new Server(devServerOptions, compiler);\n\n    await server.start();\n\n    const { page, browser } = await runBrowser();\n\n    try {\n      const consoleMessages = [];\n\n      page.on(\"console\", (message) => {\n        consoleMessages.push(message.text());\n      });\n\n      await page.goto(`http://localhost:${port}/`, {\n        waitUntil: \"networkidle0\",\n      });\n\n      // Delay for the overlay to appear\n      await delay(1000);\n\n      const pageHtml = await page.evaluate(() => document.body.outerHTML);\n      const overlayHandle = await page.$(\"#webpack-dev-server-client-overlay\");\n      const overlayFrame = await overlayHandle.contentFrame();\n      const overlayHtml = await overlayFrame.evaluate(\n        () => document.body.outerHTML,\n      );\n\n      expect(\n        await prettier.format(pageHtml, {\n          parser: \"html\",\n          plugins: [prettierHTML, prettierCSS],\n        }),\n      ).toMatchSnapshot(\"page html\");\n      expect(\n        await prettier.format(overlayHtml, {\n          parser: \"html\",\n          plugins: [prettierHTML, prettierCSS],\n        }),\n      ).toMatchSnapshot(\"overlay html\");\n\n      await server.stop();\n\n      await new Promise((resolve) => {\n        const interval = setInterval(() => {\n          if (consoleMessages.includes(\"[webpack-dev-server] Disconnected!\")) {\n            clearInterval(interval);\n\n            resolve();\n          }\n        }, 100);\n      });\n\n      const pageHtmlAfterClose = await page.evaluate(\n        () => document.body.outerHTML,\n      );\n\n      expect(\n        await prettier.format(pageHtmlAfterClose, {\n          parser: \"html\",\n          plugins: [prettierHTML, prettierCSS],\n        }),\n      ).toMatchSnapshot(\"page html\");\n    } finally {\n      await browser.close();\n    }\n  });\n\n  it(\"should show an error after invalidation\", async () => {\n    const compiler = webpack(config);\n\n    new ErrorPlugin(\"Error from compilation\", 1).apply(compiler);\n\n    const devServerOptions = {\n      port,\n    };\n    const server = new Server(devServerOptions, compiler);\n\n    await server.start();\n\n    const { page, browser } = await runBrowser();\n\n    try {\n      await page.goto(`http://localhost:${port}/`, {\n        waitUntil: \"networkidle0\",\n      });\n\n      await new Promise((resolve) => {\n        server.middleware.invalidate(() => {\n          resolve();\n        });\n      });\n\n      await new Promise((resolve) => {\n        server.middleware.waitUntilValid(() => {\n          resolve();\n        });\n      });\n\n      // Delay for the overlay to appear\n      await delay(1000);\n\n      await page.waitForSelector(\"#webpack-dev-server-client-overlay\");\n\n      const pageHtml = await page.evaluate(() => document.body.outerHTML);\n      const overlayHandle = await page.$(\"#webpack-dev-server-client-overlay\");\n      const overlayFrame = await overlayHandle.contentFrame();\n      const overlayHtml = await overlayFrame.evaluate(\n        () => document.body.outerHTML,\n      );\n\n      expect(\n        await prettier.format(pageHtml, {\n          parser: \"html\",\n          plugins: [prettierHTML, prettierCSS],\n        }),\n      ).toMatchSnapshot(\"page html\");\n      expect(\n        await prettier.format(overlayHtml, {\n          parser: \"html\",\n          plugins: [prettierHTML, prettierCSS],\n        }),\n      ).toMatchSnapshot(\"overlay html\");\n    } finally {\n      await browser.close();\n      await server.stop();\n    }\n  });\n\n  it(\"should show a warning after invalidation\", async () => {\n    const compiler = webpack(config);\n\n    new WarningPlugin(\"Warning from compilation\", 1).apply(compiler);\n\n    const devServerOptions = {\n      port,\n    };\n    const server = new Server(devServerOptions, compiler);\n\n    await server.start();\n\n    const { page, browser } = await runBrowser();\n\n    try {\n      await page.goto(`http://localhost:${port}/`, {\n        waitUntil: \"networkidle0\",\n      });\n\n      await new Promise((resolve) => {\n        server.middleware.invalidate(() => {\n          resolve();\n        });\n      });\n\n      await new Promise((resolve) => {\n        server.middleware.waitUntilValid(() => {\n          resolve();\n        });\n      });\n\n      // Delay for the overlay to appear\n      await delay(1000);\n\n      await page.waitForSelector(\"#webpack-dev-server-client-overlay\");\n\n      const pageHtml = await page.evaluate(() => document.body.outerHTML);\n      const overlayHandle = await page.$(\"#webpack-dev-server-client-overlay\");\n      const overlayFrame = await overlayHandle.contentFrame();\n      const overlayHtml = await overlayFrame.evaluate(\n        () => document.body.outerHTML,\n      );\n\n      expect(\n        await prettier.format(pageHtml, {\n          parser: \"html\",\n          plugins: [prettierHTML, prettierCSS],\n        }),\n      ).toMatchSnapshot(\"page html\");\n      expect(\n        await prettier.format(overlayHtml, {\n          parser: \"html\",\n          plugins: [prettierHTML, prettierCSS],\n        }),\n      ).toMatchSnapshot(\"overlay html\");\n    } finally {\n      await browser.close();\n      await server.stop();\n    }\n  });\n\n  it(\"should show error for uncaught runtime error\", async () => {\n    const compiler = webpack(config);\n\n    const server = new Server(\n      {\n        port,\n      },\n      compiler,\n    );\n\n    await server.start();\n\n    const { page, browser } = await runBrowser();\n\n    try {\n      await page.goto(`http://localhost:${port}/`, {\n        waitUntil: \"networkidle0\",\n      });\n\n      await page.addScriptTag({\n        content: `(function throwError() {\n        throw new Error('Injected error');\n      })();`,\n      });\n\n      // Delay for the overlay to appear\n      await delay(1000);\n\n      const overlayHandle = await page.$(\"#webpack-dev-server-client-overlay\");\n      const overlayFrame = await overlayHandle.contentFrame();\n      const overlayHtml = await overlayFrame.evaluate(\n        () => document.body.outerHTML,\n      );\n\n      expect(\n        await prettier.format(overlayHtml, {\n          parser: \"html\",\n          plugins: [prettierHTML, prettierCSS],\n        }),\n      ).toMatchSnapshot(\"overlay html\");\n    } finally {\n      await browser.close();\n      await server.stop();\n    }\n  });\n\n  it(\"should not show filtered runtime error\", async () => {\n    const compiler = webpack(config);\n\n    const server = new Server(\n      {\n        port,\n        client: {\n          overlay: {\n            runtimeErrors: (error) => error && !/Injected/.test(error.message),\n          },\n        },\n      },\n      compiler,\n    );\n\n    await server.start();\n\n    const { page, browser } = await runBrowser();\n\n    try {\n      await page.goto(`http://localhost:${port}/`, {\n        waitUntil: \"networkidle0\",\n      });\n\n      await page.addScriptTag({\n        content: `(function throwError() {\n        throw new Error('Injected error');\n      })();`,\n      });\n\n      // Delay for the overlay to appear\n      await delay(1000);\n\n      const overlayHandle = await page.$(\"#webpack-dev-server-client-overlay\");\n\n      expect(overlayHandle).toBeNull();\n    } finally {\n      await browser.close();\n      await server.stop();\n    }\n  });\n\n  it(\"should show error for uncaught promise rejection\", async () => {\n    const compiler = webpack(config);\n\n    const server = new Server(\n      {\n        port,\n      },\n      compiler,\n    );\n\n    await server.start();\n\n    const { page, browser } = await runBrowser();\n\n    try {\n      await page.goto(`http://localhost:${port}/`, {\n        waitUntil: \"networkidle0\",\n      });\n\n      await page.addScriptTag({\n        content: `(function throwError() {\n        setTimeout(function () {\n          Promise.reject(new Error('Async error'));\n        }, 0);\n      })();`,\n      });\n\n      // Delay for the overlay to appear\n      await delay(1000);\n\n      const overlayHandle = await page.$(\"#webpack-dev-server-client-overlay\");\n      const overlayFrame = await overlayHandle.contentFrame();\n      const overlayHtml = await overlayFrame.evaluate(\n        () => document.body.outerHTML,\n      );\n\n      expect(\n        await prettier.format(overlayHtml, {\n          parser: \"html\",\n          plugins: [prettierHTML, prettierCSS],\n        }),\n      ).toMatchSnapshot(\"overlay html\");\n    } finally {\n      await browser.close();\n      await server.stop();\n    }\n  });\n\n  it(\"should not show filtered promise rejection\", async () => {\n    const compiler = webpack(config);\n\n    const server = new Server(\n      {\n        port,\n        client: {\n          overlay: {\n            runtimeErrors: (error) => !/Injected/.test(error.message),\n          },\n        },\n      },\n      compiler,\n    );\n\n    await server.start();\n\n    const { page, browser } = await runBrowser();\n\n    try {\n      await page.goto(`http://localhost:${port}/`, {\n        waitUntil: \"networkidle0\",\n      });\n\n      await page.addScriptTag({\n        content: `(function throwError() {\n        setTimeout(function () {\n          Promise.reject(new Error('Injected async error'));\n        }, 0);\n      })();`,\n      });\n\n      // Delay for the overlay to appear\n      await delay(1000);\n\n      const overlayHandle = await page.$(\"#webpack-dev-server-client-overlay\");\n\n      expect(overlayHandle).toBeNull();\n    } finally {\n      await browser.close();\n      await server.stop();\n    }\n  });\n\n  it(\"should not show filtered promise rejection with specific error cause\", async () => {\n    const compiler = webpack(config);\n\n    const server = new Server(\n      {\n        port,\n        client: {\n          overlay: {\n            runtimeErrors: (error) =>\n              !/Injected/.test(error.cause.error.message),\n          },\n        },\n      },\n      compiler,\n    );\n\n    await server.start();\n\n    const { page, browser } = await runBrowser();\n\n    try {\n      await page.goto(`http://localhost:${port}/`, {\n        waitUntil: \"networkidle0\",\n      });\n\n      await page.addScriptTag({\n        content: `(function throwError() {\n        setTimeout(function () {\n          Promise.reject({ error: new Error('Injected async error') });\n        }, 0);\n      })();`,\n      });\n\n      // Delay for the overlay to appear\n      await delay(1000);\n\n      const overlayHandle = await page.$(\"#webpack-dev-server-client-overlay\");\n\n      expect(overlayHandle).toBeNull();\n    } finally {\n      await browser.close();\n      await server.stop();\n    }\n  });\n\n  it('should show overlay when \"Content-Security-Policy\" is \"default-src \\'self\\'\" was used', async () => {\n    const compiler = webpack({ ...config, devtool: false });\n\n    new ErrorPlugin().apply(compiler);\n\n    const devServerOptions = {\n      port,\n      headers: [\n        {\n          key: \"Content-Security-Policy\",\n          value: \"default-src 'self'\",\n        },\n      ],\n    };\n    const server = new Server(devServerOptions, compiler);\n\n    await server.start();\n\n    const { page, browser } = await runBrowser();\n\n    try {\n      const consoleMessages = [];\n\n      page.on(\"console\", (message) => {\n        consoleMessages.push(message.text());\n      });\n\n      await page.goto(`http://localhost:${port}/`, {\n        waitUntil: \"networkidle0\",\n      });\n\n      // Delay for the overlay to appear\n      await delay(1000);\n\n      const pageHtml = await page.evaluate(() => document.body.outerHTML);\n      const overlayHandle = await page.$(\"#webpack-dev-server-client-overlay\");\n      const overlayFrame = await overlayHandle.contentFrame();\n      const overlayHtml = await overlayFrame.evaluate(\n        () => document.body.outerHTML,\n      );\n\n      expect(\n        await prettier.format(pageHtml, {\n          parser: \"html\",\n          plugins: [prettierHTML, prettierCSS],\n        }),\n      ).toMatchSnapshot(\"page html\");\n      expect(\n        await prettier.format(\n          overlayHtml.replace(\n            /<button ([^>]+)>.+<\\/button>/m,\n            \"<button $1>X</button>\",\n          ),\n          {\n            parser: \"html\",\n            plugins: [prettierHTML, prettierCSS],\n          },\n        ),\n      ).toMatchSnapshot(\"overlay html\");\n    } finally {\n      await browser.close();\n      await server.stop();\n    }\n  });\n});\n"
  },
  {
    "path": "test/e2e/port.test.js",
    "content": "\"use strict\";\n\nconst webpack = require(\"webpack\");\nconst Server = require(\"../../lib/Server\");\nconst config = require(\"../fixtures/client-config/webpack.config\");\nconst runBrowser = require(\"../helpers/run-browser\");\nconst { port } = require(\"../ports-map\");\n\ndescribe(\"port\", () => {\n  const ports = [\n    \"<not-specified>\",\n\n    undefined,\n    \"auto\",\n    port,\n    `${port}`,\n    0,\n    \"-1\",\n    \"99999\",\n  ];\n\n  for (const testedPort of ports) {\n    it(`should work using \"${testedPort}\" port `, async () => {\n      const compiler = webpack(config);\n      const devServerOptions = {};\n\n      let usedPort;\n\n      if (\n        testedPort === \"<not-specified>\" ||\n        typeof testedPort === \"undefined\"\n      ) {\n        process.env.WEBPACK_DEV_SERVER_BASE_PORT = port;\n        usedPort = port;\n      } else if (testedPort === \"auto\") {\n        process.env.WEBPACK_DEV_SERVER_BASE_PORT = port;\n        devServerOptions.port = testedPort;\n        usedPort = port;\n      } else {\n        devServerOptions.port = testedPort;\n        usedPort = testedPort;\n      }\n\n      const server = new Server(devServerOptions, compiler);\n\n      let errored;\n\n      try {\n        await server.start();\n      } catch (error) {\n        errored = error;\n      }\n\n      if (testedPort === \"-1\" || testedPort === \"99999\") {\n        const errorMessageRegExp = /options.port should be >= 0 and < 65536/;\n\n        try {\n          expect(errored.message).toMatch(errorMessageRegExp);\n        } finally {\n          await server.stop();\n        }\n\n        return;\n      }\n\n      const address = server.server.address();\n\n      if (testedPort === 0) {\n        expect(typeof address.port).toBe(\"number\");\n      } else {\n        expect(address.port).toBe(Number(usedPort));\n      }\n\n      const { page, browser } = await runBrowser();\n\n      try {\n        const pageErrors = [];\n        const consoleMessages = [];\n\n        page\n          .on(\"console\", (message) => {\n            consoleMessages.push(message);\n          })\n          .on(\"pageerror\", (error) => {\n            pageErrors.push(error);\n          });\n\n        await page.goto(`http://localhost:${address.port}/`, {\n          waitUntil: \"networkidle0\",\n        });\n\n        expect(\n          consoleMessages.map((message) => message.text()),\n        ).toMatchSnapshot(\"console messages\");\n        expect(pageErrors).toMatchSnapshot(\"page errors\");\n      } finally {\n        await browser.close();\n        await server.stop();\n      }\n\n      if (\n        testedPort === \"<not-specified>\" ||\n        typeof testedPort === \"undefined\"\n      ) {\n        delete process.env.WEBPACK_DEV_SERVER_BASE_PORT;\n      }\n    });\n  }\n});\n"
  },
  {
    "path": "test/e2e/progress.test.js",
    "content": "\"use strict\";\n\nconst path = require(\"node:path\");\nconst fs = require(\"graceful-fs\");\nconst webpack = require(\"webpack\");\nconst Server = require(\"../../lib/Server\");\nconst reloadConfig = require(\"../fixtures/reload-config-2/webpack.config\");\nconst runBrowser = require(\"../helpers/run-browser\");\nconst port = require(\"../ports-map\").progress;\n\nconst cssFilePath = path.resolve(\n  __dirname,\n  \"../fixtures/reload-config-2/main.css\",\n);\n\ndescribe(\"progress\", () => {\n  it(\"should work and log progress in a browser console\", async () => {\n    fs.writeFileSync(cssFilePath, \"body { background-color: rgb(0, 0, 255); }\");\n\n    const compiler = webpack(reloadConfig);\n    const devServerOptions = {\n      port,\n      client: {\n        progress: true,\n      },\n    };\n    const server = new Server(devServerOptions, compiler);\n\n    await server.start();\n\n    try {\n      const { page, browser } = await runBrowser();\n\n      const consoleMessages = [];\n\n      try {\n        let doHotUpdate = false;\n\n        page\n          .on(\"console\", (message) => {\n            consoleMessages.push(message);\n          })\n          .on(\"request\", (interceptedRequest) => {\n            if (interceptedRequest.isInterceptResolutionHandled()) return;\n\n            if (/\\.hot-update\\.(json|js)$/.test(interceptedRequest.url())) {\n              doHotUpdate = true;\n            }\n          });\n\n        await page.goto(`http://localhost:${port}/`, {\n          waitUntil: \"networkidle0\",\n        });\n\n        fs.writeFileSync(\n          cssFilePath,\n          \"body { background-color: rgb(255, 0, 0); }\",\n        );\n\n        await new Promise((resolve) => {\n          const timer = setInterval(() => {\n            if (doHotUpdate) {\n              clearInterval(timer);\n\n              resolve();\n            }\n          }, 100);\n        });\n      } finally {\n        await browser.close();\n      }\n\n      const progressConsoleMessage = consoleMessages.filter((message) =>\n        /^\\[webpack-dev-server\\] (\\[[a-zA-Z]+\\] )?[0-9]{1,3}% - /.test(\n          message.text(),\n        ),\n      );\n\n      expect(progressConsoleMessage.length).toBeGreaterThan(0);\n    } finally {\n      fs.unlinkSync(cssFilePath);\n\n      await server.stop();\n    }\n  });\n});\n"
  },
  {
    "path": "test/e2e/range-header.test.js",
    "content": "\"use strict\";\n\nconst request = require(\"supertest\");\nconst webpack = require(\"webpack\");\nconst Server = require(\"../../lib/Server\");\nconst config = require(\"../fixtures/static-config/webpack.config\");\nconst port = require(\"../ports-map\")[\"range-header\"];\n\ndescribe(\"'Range' header\", () => {\n  let compiler;\n  let server;\n\n  beforeAll(async () => {\n    compiler = webpack(config);\n\n    server = new Server({ port }, compiler);\n\n    await server.start();\n  });\n\n  afterAll(async () => {\n    await server.stop();\n  });\n\n  it('should work with \"Range\" header using \"GET\" method', async () => {\n    const response = await request(server.app).get(\"/main.js\");\n\n    expect(response.status).toBe(200);\n    expect(response.headers[\"content-type\"]).toBe(\n      \"text/javascript; charset=utf-8\",\n    );\n    expect(response.headers[\"accept-ranges\"]).toBe(\"bytes\");\n\n    const responseContent = response.text;\n    const responseRange = await request(server.app)\n      .get(\"/main.js\")\n      .set(\"Range\", \"bytes=0-499\");\n\n    expect(responseRange.status).toBe(206);\n    expect(responseRange.headers[\"content-type\"]).toBe(\n      \"text/javascript; charset=utf-8\",\n    );\n    expect(responseRange.headers[\"content-length\"]).toBe(\"500\");\n    expect(responseRange.headers[\"content-range\"]).toMatch(/^bytes 0-499\\//);\n    expect(responseRange.text).toBe(responseContent.slice(0, 500));\n    expect(responseRange.text).toHaveLength(500);\n  });\n\n  it('should work with \"Range\" header using \"HEAD\" method', async () => {\n    const response = await request(server.app).head(\"/main.js\");\n\n    expect(response.status).toBe(200);\n    expect(response.headers[\"content-type\"]).toBe(\n      \"text/javascript; charset=utf-8\",\n    );\n    expect(response.headers[\"accept-ranges\"]).toBe(\"bytes\");\n\n    const responseRange = await request(server.app)\n      .head(\"/main.js\")\n      .set(\"Range\", \"bytes=0-499\");\n\n    expect(responseRange.status).toBe(206);\n    expect(responseRange.headers[\"content-type\"]).toBe(\n      \"text/javascript; charset=utf-8\",\n    );\n    expect(responseRange.headers[\"content-length\"]).toBe(\"500\");\n    expect(responseRange.headers[\"content-range\"]).toMatch(/^bytes 0-499\\//);\n  });\n\n  it('should work with unsatisfiable \"Range\" header using \"GET\" method', async () => {\n    const response = await request(server.app).get(\"/main.js\");\n\n    expect(response.status).toBe(200);\n    expect(response.headers[\"content-type\"]).toBe(\n      \"text/javascript; charset=utf-8\",\n    );\n    expect(response.headers[\"accept-ranges\"]).toBe(\"bytes\");\n\n    const responseRange = await request(server.app)\n      .get(\"/main.js\")\n      .set(\"Range\", \"bytes=99999999999-\");\n\n    expect(responseRange.status).toBe(416);\n    expect(responseRange.headers[\"content-type\"]).toBe(\n      \"text/html; charset=utf-8\",\n    );\n    expect(responseRange.headers[\"content-range\"]).toMatch(/^bytes \\*\\//);\n  });\n\n  it('should work with malformed \"Range\" header using \"GET\" method', async () => {\n    const response = await request(server.app).get(\"/main.js\");\n\n    expect(response.status).toBe(200);\n    expect(response.headers[\"content-type\"]).toBe(\n      \"text/javascript; charset=utf-8\",\n    );\n    expect(response.headers[\"accept-ranges\"]).toBe(\"bytes\");\n\n    const responseContent = response.text;\n    const responseRange = await request(server.app)\n      .get(\"/main.js\")\n      .set(\"Range\", \"bytes\");\n\n    expect(responseRange.status).toBe(200);\n    expect(responseRange.headers[\"content-type\"]).toBe(\n      \"text/javascript; charset=utf-8\",\n    );\n    expect(responseRange.text).toBe(responseContent);\n    expect(responseRange.text).toHaveLength(responseContent.length);\n  });\n});\n"
  },
  {
    "path": "test/e2e/server-and-client-transport.test.js",
    "content": "\"use strict\";\n\nconst webpack = require(\"webpack\");\nconst Server = require(\"../../lib/Server\");\nconst WebsocketServer = require(\"../../lib/servers/WebsocketServer\");\nconst customConfig = require(\"../fixtures/provide-plugin-custom/webpack.config\");\nconst defaultConfig = require(\"../fixtures/provide-plugin-default/webpack.config\");\nconst sockjsConfig = require(\"../fixtures/provide-plugin-sockjs-config/webpack.config\");\nconst wsConfig = require(\"../fixtures/provide-plugin-ws-config/webpack.config\");\nconst runBrowser = require(\"../helpers/run-browser\");\nconst port = require(\"../ports-map\")[\"server-and-client-transport\"];\n\ndescribe(\"server and client transport\", () => {\n  it('should use default web socket server (\"ws\")', async () => {\n    const compiler = webpack(defaultConfig);\n    const devServerOptions = {\n      port,\n    };\n    const server = new Server(devServerOptions, compiler);\n\n    await server.start();\n\n    const { page, browser } = await runBrowser();\n\n    try {\n      const consoleMessages = [];\n\n      page.on(\"console\", (message) => {\n        consoleMessages.push(message);\n      });\n\n      await page.goto(`http://localhost:${port}/`, {\n        waitUntil: \"networkidle0\",\n      });\n\n      const isCorrectTransport = await page.evaluate(\n        () => globalThis.injectedClient === globalThis.expectedClient,\n      );\n\n      expect(isCorrectTransport).toBe(true);\n      expect(\n        consoleMessages.map((message) => message.text()),\n      ).toMatchSnapshot();\n    } finally {\n      await browser.close();\n      await server.stop();\n    }\n  });\n\n  it('should use \"ws\" web socket server when specify \"ws\" value', async () => {\n    const compiler = webpack(defaultConfig);\n    const devServerOptions = {\n      port,\n      webSocketServer: \"ws\",\n    };\n    const server = new Server(devServerOptions, compiler);\n\n    await server.start();\n\n    const { page, browser } = await runBrowser();\n\n    try {\n      const consoleMessages = [];\n\n      page.on(\"console\", (message) => {\n        consoleMessages.push(message);\n      });\n\n      await page.goto(`http://localhost:${port}/`, {\n        waitUntil: \"networkidle0\",\n      });\n\n      const isCorrectTransport = await page.evaluate(\n        () => globalThis.injectedClient === globalThis.expectedClient,\n      );\n\n      expect(isCorrectTransport).toBe(true);\n      expect(\n        consoleMessages.map((message) => message.text()),\n      ).toMatchSnapshot();\n    } finally {\n      await browser.close();\n      await server.stop();\n    }\n  });\n\n  it('should use \"ws\" web socket server when specify \"ws\" value using object', async () => {\n    const compiler = webpack(defaultConfig);\n    const devServerOptions = {\n      port,\n      webSocketServer: {\n        type: \"ws\",\n      },\n    };\n    const server = new Server(devServerOptions, compiler);\n\n    await server.start();\n\n    const { page, browser } = await runBrowser();\n\n    try {\n      const consoleMessages = [];\n\n      page.on(\"console\", (message) => {\n        consoleMessages.push(message);\n      });\n\n      await page.goto(`http://localhost:${port}/`, {\n        waitUntil: \"networkidle0\",\n      });\n\n      const isCorrectTransport = await page.evaluate(\n        () => globalThis.injectedClient === globalThis.expectedClient,\n      );\n\n      expect(isCorrectTransport).toBe(true);\n      expect(\n        consoleMessages.map((message) => message.text()),\n      ).toMatchSnapshot();\n    } finally {\n      await browser.close();\n      await server.stop();\n    }\n  });\n\n  it('should use \"sockjs\" web socket server when specify \"sockjs\" value', async () => {\n    const compiler = webpack(sockjsConfig);\n    const devServerOptions = {\n      port,\n      webSocketServer: \"sockjs\",\n    };\n    const server = new Server(devServerOptions, compiler);\n\n    await server.start();\n\n    const { page, browser } = await runBrowser();\n\n    try {\n      const consoleMessages = [];\n\n      page.on(\"console\", (message) => {\n        consoleMessages.push(message);\n      });\n\n      await page.goto(`http://localhost:${port}/`, {\n        waitUntil: \"networkidle0\",\n      });\n\n      const isCorrectTransport = await page.evaluate(\n        () => globalThis.injectedClient === globalThis.expectedClient,\n      );\n\n      expect(isCorrectTransport).toBe(true);\n      expect(\n        consoleMessages.map((message) => message.text()),\n      ).toMatchSnapshot();\n    } finally {\n      await browser.close();\n      await server.stop();\n    }\n  });\n\n  it('should use \"sockjs\" web socket server when specify \"sockjs\" value using object', async () => {\n    const compiler = webpack(sockjsConfig);\n    const devServerOptions = {\n      port,\n      webSocketServer: {\n        type: \"sockjs\",\n      },\n    };\n    const server = new Server(devServerOptions, compiler);\n\n    await server.start();\n\n    const { page, browser } = await runBrowser();\n\n    try {\n      const consoleMessages = [];\n\n      page.on(\"console\", (message) => {\n        consoleMessages.push(message);\n      });\n\n      await page.goto(`http://localhost:${port}/`, {\n        waitUntil: \"networkidle0\",\n      });\n\n      const isCorrectTransport = await page.evaluate(\n        () => globalThis.injectedClient === globalThis.expectedClient,\n      );\n\n      expect(isCorrectTransport).toBe(true);\n      expect(\n        consoleMessages.map((message) => message.text()),\n      ).toMatchSnapshot();\n    } finally {\n      await browser.close();\n      await server.stop();\n    }\n  });\n\n  it(\"should use custom web socket server when specify class\", async () => {\n    const compiler = webpack(defaultConfig);\n    const devServerOptions = {\n      port,\n      client: {\n        webSocketTransport: \"ws\",\n      },\n      webSocketServer: WebsocketServer,\n    };\n    const server = new Server(devServerOptions, compiler);\n\n    await server.start();\n\n    const { page, browser } = await runBrowser();\n\n    try {\n      const consoleMessages = [];\n\n      page.on(\"console\", (message) => {\n        consoleMessages.push(message);\n      });\n\n      await page.goto(`http://localhost:${port}/`, {\n        waitUntil: \"networkidle0\",\n      });\n\n      const isCorrectTransport = await page.evaluate(\n        () => globalThis.injectedClient === globalThis.expectedClient,\n      );\n\n      expect(isCorrectTransport).toBe(true);\n      expect(\n        consoleMessages.map((message) => message.text()),\n      ).toMatchSnapshot();\n    } finally {\n      await browser.close();\n      await server.stop();\n    }\n  });\n\n  it(\"should use custom web socket server when specify class using object\", async () => {\n    const compiler = webpack(defaultConfig);\n    const devServerOptions = {\n      port,\n      client: {\n        webSocketTransport: \"ws\",\n      },\n      webSocketServer: {\n        type: WebsocketServer,\n      },\n    };\n    const server = new Server(devServerOptions, compiler);\n\n    await server.start();\n\n    const { page, browser } = await runBrowser();\n\n    try {\n      const consoleMessages = [];\n\n      page.on(\"console\", (message) => {\n        consoleMessages.push(message);\n      });\n\n      await page.goto(`http://localhost:${port}/`, {\n        waitUntil: \"networkidle0\",\n      });\n\n      const isCorrectTransport = await page.evaluate(\n        () => globalThis.injectedClient === globalThis.expectedClient,\n      );\n\n      expect(isCorrectTransport).toBe(true);\n      expect(\n        consoleMessages.map((message) => message.text()),\n      ).toMatchSnapshot();\n    } finally {\n      await browser.close();\n      await server.stop();\n    }\n  });\n\n  it(\"should use custom web socket server when specify path to class\", async () => {\n    const compiler = webpack(defaultConfig);\n    const devServerOptions = {\n      port,\n      client: {\n        webSocketTransport: \"ws\",\n      },\n      webSocketServer: require.resolve(\"../../lib/servers/WebsocketServer\"),\n    };\n    const server = new Server(devServerOptions, compiler);\n\n    await server.start();\n\n    const { page, browser } = await runBrowser();\n\n    try {\n      const consoleMessages = [];\n\n      page.on(\"console\", (message) => {\n        consoleMessages.push(message);\n      });\n\n      await page.goto(`http://localhost:${port}/`, {\n        waitUntil: \"networkidle0\",\n      });\n\n      const isCorrectTransport = await page.evaluate(\n        () => globalThis.injectedClient === globalThis.expectedClient,\n      );\n\n      expect(isCorrectTransport).toBe(true);\n      expect(\n        consoleMessages.map((message) => message.text()),\n      ).toMatchSnapshot();\n    } finally {\n      await browser.close();\n      await server.stop();\n    }\n  });\n\n  it(\"should use custom web socket server when specify path to class using object\", async () => {\n    const compiler = webpack(defaultConfig);\n    const devServerOptions = {\n      port,\n      client: {\n        webSocketTransport: \"ws\",\n      },\n      webSocketServer: {\n        type: require.resolve(\"../../lib/servers/WebsocketServer\"),\n      },\n    };\n    const server = new Server(devServerOptions, compiler);\n\n    await server.start();\n\n    const { page, browser } = await runBrowser();\n\n    try {\n      const consoleMessages = [];\n\n      page.on(\"console\", (message) => {\n        consoleMessages.push(message);\n      });\n\n      await page.goto(`http://localhost:${port}/`, {\n        waitUntil: \"networkidle0\",\n      });\n\n      const isCorrectTransport = await page.evaluate(\n        () => globalThis.injectedClient === globalThis.expectedClient,\n      );\n\n      expect(isCorrectTransport).toBe(true);\n      expect(\n        consoleMessages.map((message) => message.text()),\n      ).toMatchSnapshot();\n    } finally {\n      await browser.close();\n      await server.stop();\n    }\n  });\n\n  it(\"should throw an error on wrong path\", async () => {\n    expect.assertions(1);\n\n    const compiler = webpack(defaultConfig);\n    const devServerOptions = {\n      port,\n      webSocketServer: {\n        type: \"/bad/path/to/implementation\",\n      },\n    };\n    const server = new Server(devServerOptions, compiler);\n\n    try {\n      await server.start();\n    } catch (error) {\n      expect(error.message).toMatchSnapshot();\n    } finally {\n      await server.stop();\n    }\n  });\n\n  it('should use \"sockjs\" transport, when web socket server is not specify', async () => {\n    const compiler = webpack(sockjsConfig);\n    const devServerOptions = {\n      port,\n      client: {\n        webSocketTransport: \"sockjs\",\n      },\n    };\n    const server = new Server(devServerOptions, compiler);\n\n    await server.start();\n\n    const { page, browser } = await runBrowser();\n\n    try {\n      const consoleMessages = [];\n\n      page.on(\"console\", (message) => {\n        consoleMessages.push(message);\n      });\n\n      await page.goto(`http://localhost:${port}/main.js`, {\n        waitUntil: \"networkidle0\",\n      });\n\n      const isCorrectTransport = await page.evaluate(\n        () => globalThis.injectedClient === globalThis.expectedClient,\n      );\n\n      expect(isCorrectTransport).toBe(true);\n      expect(\n        consoleMessages.map((message) => message.text()),\n      ).toMatchSnapshot();\n    } finally {\n      await browser.close();\n      await server.stop();\n    }\n  });\n\n  it('should use \"ws\" transport, when web socket server is not specify', async () => {\n    const compiler = webpack(wsConfig);\n    const devServerOptions = {\n      port,\n      client: {\n        webSocketTransport: \"ws\",\n      },\n    };\n    const server = new Server(devServerOptions, compiler);\n\n    await server.start();\n\n    const { page, browser } = await runBrowser();\n\n    try {\n      const consoleMessages = [];\n\n      page.on(\"console\", (message) => {\n        consoleMessages.push(message);\n      });\n\n      await page.goto(`http://localhost:${port}/`, {\n        waitUntil: \"networkidle0\",\n      });\n\n      const isCorrectTransport = await page.evaluate(\n        () => globalThis.injectedClient === globalThis.expectedClient,\n      );\n\n      expect(isCorrectTransport).toBe(true);\n      expect(\n        consoleMessages.map((message) => message.text()),\n      ).toMatchSnapshot();\n    } finally {\n      await browser.close();\n      await server.stop();\n    }\n  });\n\n  it('should use \"sockjs\" transport and \"sockjs\" web socket server', async () => {\n    const compiler = webpack(sockjsConfig);\n    const devServerOptions = {\n      port,\n      client: {\n        webSocketTransport: \"sockjs\",\n      },\n      webSocketServer: \"sockjs\",\n    };\n    const server = new Server(devServerOptions, compiler);\n\n    await server.start();\n\n    const { page, browser } = await runBrowser();\n\n    try {\n      const consoleMessages = [];\n\n      page.on(\"console\", (message) => {\n        consoleMessages.push(message);\n      });\n\n      await page.goto(`http://localhost:${port}/`, {\n        waitUntil: \"networkidle0\",\n      });\n\n      const isCorrectTransport = await page.evaluate(\n        () => globalThis.injectedClient === globalThis.expectedClient,\n      );\n\n      expect(isCorrectTransport).toBe(true);\n      expect(\n        consoleMessages.map((message) => message.text()),\n      ).toMatchSnapshot();\n    } finally {\n      await browser.close();\n      await server.stop();\n    }\n  });\n\n  it('should use \"ws\" transport and \"ws\" web socket server', async () => {\n    const compiler = webpack(wsConfig);\n    const devServerOptions = {\n      port,\n      client: {\n        webSocketTransport: \"ws\",\n      },\n      webSocketServer: \"ws\",\n    };\n    const server = new Server(devServerOptions, compiler);\n\n    await server.start();\n\n    const { page, browser } = await runBrowser();\n\n    try {\n      const consoleMessages = [];\n\n      page.on(\"console\", (message) => {\n        consoleMessages.push(message);\n      });\n\n      await page.goto(`http://localhost:${port}/`, {\n        waitUntil: \"networkidle0\",\n      });\n\n      const isCorrectTransport = await page.evaluate(\n        () => globalThis.injectedClient === globalThis.expectedClient,\n      );\n\n      expect(isCorrectTransport).toBe(true);\n      expect(\n        consoleMessages.map((message) => message.text()),\n      ).toMatchSnapshot();\n    } finally {\n      await browser.close();\n      await server.stop();\n    }\n  });\n\n  it('should use custom transport and \"sockjs\" web socket server', async () => {\n    const compiler = webpack(customConfig);\n    const devServerOptions = {\n      port,\n      client: {\n        webSocketTransport: require.resolve(\n          \"../fixtures/custom-client/CustomSockJSClient\",\n        ),\n      },\n      webSocketServer: \"sockjs\",\n    };\n    const server = new Server(devServerOptions, compiler);\n\n    await server.start();\n\n    const { page, browser } = await runBrowser();\n\n    try {\n      const consoleMessages = [];\n\n      page.on(\"console\", (message) => {\n        consoleMessages.push(message);\n      });\n\n      await page.goto(`http://localhost:${port}/`, {\n        waitUntil: \"networkidle0\",\n      });\n\n      const isCorrectTransport = await page.evaluate(\n        () => globalThis.injectedClient === globalThis.expectedClient,\n      );\n\n      expect(isCorrectTransport).toBe(true);\n      expect(\n        consoleMessages.map((message) => message.text()),\n      ).toMatchSnapshot();\n    } finally {\n      await browser.close();\n      await server.stop();\n    }\n  });\n\n  it(\"should throw an error on invalid path to server transport\", async () => {\n    const compiler = webpack(defaultConfig);\n    const devServerOptions = {\n      port,\n      webSocketServer: {\n        type: \"invalid/path\",\n      },\n    };\n    const server = new Server(devServerOptions, compiler);\n    await expect(async () => {\n      await server.start();\n    }).rejects.toThrowErrorMatchingSnapshot();\n\n    await server.stop();\n  });\n\n  it(\"should throw an error on invalid path to client transport\", async () => {\n    const compiler = webpack(defaultConfig);\n    const devServerOptions = {\n      port,\n      client: {\n        webSocketTransport: \"invalid/path\",\n      },\n    };\n    const server = new Server(devServerOptions, compiler);\n    await expect(async () => {\n      await server.start();\n    }).rejects.toThrowErrorMatchingSnapshot();\n\n    await server.stop();\n  });\n});\n"
  },
  {
    "path": "test/e2e/server.test.js",
    "content": "\"use strict\";\n\nconst https = require(\"node:https\");\nconst path = require(\"node:path\");\nconst fs = require(\"graceful-fs\");\nconst request = require(\"supertest\");\nconst webpack = require(\"webpack\");\nconst Server = require(\"../../lib/Server\");\nconst config = require(\"../fixtures/static-config/webpack.config\");\nconst { skipTestOnWindows } = require(\"../helpers/conditional-test\");\nconst customHTTP = require(\"../helpers/custom-http\");\nconst normalizeOptions = require(\"../helpers/normalize-options\");\nconst runBrowser = require(\"../helpers/run-browser\");\nconst port = require(\"../ports-map\")[\"server-option\"];\n\nconst httpsCertificateDirectory = path.resolve(\n  __dirname,\n  \"../fixtures/https-certificate\",\n);\n\nconst staticDirectory = path.resolve(\n  __dirname,\n  \"../fixtures/static-config/public\",\n);\n\nconst [major] = process.versions.node.split(\".\").map(Number);\n\ndescribe(\"server option\", () => {\n  describe(\"as string\", () => {\n    let compiler;\n    let server;\n    let page;\n    let browser;\n    let pageErrors;\n    let consoleMessages;\n\n    describe(\"http\", () => {\n      beforeEach(async () => {\n        compiler = webpack(config);\n\n        server = new Server(\n          {\n            static: {\n              directory: staticDirectory,\n              watch: false,\n            },\n            server: \"http\",\n            port,\n          },\n          compiler,\n        );\n\n        await server.start();\n\n        ({ page, browser } = await runBrowser());\n\n        pageErrors = [];\n        consoleMessages = [];\n      });\n\n      afterEach(async () => {\n        await browser.close();\n        await server.stop();\n      });\n\n      it(\"should handle GET request to index route (/)\", async () => {\n        page\n          .on(\"console\", (message) => {\n            consoleMessages.push(message);\n          })\n          .on(\"pageerror\", (error) => {\n            pageErrors.push(error);\n          });\n\n        const response = await page.goto(`http://localhost:${port}/`, {\n          waitUntil: \"networkidle0\",\n        });\n\n        const HTTPVersion = await page.evaluate(\n          () => performance.getEntries()[0].nextHopProtocol,\n        );\n\n        expect(HTTPVersion).not.toBe(\"h2\");\n\n        expect(response.status()).toMatchSnapshot(\"response status\");\n\n        expect(await response.text()).toMatchSnapshot(\"response text\");\n\n        expect(\n          consoleMessages.map((message) => message.text()),\n        ).toMatchSnapshot(\"console messages\");\n\n        expect(pageErrors).toMatchSnapshot(\"page errors\");\n      });\n    });\n\n    describe(\"custom-http\", () => {\n      beforeEach(async () => {\n        compiler = webpack(config);\n\n        server = new Server(\n          {\n            static: {\n              directory: staticDirectory,\n              watch: false,\n            },\n            server: path.resolve(__dirname, \"../helpers/custom-http.js\"),\n            port,\n          },\n          compiler,\n        );\n\n        await server.start();\n\n        ({ page, browser } = await runBrowser());\n\n        pageErrors = [];\n        consoleMessages = [];\n      });\n\n      afterEach(async () => {\n        await browser.close();\n        await server.stop();\n      });\n\n      it(\"should handle GET request to index route (/)\", async () => {\n        page\n          .on(\"console\", (message) => {\n            consoleMessages.push(message);\n          })\n          .on(\"pageerror\", (error) => {\n            pageErrors.push(error);\n          });\n\n        const response = await page.goto(`http://localhost:${port}/`, {\n          waitUntil: \"networkidle0\",\n        });\n\n        const HTTPVersion = await page.evaluate(\n          () => performance.getEntries()[0].nextHopProtocol,\n        );\n\n        expect(HTTPVersion).not.toBe(\"h2\");\n\n        expect(response.status()).toMatchSnapshot(\"response status\");\n\n        expect(await response.text()).toMatchSnapshot(\"response text\");\n\n        expect(\n          consoleMessages.map((message) => message.text()),\n        ).toMatchSnapshot(\"console messages\");\n\n        expect(pageErrors).toMatchSnapshot(\"page errors\");\n      });\n    });\n\n    describe(\"https\", () => {\n      beforeEach(async () => {\n        compiler = webpack(config);\n\n        server = new Server(\n          {\n            static: {\n              directory: staticDirectory,\n              watch: false,\n            },\n            server: \"https\",\n            port,\n          },\n          compiler,\n        );\n\n        await server.start();\n\n        ({ page, browser } = await runBrowser());\n\n        pageErrors = [];\n        consoleMessages = [];\n      });\n\n      afterEach(async () => {\n        await browser.close();\n        await server.stop();\n      });\n\n      it(\"should handle GET request to index route (/)\", async () => {\n        page\n          .on(\"console\", (message) => {\n            consoleMessages.push(message);\n          })\n          .on(\"pageerror\", (error) => {\n            pageErrors.push(error);\n          });\n\n        const response = await page.goto(`https://localhost:${port}/`, {\n          waitUntil: \"networkidle0\",\n        });\n\n        const HTTPVersion = await page.evaluate(\n          () => performance.getEntries()[0].nextHopProtocol,\n        );\n\n        expect(HTTPVersion).not.toBe(\"h2\");\n\n        expect(response.status()).toMatchSnapshot(\"response status\");\n\n        expect(await response.text()).toMatchSnapshot(\"response text\");\n\n        expect(\n          consoleMessages.map((message) => message.text()),\n        ).toMatchSnapshot(\"console messages\");\n\n        expect(pageErrors).toMatchSnapshot(\"page errors\");\n      });\n    });\n\n    (major >= 24 ? describe.skip : describe)(\"spdy\", () => {\n      beforeEach(async () => {\n        compiler = webpack(config);\n\n        server = new Server(\n          {\n            static: {\n              directory: staticDirectory,\n              watch: false,\n            },\n            server: \"spdy\",\n            port,\n          },\n          compiler,\n        );\n\n        await server.start();\n\n        ({ page, browser } = await runBrowser());\n\n        pageErrors = [];\n        consoleMessages = [];\n      });\n\n      afterEach(async () => {\n        await browser.close();\n        await server.stop();\n      });\n\n      it(\"should handle GET request to index route (/)\", async () => {\n        page\n          .on(\"console\", (message) => {\n            consoleMessages.push(message);\n          })\n          .on(\"pageerror\", (error) => {\n            pageErrors.push(error);\n          });\n\n        const response = await page.goto(`https://localhost:${port}/`, {\n          waitUntil: \"networkidle0\",\n        });\n\n        const HTTPVersion = await page.evaluate(\n          () => performance.getEntries()[0].nextHopProtocol,\n        );\n\n        expect(HTTPVersion).toBe(\"h2\");\n        expect(response.status()).toBe(200);\n        expect((await response.text()).trim()).toBe(\"Heyo.\");\n        expect(consoleMessages).toHaveLength(0);\n        expect(pageErrors).toHaveLength(0);\n      });\n    });\n  });\n\n  describe(\"as object\", () => {\n    describe(\"ca, pfx, key and cert are buffer\", () => {\n      let compiler;\n      let server;\n      let createServerSpy;\n      let page;\n      let browser;\n      let pageErrors;\n      let consoleMessages;\n\n      beforeEach(async () => {\n        compiler = webpack(config);\n\n        createServerSpy = jest.spyOn(https, \"createServer\");\n\n        server = new Server(\n          {\n            static: {\n              directory: staticDirectory,\n              watch: false,\n            },\n            server: {\n              type: \"https\",\n              options: {\n                ca: fs.readFileSync(\n                  path.join(httpsCertificateDirectory, \"ca.pem\"),\n                ),\n                pfx: fs.readFileSync(\n                  path.join(httpsCertificateDirectory, \"server.pfx\"),\n                ),\n                key: fs.readFileSync(\n                  path.join(httpsCertificateDirectory, \"server.key\"),\n                ),\n                cert: fs.readFileSync(\n                  path.join(httpsCertificateDirectory, \"server.crt\"),\n                ),\n                passphrase: \"webpack-dev-server\",\n              },\n            },\n            port,\n          },\n          compiler,\n        );\n\n        await server.start();\n\n        ({ page, browser } = await runBrowser());\n\n        pageErrors = [];\n        consoleMessages = [];\n      });\n\n      afterEach(async () => {\n        createServerSpy.mockRestore();\n\n        await browser.close();\n        await server.stop();\n      });\n\n      it(\"should handle GET request to index route (/)\", async () => {\n        page\n          .on(\"console\", (message) => {\n            consoleMessages.push(message);\n          })\n          .on(\"pageerror\", (error) => {\n            pageErrors.push(error);\n          });\n\n        const response = await page.goto(`https://localhost:${port}/`, {\n          waitUntil: \"networkidle0\",\n        });\n\n        expect(\n          normalizeOptions(createServerSpy.mock.calls[0][0]),\n        ).toMatchSnapshot(\"https options\");\n        expect(response.status()).toMatchSnapshot(\"response status\");\n        expect(await response.text()).toMatchSnapshot(\"response text\");\n        expect(\n          consoleMessages.map((message) => message.text()),\n        ).toMatchSnapshot(\"console messages\");\n        expect(pageErrors).toMatchSnapshot(\"page errors\");\n      });\n    });\n\n    describe(\"ca, pfx, key and cert are array of buffers\", () => {\n      let compiler;\n      let server;\n      let createServerSpy;\n      let page;\n      let browser;\n      let pageErrors;\n      let consoleMessages;\n\n      beforeEach(async () => {\n        compiler = webpack(config);\n\n        createServerSpy = jest.spyOn(https, \"createServer\");\n\n        server = new Server(\n          {\n            static: {\n              directory: staticDirectory,\n              watch: false,\n            },\n            server: {\n              type: \"https\",\n              options: {\n                ca: [\n                  fs.readFileSync(\n                    path.join(httpsCertificateDirectory, \"ca.pem\"),\n                  ),\n                ],\n                pfx: [\n                  fs.readFileSync(\n                    path.join(httpsCertificateDirectory, \"server.pfx\"),\n                  ),\n                ],\n                key: [\n                  fs.readFileSync(\n                    path.join(httpsCertificateDirectory, \"server.key\"),\n                  ),\n                ],\n                cert: [\n                  fs.readFileSync(\n                    path.join(httpsCertificateDirectory, \"server.crt\"),\n                  ),\n                ],\n                passphrase: \"webpack-dev-server\",\n              },\n            },\n            port,\n          },\n          compiler,\n        );\n\n        await server.start();\n\n        ({ page, browser } = await runBrowser());\n\n        pageErrors = [];\n        consoleMessages = [];\n      });\n\n      afterEach(async () => {\n        createServerSpy.mockRestore();\n\n        await browser.close();\n        await server.stop();\n      });\n\n      it(\"should handle GET request to index route (/)\", async () => {\n        page\n          .on(\"console\", (message) => {\n            consoleMessages.push(message);\n          })\n          .on(\"pageerror\", (error) => {\n            pageErrors.push(error);\n          });\n\n        const response = await page.goto(`https://localhost:${port}/`, {\n          waitUntil: \"networkidle0\",\n        });\n\n        expect(\n          normalizeOptions(createServerSpy.mock.calls[0][0]),\n        ).toMatchSnapshot(\"https options\");\n        expect(response.status()).toMatchSnapshot(\"response status\");\n        expect(await response.text()).toMatchSnapshot(\"response text\");\n        expect(\n          consoleMessages.map((message) => message.text()),\n        ).toMatchSnapshot(\"console messages\");\n        expect(pageErrors).toMatchSnapshot(\"page errors\");\n      });\n    });\n\n    describe(\"ca, pfx, key and cert are strings\", () => {\n      let compiler;\n      let server;\n      let createServerSpy;\n      let page;\n      let browser;\n      let pageErrors;\n      let consoleMessages;\n\n      beforeEach(async () => {\n        compiler = webpack(config);\n\n        createServerSpy = jest.spyOn(https, \"createServer\");\n\n        server = new Server(\n          {\n            static: {\n              directory: staticDirectory,\n              watch: false,\n            },\n            server: {\n              type: \"https\",\n              options: {\n                ca: fs\n                  .readFileSync(path.join(httpsCertificateDirectory, \"ca.pem\"))\n                  .toString(),\n                // TODO\n                // pfx can't be string because it is binary format\n                pfx: fs.readFileSync(\n                  path.join(httpsCertificateDirectory, \"server.pfx\"),\n                ),\n                key: fs\n                  .readFileSync(\n                    path.join(httpsCertificateDirectory, \"server.key\"),\n                  )\n                  .toString(),\n                cert: fs\n                  .readFileSync(\n                    path.join(httpsCertificateDirectory, \"server.crt\"),\n                  )\n                  .toString(),\n                passphrase: \"webpack-dev-server\",\n              },\n            },\n            port,\n          },\n          compiler,\n        );\n\n        await server.start();\n\n        ({ page, browser } = await runBrowser());\n\n        pageErrors = [];\n        consoleMessages = [];\n      });\n\n      afterEach(async () => {\n        createServerSpy.mockRestore();\n\n        await browser.close();\n        await server.stop();\n      });\n\n      it(\"should handle GET request to index route (/)\", async () => {\n        page\n          .on(\"console\", (message) => {\n            consoleMessages.push(message);\n          })\n          .on(\"pageerror\", (error) => {\n            pageErrors.push(error);\n          });\n\n        const response = await page.goto(`https://localhost:${port}/`, {\n          waitUntil: \"networkidle0\",\n        });\n\n        expect(\n          normalizeOptions(createServerSpy.mock.calls[0][0]),\n        ).toMatchSnapshot(\"https options\");\n        expect(response.status()).toMatchSnapshot(\"response status\");\n        expect(await response.text()).toMatchSnapshot(\"response text\");\n        expect(\n          consoleMessages.map((message) => message.text()),\n        ).toMatchSnapshot(\"console messages\");\n        expect(pageErrors).toMatchSnapshot(\"page errors\");\n      });\n    });\n\n    describe(\"ca, pfx, key and cert are array of strings\", () => {\n      let compiler;\n      let server;\n      let createServerSpy;\n      let page;\n      let browser;\n      let pageErrors;\n      let consoleMessages;\n\n      beforeEach(async () => {\n        compiler = webpack(config);\n\n        createServerSpy = jest.spyOn(https, \"createServer\");\n\n        server = new Server(\n          {\n            static: {\n              directory: staticDirectory,\n              watch: false,\n            },\n            server: {\n              type: \"https\",\n              options: {\n                ca: [\n                  fs\n                    .readFileSync(\n                      path.join(httpsCertificateDirectory, \"ca.pem\"),\n                    )\n                    .toString(),\n                ],\n                // pfx can't be string because it is binary format\n                pfx: [\n                  fs.readFileSync(\n                    path.join(httpsCertificateDirectory, \"server.pfx\"),\n                  ),\n                ],\n                key: [\n                  fs\n                    .readFileSync(\n                      path.join(httpsCertificateDirectory, \"server.key\"),\n                    )\n                    .toString(),\n                ],\n                cert: [\n                  fs\n                    .readFileSync(\n                      path.join(httpsCertificateDirectory, \"server.crt\"),\n                    )\n                    .toString(),\n                ],\n                passphrase: \"webpack-dev-server\",\n              },\n            },\n            port,\n          },\n          compiler,\n        );\n\n        await server.start();\n\n        ({ page, browser } = await runBrowser());\n\n        pageErrors = [];\n        consoleMessages = [];\n      });\n\n      afterEach(async () => {\n        createServerSpy.mockRestore();\n\n        await browser.close();\n        await server.stop();\n      });\n\n      it(\"should handle GET request to index route (/)\", async () => {\n        page\n          .on(\"console\", (message) => {\n            consoleMessages.push(message);\n          })\n          .on(\"pageerror\", (error) => {\n            pageErrors.push(error);\n          });\n\n        const response = await page.goto(`https://localhost:${port}/`, {\n          waitUntil: \"networkidle0\",\n        });\n\n        expect(\n          normalizeOptions(createServerSpy.mock.calls[0][0]),\n        ).toMatchSnapshot(\"https options\");\n        expect(response.status()).toMatchSnapshot(\"response status\");\n        expect(await response.text()).toMatchSnapshot(\"response text\");\n        expect(\n          consoleMessages.map((message) => message.text()),\n        ).toMatchSnapshot(\"console messages\");\n        expect(pageErrors).toMatchSnapshot(\"page errors\");\n      });\n    });\n\n    describe(\"ca, pfx, key and cert are paths to files\", () => {\n      let compiler;\n      let server;\n      let createServerSpy;\n      let page;\n      let browser;\n      let pageErrors;\n      let consoleMessages;\n\n      beforeEach(async () => {\n        compiler = webpack(config);\n\n        createServerSpy = jest.spyOn(https, \"createServer\");\n\n        server = new Server(\n          {\n            static: {\n              directory: staticDirectory,\n              watch: false,\n            },\n            server: {\n              type: \"https\",\n              options: {\n                ca: path.join(httpsCertificateDirectory, \"ca.pem\"),\n                pfx: path.join(httpsCertificateDirectory, \"server.pfx\"),\n                key: path.join(httpsCertificateDirectory, \"server.key\"),\n                cert: path.join(httpsCertificateDirectory, \"server.crt\"),\n                passphrase: \"webpack-dev-server\",\n              },\n            },\n            port,\n          },\n          compiler,\n        );\n\n        await server.start();\n\n        ({ page, browser } = await runBrowser());\n\n        pageErrors = [];\n        consoleMessages = [];\n      });\n\n      afterEach(async () => {\n        createServerSpy.mockRestore();\n\n        await browser.close();\n        await server.stop();\n      });\n\n      it(\"should handle GET request to index route (/)\", async () => {\n        page\n          .on(\"console\", (message) => {\n            consoleMessages.push(message);\n          })\n          .on(\"pageerror\", (error) => {\n            pageErrors.push(error);\n          });\n\n        const response = await page.goto(`https://localhost:${port}/`, {\n          waitUntil: \"networkidle0\",\n        });\n\n        expect(\n          normalizeOptions(createServerSpy.mock.calls[0][0]),\n        ).toMatchSnapshot(\"https options\");\n        expect(response.status()).toMatchSnapshot(\"response status\");\n        expect(await response.text()).toMatchSnapshot(\"response text\");\n        expect(\n          consoleMessages.map((message) => message.text()),\n        ).toMatchSnapshot(\"console messages\");\n        expect(pageErrors).toMatchSnapshot(\"page errors\");\n      });\n    });\n\n    describe(\"ca, pfx, key and cert are array of paths to files\", () => {\n      let compiler;\n      let server;\n      let createServerSpy;\n      let page;\n      let browser;\n      let pageErrors;\n      let consoleMessages;\n\n      beforeEach(async () => {\n        compiler = webpack(config);\n\n        createServerSpy = jest.spyOn(https, \"createServer\");\n\n        server = new Server(\n          {\n            static: {\n              directory: staticDirectory,\n              watch: false,\n            },\n            server: {\n              type: \"https\",\n              options: {\n                ca: [path.join(httpsCertificateDirectory, \"ca.pem\")],\n                pfx: [path.join(httpsCertificateDirectory, \"server.pfx\")],\n                key: [path.join(httpsCertificateDirectory, \"server.key\")],\n                cert: [path.join(httpsCertificateDirectory, \"server.crt\")],\n                passphrase: \"webpack-dev-server\",\n              },\n            },\n            port,\n          },\n          compiler,\n        );\n\n        await server.start();\n\n        ({ page, browser } = await runBrowser());\n\n        pageErrors = [];\n        consoleMessages = [];\n      });\n\n      afterEach(async () => {\n        createServerSpy.mockRestore();\n\n        await browser.close();\n        await server.stop();\n      });\n\n      it(\"should handle GET request to index route (/)\", async () => {\n        page\n          .on(\"console\", (message) => {\n            consoleMessages.push(message);\n          })\n          .on(\"pageerror\", (error) => {\n            pageErrors.push(error);\n          });\n\n        const response = await page.goto(`https://localhost:${port}/`, {\n          waitUntil: \"networkidle0\",\n        });\n\n        expect(\n          normalizeOptions(createServerSpy.mock.calls[0][0]),\n        ).toMatchSnapshot(\"https options\");\n        expect(response.status()).toMatchSnapshot(\"response status\");\n        expect(await response.text()).toMatchSnapshot(\"response text\");\n        expect(\n          consoleMessages.map((message) => message.text()),\n        ).toMatchSnapshot(\"console messages\");\n        expect(pageErrors).toMatchSnapshot(\"page errors\");\n      });\n    });\n\n    describe(\"ca, pfx, key and cert are symlinks\", () => {\n      if (skipTestOnWindows(\"Symlinks are not supported on Windows\")) {\n        return;\n      }\n\n      let compiler;\n      let server;\n      let createServerSpy;\n      let page;\n      let browser;\n      let pageErrors;\n      let consoleMessages;\n\n      beforeEach(async () => {\n        compiler = webpack(config);\n\n        createServerSpy = jest.spyOn(https, \"createServer\");\n\n        server = new Server(\n          {\n            static: {\n              directory: staticDirectory,\n              watch: false,\n            },\n            server: {\n              type: \"https\",\n              options: {\n                ca: path.join(httpsCertificateDirectory, \"ca-symlink.pem\"),\n                pfx: path.join(httpsCertificateDirectory, \"server-symlink.pfx\"),\n                key: path.join(httpsCertificateDirectory, \"server-symlink.key\"),\n                cert: path.join(\n                  httpsCertificateDirectory,\n                  \"server-symlink.crt\",\n                ),\n                passphrase: \"webpack-dev-server\",\n              },\n            },\n            port,\n          },\n          compiler,\n        );\n\n        await server.start();\n\n        ({ page, browser } = await runBrowser());\n\n        pageErrors = [];\n        consoleMessages = [];\n      });\n\n      afterEach(async () => {\n        createServerSpy.mockRestore();\n\n        await browser.close();\n        await server.stop();\n      });\n\n      it(\"should handle GET request to index route (/)\", async () => {\n        page\n          .on(\"console\", (message) => {\n            consoleMessages.push(message);\n          })\n          .on(\"pageerror\", (error) => {\n            pageErrors.push(error);\n          });\n\n        const response = await page.goto(`https://localhost:${port}/`, {\n          waitUntil: \"networkidle0\",\n        });\n\n        expect(response.status()).toBe(200);\n        expect(await response.text()).toContain(\"Heyo\");\n        expect(consoleMessages.map((message) => message.text())).toEqual([]);\n        expect(pageErrors).toEqual([]);\n      });\n    });\n\n    describe(\"ca, pfx, key and cert are buffer, key and pfx are objects\", () => {\n      let compiler;\n      let server;\n      let createServerSpy;\n      let page;\n      let browser;\n      let pageErrors;\n      let consoleMessages;\n\n      beforeEach(async () => {\n        compiler = webpack(config);\n\n        createServerSpy = jest.spyOn(https, \"createServer\");\n\n        server = new Server(\n          {\n            static: {\n              directory: staticDirectory,\n              watch: false,\n            },\n            server: {\n              type: \"https\",\n              options: {\n                ca: fs.readFileSync(\n                  path.join(httpsCertificateDirectory, \"ca.pem\"),\n                ),\n                pfx: [\n                  {\n                    buf: fs.readFileSync(\n                      path.join(httpsCertificateDirectory, \"server.pfx\"),\n                    ),\n                  },\n                ],\n                key: [\n                  {\n                    pem: fs.readFileSync(\n                      path.join(httpsCertificateDirectory, \"server.key\"),\n                    ),\n                  },\n                ],\n                cert: fs.readFileSync(\n                  path.join(httpsCertificateDirectory, \"server.crt\"),\n                ),\n                passphrase: \"webpack-dev-server\",\n              },\n            },\n            port,\n          },\n          compiler,\n        );\n\n        await server.start();\n\n        ({ page, browser } = await runBrowser());\n\n        pageErrors = [];\n        consoleMessages = [];\n      });\n\n      afterEach(async () => {\n        createServerSpy.mockRestore();\n\n        await browser.close();\n        await server.stop();\n      });\n\n      it(\"should handle GET request to index route (/)\", async () => {\n        page\n          .on(\"console\", (message) => {\n            consoleMessages.push(message);\n          })\n          .on(\"pageerror\", (error) => {\n            pageErrors.push(error);\n          });\n\n        const response = await page.goto(`https://localhost:${port}/`, {\n          waitUntil: \"networkidle0\",\n        });\n\n        expect(\n          normalizeOptions(createServerSpy.mock.calls[0][0]),\n        ).toMatchSnapshot(\"https options\");\n        expect(response.status()).toMatchSnapshot(\"response status\");\n        expect(await response.text()).toMatchSnapshot(\"response text\");\n        expect(\n          consoleMessages.map((message) => message.text()),\n        ).toMatchSnapshot(\"console messages\");\n        expect(pageErrors).toMatchSnapshot(\"page errors\");\n      });\n    });\n\n    describe(\"ca, pfx, key and cert are strings, key and pfx are objects\", () => {\n      let compiler;\n      let server;\n      let createServerSpy;\n      let page;\n      let browser;\n      let pageErrors;\n      let consoleMessages;\n\n      beforeEach(async () => {\n        compiler = webpack(config);\n\n        createServerSpy = jest.spyOn(https, \"createServer\");\n\n        server = new Server(\n          {\n            static: {\n              directory: staticDirectory,\n              watch: false,\n            },\n            server: {\n              type: \"https\",\n              options: {\n                ca: fs\n                  .readFileSync(path.join(httpsCertificateDirectory, \"ca.pem\"))\n                  .toString(),\n                pfx: [\n                  {\n                    // pfx can't be string because it is binary format\n                    buf: fs.readFileSync(\n                      path.join(httpsCertificateDirectory, \"server.pfx\"),\n                    ),\n                  },\n                ],\n                key: [\n                  {\n                    pem: fs\n                      .readFileSync(\n                        path.join(httpsCertificateDirectory, \"server.key\"),\n                      )\n                      .toString(),\n                  },\n                ],\n                cert: fs\n                  .readFileSync(\n                    path.join(httpsCertificateDirectory, \"server.crt\"),\n                  )\n                  .toString(),\n                passphrase: \"webpack-dev-server\",\n              },\n            },\n            port,\n          },\n          compiler,\n        );\n\n        await server.start();\n\n        ({ page, browser } = await runBrowser());\n\n        pageErrors = [];\n        consoleMessages = [];\n      });\n\n      afterEach(async () => {\n        createServerSpy.mockRestore();\n\n        await browser.close();\n        await server.stop();\n      });\n\n      it(\"should handle GET request to index route (/)\", async () => {\n        page\n          .on(\"console\", (message) => {\n            consoleMessages.push(message);\n          })\n          .on(\"pageerror\", (error) => {\n            pageErrors.push(error);\n          });\n\n        const response = await page.goto(`https://localhost:${port}/`, {\n          waitUntil: \"networkidle0\",\n        });\n\n        expect(\n          normalizeOptions(createServerSpy.mock.calls[0][0]),\n        ).toMatchSnapshot(\"https options\");\n        expect(response.status()).toMatchSnapshot(\"response status\");\n        expect(await response.text()).toMatchSnapshot(\"response text\");\n        expect(\n          consoleMessages.map((message) => message.text()),\n        ).toMatchSnapshot(\"console messages\");\n        expect(pageErrors).toMatchSnapshot(\"page errors\");\n      });\n    });\n\n    describe(\"allow to pass more options\", () => {\n      let compiler;\n      let server;\n      let createServerSpy;\n      let page;\n      let browser;\n      let pageErrors;\n      let consoleMessages;\n\n      beforeEach(async () => {\n        compiler = webpack(config);\n\n        createServerSpy = jest.spyOn(https, \"createServer\");\n\n        server = new Server(\n          {\n            static: {\n              directory: staticDirectory,\n              watch: false,\n            },\n            server: {\n              type: \"https\",\n              options: {\n                minVersion: \"TLSv1.1\",\n                ca: fs.readFileSync(\n                  path.join(httpsCertificateDirectory, \"ca.pem\"),\n                ),\n                pfx: fs.readFileSync(\n                  path.join(httpsCertificateDirectory, \"server.pfx\"),\n                ),\n                key: fs.readFileSync(\n                  path.join(httpsCertificateDirectory, \"server.key\"),\n                ),\n                cert: fs.readFileSync(\n                  path.join(httpsCertificateDirectory, \"server.crt\"),\n                ),\n                passphrase: \"webpack-dev-server\",\n              },\n            },\n            port,\n          },\n          compiler,\n        );\n\n        await server.start();\n\n        ({ page, browser } = await runBrowser());\n\n        pageErrors = [];\n        consoleMessages = [];\n      });\n\n      afterEach(async () => {\n        createServerSpy.mockRestore();\n\n        await browser.close();\n        await server.stop();\n      });\n\n      it(\"should handle GET request to index route (/)\", async () => {\n        page\n          .on(\"console\", (message) => {\n            consoleMessages.push(message);\n          })\n          .on(\"pageerror\", (error) => {\n            pageErrors.push(error);\n          });\n\n        const response = await page.goto(`https://localhost:${port}/`, {\n          waitUntil: \"networkidle0\",\n        });\n\n        expect(\n          normalizeOptions(createServerSpy.mock.calls[0][0]),\n        ).toMatchSnapshot(\"https options\");\n        expect(response.status()).toMatchSnapshot(\"response status\");\n        expect(await response.text()).toMatchSnapshot(\"response text\");\n        expect(\n          consoleMessages.map((message) => message.text()),\n        ).toMatchSnapshot(\"console messages\");\n        expect(pageErrors).toMatchSnapshot(\"page errors\");\n      });\n    });\n\n    // puppeteer having issues accepting SSL here, throwing error net::ERR_BAD_SSL_CLIENT_AUTH_CERT, hence testing with supertest\n    describe('should support the \"requestCert\" option', () => {\n      let compiler;\n      let server;\n      let createServerSpy;\n      let req;\n\n      beforeEach(async () => {\n        compiler = webpack(config);\n\n        createServerSpy = jest.spyOn(https, \"createServer\");\n\n        server = new Server(\n          {\n            static: {\n              directory: staticDirectory,\n              watch: false,\n            },\n            server: {\n              type: \"https\",\n              options: {\n                requestCert: true,\n                pfx: fs.readFileSync(\n                  path.join(httpsCertificateDirectory, \"server.pfx\"),\n                ),\n                key: fs.readFileSync(\n                  path.join(httpsCertificateDirectory, \"server.key\"),\n                ),\n                cert: fs.readFileSync(\n                  path.join(httpsCertificateDirectory, \"server.crt\"),\n                ),\n                passphrase: \"webpack-dev-server\",\n              },\n            },\n            port,\n          },\n          compiler,\n        );\n\n        await server.start();\n\n        req = request(server.app);\n      });\n\n      afterEach(async () => {\n        createServerSpy.mockRestore();\n\n        await server.stop();\n      });\n\n      it(\"should pass options to the 'https.createServer' method\", async () => {\n        expect(\n          normalizeOptions(createServerSpy.mock.calls[0][0]),\n        ).toMatchSnapshot(\"https options\");\n      });\n\n      it(\"should handle GET request to index route (/)\", async () => {\n        const response = await req.get(\"/\");\n\n        expect(response.status).toMatchSnapshot(\"response status\");\n        expect(response.text).toMatchSnapshot(\"response text\");\n      });\n    });\n\n    (major >= 24 ? describe.skip : describe)(\"spdy server with options\", () => {\n      let compiler;\n      let server;\n      let createServerSpy;\n      let page;\n      let browser;\n      let pageErrors;\n      let consoleMessages;\n\n      beforeEach(async () => {\n        compiler = webpack(config);\n\n        createServerSpy = jest.spyOn(require(\"spdy\"), \"createServer\");\n\n        server = new Server(\n          {\n            static: {\n              directory: staticDirectory,\n              watch: false,\n            },\n            server: {\n              type: \"spdy\",\n              options: {\n                requestCert: false,\n                ca: [path.join(httpsCertificateDirectory, \"ca.pem\")],\n                pfx: [path.join(httpsCertificateDirectory, \"server.pfx\")],\n                key: [path.join(httpsCertificateDirectory, \"server.key\")],\n                cert: [path.join(httpsCertificateDirectory, \"server.crt\")],\n                passphrase: \"webpack-dev-server\",\n              },\n            },\n            port,\n          },\n          compiler,\n        );\n\n        await server.start();\n\n        ({ page, browser } = await runBrowser());\n\n        pageErrors = [];\n        consoleMessages = [];\n      });\n\n      afterEach(async () => {\n        createServerSpy.mockRestore();\n\n        await browser.close();\n        await server.stop();\n      });\n\n      it(\"should handle GET request to index route (/)\", async () => {\n        page\n          .on(\"console\", (message) => {\n            consoleMessages.push(message);\n          })\n          .on(\"pageerror\", (error) => {\n            pageErrors.push(error);\n          });\n\n        const response = await page.goto(`https://localhost:${port}/`, {\n          waitUntil: \"networkidle0\",\n        });\n\n        const HTTPVersion = await page.evaluate(\n          () => performance.getEntries()[0].nextHopProtocol,\n        );\n\n        const options = normalizeOptions(createServerSpy.mock.calls[0][0]);\n\n        expect(HTTPVersion).toBe(\"h2\");\n        expect(options.spdy).toEqual({ protocols: [\"h2\", \"http/1.1\"] });\n        expect(response.status()).toBe(200);\n        expect((await response.text()).trim()).toBe(\"Heyo.\");\n        expect(consoleMessages).toHaveLength(0);\n        expect(pageErrors).toHaveLength(0);\n      });\n    });\n\n    describe(\"custom server with options\", () => {\n      let compiler;\n      let server;\n      let createServerSpy;\n      let page;\n      let browser;\n      let pageErrors;\n      let consoleMessages;\n\n      beforeEach(async () => {\n        compiler = webpack(config);\n\n        createServerSpy = jest.spyOn(customHTTP, \"createServer\");\n\n        server = new Server(\n          {\n            static: {\n              directory: staticDirectory,\n              watch: false,\n            },\n            server: {\n              type: path.join(__dirname, \"../helpers/custom-http.js\"),\n              options: {\n                maxHeaderSize: 16384,\n              },\n            },\n            port,\n          },\n          compiler,\n        );\n\n        await server.start();\n\n        ({ page, browser } = await runBrowser());\n\n        pageErrors = [];\n        consoleMessages = [];\n      });\n\n      afterEach(async () => {\n        createServerSpy.mockRestore();\n\n        await browser.close();\n        await server.stop();\n      });\n\n      it(\"should handle GET request to index route (/)\", async () => {\n        page\n          .on(\"console\", (message) => {\n            consoleMessages.push(message);\n          })\n          .on(\"pageerror\", (error) => {\n            pageErrors.push(error);\n          });\n\n        const response = await page.goto(`http://localhost:${port}/`, {\n          waitUntil: \"networkidle0\",\n        });\n\n        const HTTPVersion = await page.evaluate(\n          () => performance.getEntries()[0].nextHopProtocol,\n        );\n\n        expect(HTTPVersion).toBe(\"http/1.1\");\n        expect(\n          normalizeOptions(createServerSpy.mock.calls[0][0]),\n        ).toMatchSnapshot(\"http options\");\n        expect(response.status()).toMatchSnapshot(\"response status\");\n        expect(await response.text()).toMatchSnapshot(\"response text\");\n        expect(\n          consoleMessages.map((message) => message.text()),\n        ).toMatchSnapshot(\"console messages\");\n        expect(pageErrors).toMatchSnapshot(\"page errors\");\n      });\n    });\n  });\n});\n"
  },
  {
    "path": "test/e2e/setup-exit-signals.test.js",
    "content": "\"use strict\";\n\nconst webpack = require(\"webpack\");\nconst Server = require(\"../../lib/Server\");\nconst config = require(\"../fixtures/simple-config/webpack.config\");\nconst runBrowser = require(\"../helpers/run-browser\");\nconst port = require(\"../ports-map\")[\"setup-exit-signals-option\"];\n\ndescribe(\"setupExitSignals option\", () => {\n  describe(\"should handle 'SIGINT' and 'SIGTERM' signals\", () => {\n    let compiler;\n    let server;\n    let page;\n    let browser;\n    let pageErrors;\n    let consoleMessages;\n    let doExit;\n    let exitSpy;\n    let stopCallbackSpy;\n    let stdinResumeSpy;\n    let closeCallbackSpy;\n\n    const signals = [\"SIGINT\", \"SIGTERM\"];\n\n    beforeEach(async () => {\n      compiler = webpack(config);\n\n      server = new Server(\n        {\n          setupExitSignals: true,\n          port,\n        },\n        compiler,\n      );\n\n      await server.start();\n\n      ({ page, browser } = await runBrowser());\n\n      pageErrors = [];\n      consoleMessages = [];\n      doExit = false;\n\n      exitSpy = jest.spyOn(process, \"exit\").mockImplementation(() => {\n        doExit = true;\n      });\n\n      stdinResumeSpy = jest\n        .spyOn(process.stdin, \"resume\")\n        .mockImplementation(() => {});\n\n      stopCallbackSpy = jest.spyOn(server, \"stopCallback\");\n\n      if (server.compiler.close) {\n        closeCallbackSpy = jest.spyOn(server.compiler, \"close\");\n      }\n    });\n\n    afterEach(async () => {\n      exitSpy.mockReset();\n      stdinResumeSpy.mockReset();\n      for (const signal of signals) {\n        process.removeAllListeners(signal);\n      }\n      process.stdin.removeAllListeners(\"end\");\n      await browser.close();\n      await server.stop();\n    });\n\n    it.each(signals)(\"should close and exit on %s\", async (signal) => {\n      page\n        .on(\"console\", (message) => {\n          consoleMessages.push(message);\n        })\n        .on(\"pageerror\", (error) => {\n          pageErrors.push(error);\n        });\n\n      const response = await page.goto(`http://localhost:${port}/`, {\n        waitUntil: \"networkidle0\",\n      });\n\n      expect(response.status()).toMatchSnapshot(\"response status\");\n\n      process.emit(signal);\n\n      await new Promise((resolve) => {\n        const interval = setInterval(() => {\n          if (doExit) {\n            expect(stopCallbackSpy.mock.calls).toHaveLength(1);\n\n            if (server.compiler.close) {\n              expect(closeCallbackSpy.mock.calls).toHaveLength(1);\n            }\n\n            clearInterval(interval);\n\n            resolve();\n          }\n        }, 100);\n      });\n\n      consoleMessages = consoleMessages.filter(\n        (message) =>\n          !(\n            message.text().includes(\"Trying to reconnect...\") ||\n            message.text().includes(\"Disconnected\")\n          ),\n      );\n\n      expect(consoleMessages.map((message) => message.text())).toMatchSnapshot(\n        \"console messages\",\n      );\n\n      expect(pageErrors).toMatchSnapshot(\"page errors\");\n    });\n  });\n});\n"
  },
  {
    "path": "test/e2e/setup-middlewares.test.js",
    "content": "\"use strict\";\n\nconst webpack = require(\"webpack\");\nconst Server = require(\"../../lib/Server\");\nconst config = require(\"../fixtures/client-config/webpack.config\");\nconst runBrowser = require(\"../helpers/run-browser\");\nconst port = require(\"../ports-map\")[\"setup-middlewares-option\"];\n\ndescribe(\"setupMiddlewares option\", () => {\n  let compiler;\n  let server;\n  let page;\n  let browser;\n  let pageErrors;\n  let consoleMessages;\n\n  beforeEach(async () => {\n    compiler = webpack(config);\n    server = new Server(\n      {\n        setupMiddlewares: (middlewares, devServer) => {\n          if (!devServer) {\n            throw new Error(\"webpack-dev-server is not defined\");\n          }\n\n          devServer.app.use(\"/setup-middleware/some/path\", (req, res, next) => {\n            if (req.method === \"GET\") {\n              res.setHeader(\"Content-Type\", \"text/html; charset=utf-8\");\n              res.end(\"setup-middlewares option GET\");\n              return;\n            } else if (req.method === \"POST\") {\n              res.setHeader(\"Content-Type\", \"text/html; charset=utf-8\");\n              res.end(\"setup-middlewares option POST\");\n              return;\n            }\n\n            return next();\n          });\n\n          middlewares.push({\n            name: \"hello-world-test-two\",\n            middleware: (req, res, next) => {\n              if (req.url !== \"/foo/bar/baz\") {\n                next();\n                return;\n              }\n\n              res.setHeader(\"Content-Type\", \"text/html; charset=utf-8\");\n              res.end(\"Hello World without path!\");\n            },\n          });\n          middlewares.push({\n            name: \"hello-world-test-one\",\n            path: \"/foo/bar\",\n            middleware: (req, res) => {\n              res.setHeader(\"Content-Type\", \"text/html; charset=utf-8\");\n              res.end(\"Hello World with path!\");\n            },\n          });\n          middlewares.push((req, res) => {\n            res.setHeader(\"Content-Type\", \"text/html; charset=utf-8\");\n            res.end(\"Hello World as function!\");\n          });\n\n          return middlewares;\n        },\n        port,\n      },\n      compiler,\n    );\n\n    await server.start();\n\n    ({ page, browser } = await runBrowser());\n\n    pageErrors = [];\n    consoleMessages = [];\n  });\n\n  afterEach(async () => {\n    await browser.close();\n    await server.stop();\n  });\n\n  it(\"should handle GET request to /setup-middleware/some/path route\", async () => {\n    page\n      .on(\"console\", (message) => {\n        consoleMessages.push(message);\n      })\n      .on(\"pageerror\", (error) => {\n        pageErrors.push(error);\n      });\n\n    const response = await page.goto(\n      `http://localhost:${port}/setup-middleware/some/path`,\n      {\n        waitUntil: \"networkidle0\",\n      },\n    );\n\n    expect(response.headers()[\"content-type\"]).toMatchSnapshot(\n      \"response headers content-type\",\n    );\n    expect(response.status()).toMatchSnapshot(\"response status\");\n    expect(await response.text()).toMatchSnapshot(\"response text\");\n\n    const response1 = await page.goto(`http://localhost:${port}/foo/bar`, {\n      waitUntil: \"networkidle0\",\n    });\n\n    expect(response1.headers()[\"content-type\"]).toMatchSnapshot(\n      \"response headers content-type\",\n    );\n    expect(response1.status()).toMatchSnapshot(\"response status\");\n    expect(await response1.text()).toMatchSnapshot(\"response text\");\n\n    const response2 = await page.goto(`http://localhost:${port}/foo/bar/baz`, {\n      waitUntil: \"networkidle0\",\n    });\n\n    expect(response2.headers()[\"content-type\"]).toMatchSnapshot(\n      \"response headers content-type\",\n    );\n    expect(response2.status()).toMatchSnapshot(\"response status\");\n    expect(await response2.text()).toMatchSnapshot(\"response text\");\n\n    const response3 = await page.goto(\n      `http://localhost:${port}/setup-middleware/unknown`,\n      {\n        waitUntil: \"networkidle0\",\n      },\n    );\n\n    expect(response3.headers()[\"content-type\"]).toMatchSnapshot(\n      \"response headers content-type\",\n    );\n    expect(response3.status()).toMatchSnapshot(\"response status\");\n    expect(await response3.text()).toMatchSnapshot(\"response text\");\n\n    expect(consoleMessages.map((message) => message.text())).toMatchSnapshot(\n      \"console messages\",\n    );\n    expect(pageErrors).toMatchSnapshot(\"page errors\");\n  });\n\n  it(\"should handle POST request to /setup-middleware/some/path route\", async () => {\n    await page.setRequestInterception(true);\n\n    page\n      .on(\"console\", (message) => {\n        consoleMessages.push(message);\n      })\n      .on(\"pageerror\", (error) => {\n        pageErrors.push(error);\n      })\n      .on(\"request\", (interceptedRequest) => {\n        if (interceptedRequest.isInterceptResolutionHandled()) return;\n\n        interceptedRequest.continue({ method: \"POST\" });\n      });\n\n    const response = await page.goto(\n      `http://localhost:${port}/setup-middleware/some/path`,\n      {\n        waitUntil: \"networkidle0\",\n      },\n    );\n\n    expect(response.headers()[\"content-type\"]).toMatchSnapshot(\n      \"response headers content-type\",\n    );\n    expect(response.status()).toMatchSnapshot(\"response status\");\n    expect(await response.text()).toMatchSnapshot(\"response text\");\n    expect(consoleMessages.map((message) => message.text())).toMatchSnapshot(\n      \"console messages\",\n    );\n    expect(pageErrors).toMatchSnapshot(\"page errors\");\n  });\n});\n"
  },
  {
    "path": "test/e2e/static-directory.test.js",
    "content": "\"use strict\";\n\nconst path = require(\"node:path\");\nconst fs = require(\"graceful-fs\");\nconst webpack = require(\"webpack\");\nconst Server = require(\"../../lib/Server\");\nconst config = require(\"../fixtures/static-config/webpack.config\");\nconst runBrowser = require(\"../helpers/run-browser\");\nconst testServer = require(\"../helpers/test-server\");\nconst port = require(\"../ports-map\")[\"static-directory-option\"];\n\nconst staticDirectory = path.resolve(__dirname, \"../fixtures/static-config\");\nconst publicDirectory = path.resolve(staticDirectory, \"public\");\nconst otherPublicDirectory = path.resolve(staticDirectory, \"other\");\n\ndescribe(\"static.directory option\", () => {\n  describe(\"to directory\", () => {\n    const nestedFile = path.resolve(publicDirectory, \"assets/example.txt\");\n\n    let compiler;\n    let server;\n    let page;\n    let browser;\n    let pageErrors;\n    let consoleMessages;\n\n    beforeEach(async () => {\n      compiler = webpack(config);\n\n      server = new Server(\n        {\n          static: {\n            directory: publicDirectory,\n            watch: true,\n          },\n          port,\n        },\n        compiler,\n      );\n\n      await server.start();\n\n      ({ page, browser } = await runBrowser());\n\n      pageErrors = [];\n      consoleMessages = [];\n    });\n\n    afterEach(async () => {\n      await browser.close();\n      await server.stop();\n      fs.truncateSync(nestedFile);\n    });\n\n    it(\"should handle request to index route\", async () => {\n      page\n        .on(\"console\", (message) => {\n          consoleMessages.push(message);\n        })\n        .on(\"pageerror\", (error) => {\n          pageErrors.push(error);\n        });\n\n      const response = await page.goto(`http://localhost:${port}/`, {\n        waitUntil: \"networkidle0\",\n      });\n\n      expect(response.status()).toMatchSnapshot(\"response status\");\n\n      expect(await response.text()).toMatchSnapshot(\"response text\");\n\n      expect(consoleMessages.map((message) => message.text())).toMatchSnapshot(\n        \"console messages\",\n      );\n\n      expect(pageErrors).toMatchSnapshot(\"page errors\");\n    });\n\n    it(\"should handle request to other file\", async () => {\n      page\n        .on(\"console\", (message) => {\n          consoleMessages.push(message);\n        })\n        .on(\"pageerror\", (error) => {\n          pageErrors.push(error);\n        });\n\n      const response = await page.goto(`http://localhost:${port}/other.html`, {\n        waitUntil: \"networkidle0\",\n      });\n\n      expect(response.status()).toMatchSnapshot(\"response status\");\n\n      expect(await response.text()).toMatchSnapshot(\"response text\");\n\n      expect(consoleMessages.map((message) => message.text())).toMatchSnapshot(\n        \"console messages\",\n      );\n\n      expect(pageErrors).toMatchSnapshot(\"page errors\");\n    });\n\n    it(\"watches folder recursively\", (done) => {\n      // chokidar emitted a change,\n      // meaning it watched the file correctly\n      server.staticWatchers[0].on(\"change\", (filepath) => {\n        expect(typeof filepath).toBe(\"string\");\n        done();\n      });\n\n      // change a file manually\n      setTimeout(() => {\n        fs.writeFileSync(nestedFile, \"Heyo\", \"utf8\");\n      }, 1000);\n    });\n\n    it(\"watches node_modules\", (done) => {\n      const filePath = path.join(publicDirectory, \"node_modules\", \"index.html\");\n\n      fs.writeFileSync(filePath, \"foo\", \"utf8\");\n\n      // chokidar emitted a change,\n      // meaning it watched the file correctly\n      server.staticWatchers[0].on(\"change\", (filepath) => {\n        expect(typeof filepath).toBe(\"string\");\n\n        fs.unlinkSync(filePath);\n\n        done();\n      });\n\n      // change a file manually\n      setTimeout(() => {\n        fs.writeFileSync(filePath, \"bar\", \"utf8\");\n      }, 1000);\n    });\n  });\n\n  describe(\"test listing files in folders without index.html using the option static.serveIndex: false\", () => {\n    let compiler;\n    let server;\n    let page;\n    let browser;\n    let pageErrors;\n    let consoleMessages;\n\n    beforeEach(async () => {\n      compiler = webpack(config);\n\n      server = new Server(\n        {\n          static: {\n            directory: publicDirectory,\n            watch: true,\n            serveIndex: false,\n          },\n          port,\n        },\n        compiler,\n      );\n\n      await server.start();\n\n      ({ page, browser } = await runBrowser());\n\n      pageErrors = [];\n      consoleMessages = [];\n    });\n\n    afterEach(async () => {\n      await browser.close();\n      await server.stop();\n    });\n\n    it(\"should not list the files inside the assets folder (404)\", async () => {\n      page\n        .on(\"console\", (message) => {\n          consoleMessages.push(message);\n        })\n        .on(\"pageerror\", (error) => {\n          pageErrors.push(error);\n        });\n\n      const response = await page.goto(`http://localhost:${port}/assets`, {\n        waitUntil: \"networkidle0\",\n      });\n\n      expect(response.status()).toMatchSnapshot(\"response status\");\n\n      expect(await response.text()).toMatchSnapshot(\"response text\");\n\n      expect(consoleMessages.map((message) => message.text())).toMatchSnapshot(\n        \"console messages\",\n      );\n\n      expect(pageErrors).toMatchSnapshot(\"page errors\");\n    });\n\n    it(\"should show Heyo. because bar has index.html inside it (200)\", async () => {\n      page\n        .on(\"console\", (message) => {\n          consoleMessages.push(message);\n        })\n        .on(\"pageerror\", (error) => {\n          pageErrors.push(error);\n        });\n\n      const response = await page.goto(`http://localhost:${port}/bar`, {\n        waitUntil: \"networkidle0\",\n      });\n\n      expect(response.status()).toMatchSnapshot(\"response status\");\n\n      expect(await response.text()).toMatchSnapshot(\"response text\");\n\n      expect(consoleMessages.map((message) => message.text())).toMatchSnapshot(\n        \"console messages\",\n      );\n\n      expect(pageErrors).toMatchSnapshot(\"page errors\");\n    });\n  });\n\n  describe(\"test listing files in folders without index.html using the option static.serveIndex: true\", () => {\n    let compiler;\n    let server;\n    let page;\n    let browser;\n    let pageErrors;\n    let consoleMessages;\n\n    beforeEach(async () => {\n      compiler = webpack(config);\n\n      server = new Server(\n        {\n          static: {\n            directory: publicDirectory,\n            watch: true,\n            serveIndex: true,\n          },\n          port,\n        },\n        compiler,\n      );\n\n      await server.start();\n\n      ({ page, browser } = await runBrowser());\n\n      pageErrors = [];\n      consoleMessages = [];\n    });\n\n    afterEach(async () => {\n      await browser.close();\n      await server.stop();\n    });\n\n    it(\"should list the files inside the assets folder (200)\", async () => {\n      page\n        .on(\"console\", (message) => {\n          consoleMessages.push(message);\n        })\n        .on(\"pageerror\", (error) => {\n          pageErrors.push(error);\n        });\n\n      const response = await page.goto(`http://localhost:${port}/assets/`, {\n        waitUntil: \"networkidle0\",\n      });\n\n      const text = await response.text();\n\n      expect(response.status()).toMatchSnapshot(\"response status\");\n\n      expect(text).toContain(\"example.txt\");\n      expect(text).toContain(\"other.txt\");\n\n      expect(consoleMessages.map((message) => message.text())).toMatchSnapshot(\n        \"console messages\",\n      );\n\n      expect(pageErrors).toMatchSnapshot(\"page errors\");\n    });\n\n    it(\"should show Heyo. because bar has index.html inside it (200)\", async () => {\n      page\n        .on(\"console\", (message) => {\n          consoleMessages.push(message);\n        })\n        .on(\"pageerror\", (error) => {\n          pageErrors.push(error);\n        });\n\n      const response = await page.goto(`http://localhost:${port}/bar/`, {\n        waitUntil: \"networkidle0\",\n      });\n\n      expect(response.status()).toMatchSnapshot(\"response status\");\n\n      expect(await response.text()).toMatchSnapshot(\"response text\");\n\n      expect(consoleMessages.map((message) => message.text())).toMatchSnapshot(\n        \"console messages\",\n      );\n\n      expect(pageErrors).toMatchSnapshot(\"page errors\");\n    });\n  });\n\n  describe(\"test listing files in folders without index.html using the default static.serveIndex option (true)\", () => {\n    let compiler;\n    let server;\n    let page;\n    let browser;\n    let pageErrors;\n    let consoleMessages;\n\n    beforeEach(async () => {\n      compiler = webpack(config);\n\n      server = new Server(\n        {\n          static: {\n            directory: publicDirectory,\n            watch: true,\n          },\n          port,\n        },\n        compiler,\n      );\n\n      await server.start();\n\n      ({ page, browser } = await runBrowser());\n\n      pageErrors = [];\n      consoleMessages = [];\n    });\n\n    afterEach(async () => {\n      await browser.close();\n      await server.stop();\n    });\n\n    it(\"should list the files inside the assets folder (200)\", async () => {\n      page\n        .on(\"console\", (message) => {\n          consoleMessages.push(message);\n        })\n        .on(\"pageerror\", (error) => {\n          pageErrors.push(error);\n        });\n\n      const response = await page.goto(`http://localhost:${port}/assets`, {\n        waitUntil: \"networkidle0\",\n      });\n\n      const text = await response.text();\n\n      expect(response.status()).toMatchSnapshot(\"response status\");\n\n      expect(text).toContain(\"example.txt\");\n      expect(text).toContain(\"other.txt\");\n\n      expect(consoleMessages.map((message) => message.text())).toMatchSnapshot(\n        \"console messages\",\n      );\n\n      expect(pageErrors).toMatchSnapshot(\"page errors\");\n    });\n\n    it(\"should show Heyo. because bar has index.html inside it (200)\", async () => {\n      page\n        .on(\"console\", (message) => {\n          consoleMessages.push(message);\n        })\n        .on(\"pageerror\", (error) => {\n          pageErrors.push(error);\n        });\n\n      const response = await page.goto(`http://localhost:${port}/bar`, {\n        waitUntil: \"networkidle0\",\n      });\n\n      expect(response.status()).toMatchSnapshot(\"response status\");\n\n      expect(await response.text()).toMatchSnapshot(\"response text\");\n\n      expect(consoleMessages.map((message) => message.text())).toMatchSnapshot(\n        \"console messages\",\n      );\n\n      expect(pageErrors).toMatchSnapshot(\"page errors\");\n    });\n  });\n\n  describe(\"to multiple directories\", () => {\n    let compiler;\n    let server;\n    let page;\n    let browser;\n    let pageErrors;\n    let consoleMessages;\n\n    beforeEach(async () => {\n      compiler = webpack(config);\n\n      server = new Server(\n        {\n          static: [publicDirectory, otherPublicDirectory],\n          port,\n        },\n        compiler,\n      );\n\n      await server.start();\n\n      ({ page, browser } = await runBrowser());\n\n      pageErrors = [];\n      consoleMessages = [];\n    });\n\n    afterEach(async () => {\n      await browser.close();\n      await server.stop();\n    });\n\n    it(\"should handle request first directory\", async () => {\n      page\n        .on(\"console\", (message) => {\n          consoleMessages.push(message);\n        })\n        .on(\"pageerror\", (error) => {\n          pageErrors.push(error);\n        });\n\n      const response = await page.goto(`http://localhost:${port}/`, {\n        waitUntil: \"networkidle0\",\n      });\n\n      expect(response.status()).toMatchSnapshot(\"response status\");\n\n      expect(await response.text()).toMatchSnapshot(\"response text\");\n\n      expect(consoleMessages.map((message) => message.text())).toMatchSnapshot(\n        \"console messages\",\n      );\n\n      expect(pageErrors).toMatchSnapshot(\"page errors\");\n    });\n\n    it(\"should handle request to second directory\", async () => {\n      page\n        .on(\"console\", (message) => {\n          consoleMessages.push(message);\n        })\n        .on(\"pageerror\", (error) => {\n          pageErrors.push(error);\n        });\n\n      const response = await page.goto(`http://localhost:${port}/foo.html`, {\n        waitUntil: \"networkidle0\",\n      });\n\n      expect(response.status()).toMatchSnapshot(\"response status\");\n\n      expect(await response.text()).toMatchSnapshot(\"response text\");\n\n      expect(consoleMessages.map((message) => message.text())).toMatchSnapshot(\n        \"console messages\",\n      );\n\n      expect(pageErrors).toMatchSnapshot(\"page errors\");\n    });\n  });\n\n  describe(\"testing single & multiple external paths\", () => {\n    let server;\n\n    afterEach((done) => {\n      testServer.close(() => {\n        done();\n      });\n    });\n\n    it(\"should throw exception (external url)\", (done) => {\n      expect.assertions(1);\n\n      server = testServer.start(\n        config,\n        {\n          static: \"https://example.com/\",\n        },\n        (error) => {\n          expect(error.message).toBe(\n            \"Using a URL as static.directory is not supported\",\n          );\n\n          server.stopCallback(done);\n        },\n      );\n    });\n\n    it(\"should not throw exception (local path with lower case first character)\", (done) => {\n      testServer.start(\n        config,\n        {\n          static: {\n            directory:\n              publicDirectory.charAt(0).toLowerCase() +\n              publicDirectory.slice(1),\n            watch: true,\n          },\n          port,\n        },\n        (error) => {\n          expect(error).toBeUndefined();\n          done(error);\n        },\n      );\n    });\n\n    it(\"should not throw exception (local path with lower case first character & has '-')\", (done) => {\n      testServer.start(\n        config,\n        {\n          static: {\n            directory: \"c:\\\\absolute\\\\path\\\\to\\\\content-base\",\n            watch: true,\n          },\n          port,\n        },\n        (error) => {\n          expect(error).toBeUndefined();\n          done(error);\n        },\n      );\n    });\n\n    it(\"should not throw exception (local path with upper case first character & has '-')\", (done) => {\n      testServer.start(\n        config,\n        {\n          static: {\n            directory: \"C:\\\\absolute\\\\path\\\\to\\\\content-base\",\n            watch: true,\n          },\n          port,\n        },\n        (error) => {\n          expect(error).toBeUndefined();\n          done(error);\n        },\n      );\n    });\n\n    it(\"should throw exception (array with absolute url)\", (done) => {\n      server = testServer.start(\n        config,\n        {\n          static: [publicDirectory, \"https://example.com/\"],\n        },\n        (error) => {\n          expect(error.message).toBe(\n            \"Using a URL as static.directory is not supported\",\n          );\n\n          server.stopCallback(done);\n        },\n      );\n    });\n  });\n\n  describe(\"defaults to PWD\", () => {\n    let compiler;\n    let server;\n    let page;\n    let browser;\n    let pageErrors;\n    let consoleMessages;\n\n    beforeEach(async () => {\n      jest\n        .spyOn(process, \"cwd\")\n        .mockImplementation(() => path.resolve(staticDirectory));\n      compiler = webpack(config);\n\n      server = new Server(\n        {\n          static: undefined,\n          port,\n        },\n        compiler,\n      );\n\n      await server.start();\n\n      ({ page, browser } = await runBrowser());\n\n      pageErrors = [];\n      consoleMessages = [];\n    });\n\n    afterEach(async () => {\n      await browser.close();\n      await server.stop();\n    });\n\n    it(\"should handle request to /index.html\", async () => {\n      page\n        .on(\"console\", (message) => {\n          consoleMessages.push(message);\n        })\n        .on(\"pageerror\", (error) => {\n          pageErrors.push(error);\n        });\n\n      const response = await page.goto(`http://localhost:${port}/index.html`, {\n        waitUntil: \"networkidle0\",\n      });\n\n      expect(response.status()).toMatchSnapshot(\"response status\");\n\n      expect(await response.text()).toMatchSnapshot(\"response text\");\n\n      expect(consoleMessages.map((message) => message.text())).toMatchSnapshot(\n        \"console messages\",\n      );\n\n      expect(pageErrors).toMatchSnapshot(\"page errors\");\n    });\n  });\n\n  describe(\"disabled\", () => {\n    let compiler;\n    let server;\n    let page;\n    let browser;\n    let pageErrors;\n    let consoleMessages;\n\n    beforeEach(async () => {\n      // This is a somewhat weird test, but it is important that we mock\n      // the PWD here, and test if /other.html in our \"fake\" PWD really is not requested.\n      jest.spyOn(process, \"cwd\").mockImplementation(() => publicDirectory);\n\n      compiler = webpack(config);\n\n      server = new Server(\n        {\n          static: false,\n          port,\n        },\n        compiler,\n      );\n\n      await server.start();\n\n      ({ page, browser } = await runBrowser());\n\n      pageErrors = [];\n      consoleMessages = [];\n    });\n\n    afterEach(async () => {\n      await browser.close();\n      await server.stop();\n    });\n\n    it(\"should not handle request to /other.html (404)\", async () => {\n      page\n        .on(\"console\", (message) => {\n          consoleMessages.push(message);\n        })\n        .on(\"pageerror\", (error) => {\n          pageErrors.push(error);\n        });\n\n      const response = await page.goto(`http://localhost:${port}/index.html`, {\n        waitUntil: \"networkidle0\",\n      });\n\n      expect(response.status()).toMatchSnapshot(\"response status\");\n\n      expect(await response.text()).toMatchSnapshot(\"response text\");\n\n      expect(consoleMessages.map((message) => message.text())).toMatchSnapshot(\n        \"console messages\",\n      );\n\n      expect(pageErrors).toMatchSnapshot(\"page errors\");\n    });\n  });\n});\n"
  },
  {
    "path": "test/e2e/static-public-path.test.js",
    "content": "\"use strict\";\n\nconst path = require(\"node:path\");\nconst webpack = require(\"webpack\");\nconst Server = require(\"../../lib/Server\");\nconst config = require(\"../fixtures/static-config/webpack.config\");\nconst runBrowser = require(\"../helpers/run-browser\");\nconst port = require(\"../ports-map\")[\"static-public-path-option\"];\n\nconst staticDirectory = path.resolve(__dirname, \"../fixtures/static-config\");\nconst publicDirectory = path.resolve(staticDirectory, \"public\");\nconst otherPublicDirectory = path.resolve(staticDirectory, \"other\");\nconst staticPublicPath = \"/serve-content-at-this-url\";\nconst otherStaticPublicPath = \"/serve-other-content-at-this-url\";\n\ndescribe(\"static.publicPath option\", () => {\n  describe(\"to directory\", () => {\n    let compiler;\n    let server;\n    let page;\n    let browser;\n    let pageErrors;\n    let consoleMessages;\n\n    beforeEach(async () => {\n      compiler = webpack(config);\n\n      server = new Server(\n        {\n          static: {\n            directory: publicDirectory,\n            publicPath: staticPublicPath,\n            watch: true,\n          },\n          port,\n        },\n        compiler,\n      );\n\n      await server.start();\n\n      ({ page, browser } = await runBrowser());\n\n      pageErrors = [];\n      consoleMessages = [];\n    });\n\n    afterEach(async () => {\n      await browser.close();\n      await server.stop();\n    });\n\n    it(\"should handle request to index\", async () => {\n      page\n        .on(\"console\", (message) => {\n          consoleMessages.push(message);\n        })\n        .on(\"pageerror\", (error) => {\n          pageErrors.push(error);\n        });\n\n      const response = await page.goto(\n        `http://localhost:${port}${staticPublicPath}/`,\n        {\n          waitUntil: \"networkidle0\",\n        },\n      );\n\n      expect(response.status()).toMatchSnapshot(\"response status\");\n\n      expect(await response.text()).toMatchSnapshot(\"response text\");\n\n      expect(consoleMessages.map((message) => message.text())).toMatchSnapshot(\n        \"console messages\",\n      );\n\n      expect(pageErrors).toMatchSnapshot(\"page errors\");\n    });\n\n    it(\"should handle request to other file\", async () => {\n      page\n        .on(\"console\", (message) => {\n          consoleMessages.push(message);\n        })\n        .on(\"pageerror\", (error) => {\n          pageErrors.push(error);\n        });\n\n      const response = await page.goto(\n        `http://localhost:${port}${staticPublicPath}/other.html`,\n        {\n          waitUntil: \"networkidle0\",\n        },\n      );\n\n      expect(response.status()).toMatchSnapshot(\"response status\");\n\n      expect(await response.text()).toMatchSnapshot(\"response text\");\n\n      expect(consoleMessages.map((message) => message.text())).toMatchSnapshot(\n        \"console messages\",\n      );\n\n      expect(pageErrors).toMatchSnapshot(\"page errors\");\n    });\n  });\n\n  describe(\"test listing files in folders without index.html using the option static.serveIndex: false\", () => {\n    let compiler;\n    let server;\n    let page;\n    let browser;\n    let pageErrors;\n    let consoleMessages;\n\n    beforeEach(async () => {\n      compiler = webpack(config);\n\n      server = new Server(\n        {\n          static: {\n            directory: publicDirectory,\n            publicPath: staticPublicPath,\n            watch: true,\n            serveIndex: false,\n          },\n          port,\n        },\n        compiler,\n      );\n\n      await server.start();\n\n      ({ page, browser } = await runBrowser());\n\n      pageErrors = [];\n      consoleMessages = [];\n    });\n\n    afterEach(async () => {\n      await browser.close();\n      await server.stop();\n    });\n\n    it(\"shouldn't list the files inside the assets folder (404)\", async () => {\n      page\n        .on(\"console\", (message) => {\n          consoleMessages.push(message);\n        })\n        .on(\"pageerror\", (error) => {\n          pageErrors.push(error);\n        });\n\n      const response = await page.goto(\n        `http://localhost:${port}${staticPublicPath}/assets`,\n        {\n          waitUntil: \"networkidle0\",\n        },\n      );\n\n      expect(response.status()).toMatchSnapshot(\"response status\");\n\n      expect(await response.text()).toMatchSnapshot(\"response text\");\n\n      expect(consoleMessages.map((message) => message.text())).toMatchSnapshot(\n        \"console messages\",\n      );\n\n      expect(pageErrors).toMatchSnapshot(\"page errors\");\n    });\n\n    it(\"should show Heyo. because bar has index.html inside it (200)\", async () => {\n      page\n        .on(\"console\", (message) => {\n          consoleMessages.push(message);\n        })\n        .on(\"pageerror\", (error) => {\n          pageErrors.push(error);\n        });\n\n      const response = await page.goto(\n        `http://localhost:${port}${staticPublicPath}/bar`,\n        {\n          waitUntil: \"networkidle0\",\n        },\n      );\n\n      expect(response.status()).toMatchSnapshot(\"response status\");\n\n      expect(await response.text()).toMatchSnapshot(\"response text\");\n\n      expect(consoleMessages.map((message) => message.text())).toMatchSnapshot(\n        \"console messages\",\n      );\n\n      expect(pageErrors).toMatchSnapshot(\"page errors\");\n    });\n  });\n\n  describe(\"test listing files in folders without index.html using the option static.serveIndex: true\", () => {\n    let compiler;\n    let server;\n    let page;\n    let browser;\n    let pageErrors;\n    let consoleMessages;\n\n    beforeEach(async () => {\n      compiler = webpack(config);\n\n      server = new Server(\n        {\n          static: {\n            directory: publicDirectory,\n            publicPath: staticPublicPath,\n            watch: true,\n            serveIndex: true,\n          },\n          port,\n        },\n        compiler,\n      );\n\n      await server.start();\n\n      ({ page, browser } = await runBrowser());\n\n      pageErrors = [];\n      consoleMessages = [];\n    });\n\n    afterEach(async () => {\n      await browser.close();\n      await server.stop();\n    });\n\n    it(\"should list the files inside the assets folder (200)\", async () => {\n      page\n        .on(\"console\", (message) => {\n          consoleMessages.push(message);\n        })\n        .on(\"pageerror\", (error) => {\n          pageErrors.push(error);\n        });\n\n      const response = await page.goto(\n        `http://localhost:${port}${staticPublicPath}/assets`,\n        {\n          waitUntil: \"networkidle0\",\n        },\n      );\n\n      expect(response.status()).toMatchSnapshot(\"response status\");\n\n      expect(await response.text()).toContain(\"other.txt\");\n\n      expect(consoleMessages.map((message) => message.text())).toMatchSnapshot(\n        \"console messages\",\n      );\n\n      expect(pageErrors).toMatchSnapshot(\"page errors\");\n    });\n\n    it(\"should show Heyo. because bar has index.html inside it (200)\", async () => {\n      page\n        .on(\"console\", (message) => {\n          consoleMessages.push(message);\n        })\n        .on(\"pageerror\", (error) => {\n          pageErrors.push(error);\n        });\n\n      const response = await page.goto(\n        `http://localhost:${port}${staticPublicPath}/bar`,\n        {\n          waitUntil: \"networkidle0\",\n        },\n      );\n\n      expect(response.status()).toMatchSnapshot(\"response status\");\n\n      expect(await response.text()).toMatchSnapshot(\"response text\");\n\n      expect(consoleMessages.map((message) => message.text())).toMatchSnapshot(\n        \"console messages\",\n      );\n\n      expect(pageErrors).toMatchSnapshot(\"page errors\");\n    });\n  });\n\n  describe(\"test listing files in folders without index.html using the option static.serveIndex default (true)\", () => {\n    let compiler;\n    let server;\n    let page;\n    let browser;\n    let pageErrors;\n    let consoleMessages;\n\n    beforeEach(async () => {\n      compiler = webpack(config);\n\n      server = new Server(\n        {\n          static: {\n            directory: publicDirectory,\n            publicPath: staticPublicPath,\n            watch: true,\n            serveIndex: true,\n          },\n          port,\n        },\n        compiler,\n      );\n\n      await server.start();\n\n      ({ page, browser } = await runBrowser());\n\n      pageErrors = [];\n      consoleMessages = [];\n    });\n\n    afterEach(async () => {\n      await browser.close();\n      await server.stop();\n    });\n\n    it(\"should list the files inside the assets folder (200)\", async () => {\n      page\n        .on(\"console\", (message) => {\n          consoleMessages.push(message);\n        })\n        .on(\"pageerror\", (error) => {\n          pageErrors.push(error);\n        });\n\n      const response = await page.goto(\n        `http://localhost:${port}${staticPublicPath}/assets`,\n        {\n          waitUntil: \"networkidle0\",\n        },\n      );\n\n      expect(response.status()).toMatchSnapshot(\"response status\");\n\n      expect(await response.text()).toContain(\"other.txt\");\n\n      expect(consoleMessages.map((message) => message.text())).toMatchSnapshot(\n        \"console messages\",\n      );\n\n      expect(pageErrors).toMatchSnapshot(\"page errors\");\n    });\n\n    it(\"should show Heyo. because bar has index.html inside it (200)\", async () => {\n      page\n        .on(\"console\", (message) => {\n          consoleMessages.push(message);\n        })\n        .on(\"pageerror\", (error) => {\n          pageErrors.push(error);\n        });\n\n      const response = await page.goto(\n        `http://localhost:${port}${staticPublicPath}/bar`,\n        {\n          waitUntil: \"networkidle0\",\n        },\n      );\n\n      expect(response.status()).toMatchSnapshot(\"response status\");\n\n      expect(await response.text()).toMatchSnapshot(\"response text\");\n\n      expect(consoleMessages.map((message) => message.text())).toMatchSnapshot(\n        \"console messages\",\n      );\n\n      expect(pageErrors).toMatchSnapshot(\"page errors\");\n    });\n  });\n\n  describe(\"to multiple directories\", () => {\n    let compiler;\n    let server;\n    let page;\n    let browser;\n    let pageErrors;\n    let consoleMessages;\n\n    beforeEach(async () => {\n      compiler = webpack(config);\n\n      server = new Server(\n        {\n          static: [\n            {\n              directory: publicDirectory,\n              publicPath: staticPublicPath,\n            },\n            {\n              directory: otherPublicDirectory,\n              publicPath: staticPublicPath,\n            },\n          ],\n          port,\n        },\n        compiler,\n      );\n\n      await server.start();\n\n      ({ page, browser } = await runBrowser());\n\n      pageErrors = [];\n      consoleMessages = [];\n    });\n\n    afterEach(async () => {\n      await browser.close();\n      await server.stop();\n    });\n\n    it(\"should handle request to first directory\", async () => {\n      page\n        .on(\"console\", (message) => {\n          consoleMessages.push(message);\n        })\n        .on(\"pageerror\", (error) => {\n          pageErrors.push(error);\n        });\n\n      const response = await page.goto(\n        `http://localhost:${port}${staticPublicPath}/`,\n        {\n          waitUntil: \"networkidle0\",\n        },\n      );\n\n      expect(response.status()).toMatchSnapshot(\"response status\");\n\n      expect(await response.text()).toMatchSnapshot(\"response text\");\n\n      expect(consoleMessages.map((message) => message.text())).toMatchSnapshot(\n        \"console messages\",\n      );\n\n      expect(pageErrors).toMatchSnapshot(\"page errors\");\n    });\n\n    it(\"should handle request to second directory\", async () => {\n      page\n        .on(\"console\", (message) => {\n          consoleMessages.push(message);\n        })\n        .on(\"pageerror\", (error) => {\n          pageErrors.push(error);\n        });\n\n      const response = await page.goto(\n        `http://localhost:${port}${staticPublicPath}/foo.html`,\n        {\n          waitUntil: \"networkidle0\",\n        },\n      );\n\n      expect(response.status()).toMatchSnapshot(\"response status\");\n\n      expect(await response.text()).toMatchSnapshot(\"response text\");\n\n      expect(consoleMessages.map((message) => message.text())).toMatchSnapshot(\n        \"console messages\",\n      );\n\n      expect(pageErrors).toMatchSnapshot(\"page errors\");\n    });\n  });\n\n  describe(\"defaults to CWD\", () => {\n    let cwdSpy;\n    let compiler;\n    let server;\n    let page;\n    let browser;\n    let pageErrors;\n    let consoleMessages;\n\n    beforeEach(async () => {\n      cwdSpy = jest\n        .spyOn(process, \"cwd\")\n        .mockImplementation(() => staticDirectory);\n\n      compiler = webpack(config);\n\n      server = new Server(\n        {\n          static: {\n            publicPath: staticPublicPath,\n          },\n          port,\n        },\n        compiler,\n      );\n\n      await server.start();\n\n      ({ page, browser } = await runBrowser());\n\n      pageErrors = [];\n      consoleMessages = [];\n    });\n\n    afterEach(async () => {\n      cwdSpy.mockRestore();\n\n      await browser.close();\n      await server.stop();\n    });\n\n    it(\"should handle request to page\", async () => {\n      page\n        .on(\"console\", (message) => {\n          consoleMessages.push(message);\n        })\n        .on(\"pageerror\", (error) => {\n          pageErrors.push(error);\n        });\n\n      const response = await page.goto(\n        `http://localhost:${port}${staticPublicPath}/index.html`,\n        {\n          waitUntil: \"networkidle0\",\n        },\n      );\n\n      expect(response.status()).toMatchSnapshot(\"response status\");\n\n      expect(await response.text()).toMatchSnapshot(\"response text\");\n\n      expect(consoleMessages.map((message) => message.text())).toMatchSnapshot(\n        \"console messages\",\n      );\n\n      expect(pageErrors).toMatchSnapshot(\"page errors\");\n    });\n  });\n\n  describe(\"Content type\", () => {\n    let compiler;\n    let server;\n    let page;\n    let browser;\n    let pageErrors;\n    let consoleMessages;\n\n    beforeEach(async () => {\n      compiler = webpack(config);\n\n      server = new Server(\n        {\n          static: {\n            directory: publicDirectory,\n            publicPath: staticPublicPath,\n          },\n          port,\n        },\n        compiler,\n      );\n\n      await server.start();\n\n      ({ page, browser } = await runBrowser());\n\n      pageErrors = [];\n      consoleMessages = [];\n    });\n\n    afterEach(async () => {\n      await browser.close();\n      await server.stop();\n    });\n\n    it(\"should handle request to example.txt\", async () => {\n      page\n        .on(\"console\", (message) => {\n          consoleMessages.push(message);\n        })\n        .on(\"pageerror\", (error) => {\n          pageErrors.push(error);\n        });\n\n      const response = await page.goto(\n        `http://localhost:${port}${staticPublicPath}/assets/example.txt`,\n        {\n          waitUntil: \"networkidle0\",\n        },\n      );\n\n      expect(response.status()).toMatchSnapshot(\"response status\");\n\n      expect(response.headers()[\"content-type\"]).toMatchSnapshot(\n        \"response header content-type\",\n      );\n\n      expect(consoleMessages.map((message) => message.text())).toMatchSnapshot(\n        \"console messages\",\n      );\n\n      expect(pageErrors).toMatchSnapshot(\"page errors\");\n    });\n  });\n\n  describe(\"should ignore methods other than GET and HEAD\", () => {\n    let compiler;\n    let server;\n    let page;\n    let browser;\n    let pageErrors;\n    let consoleMessages;\n\n    beforeEach(async () => {\n      compiler = webpack(config);\n\n      server = new Server(\n        {\n          static: {\n            directory: publicDirectory,\n            publicPath: staticPublicPath,\n          },\n          port,\n        },\n        compiler,\n      );\n\n      await server.start();\n\n      ({ page, browser } = await runBrowser());\n\n      pageErrors = [];\n      consoleMessages = [];\n    });\n\n    afterEach(async () => {\n      await browser.close();\n      await server.stop();\n    });\n\n    it(\"should handle GET request\", async () => {\n      page\n        .on(\"console\", (message) => {\n          consoleMessages.push(message);\n        })\n        .on(\"pageerror\", (error) => {\n          pageErrors.push(error);\n        });\n\n      const response = await page.goto(\n        `http://localhost:${port}${staticPublicPath}/`,\n        {\n          waitUntil: \"networkidle0\",\n        },\n      );\n\n      expect(response.status()).toMatchSnapshot(\"response status\");\n\n      expect(consoleMessages.map((message) => message.text())).toMatchSnapshot(\n        \"console messages\",\n      );\n\n      expect(pageErrors).toMatchSnapshot(\"page errors\");\n    });\n\n    it(\"should handle HEAD request\", async () => {\n      page\n        .on(\"console\", (message) => {\n          consoleMessages.push(message);\n        })\n        .on(\"pageerror\", (error) => {\n          pageErrors.push(error);\n        })\n        .on(\"request\", (interceptedRequest) => {\n          if (interceptedRequest.isInterceptResolutionHandled()) return;\n\n          interceptedRequest.continue({ method: \"HEAD\" });\n        });\n\n      const response = await page.goto(\n        `http://localhost:${port}${staticPublicPath}/`,\n        {\n          waitUntil: \"networkidle0\",\n        },\n      );\n\n      expect(response.status()).toMatchSnapshot(\"response status\");\n\n      expect(consoleMessages.map((message) => message.text())).toMatchSnapshot(\n        \"console messages\",\n      );\n\n      expect(pageErrors).toMatchSnapshot(\"page errors\");\n    });\n\n    it(\"should not handle POST request\", async () => {\n      await page.setRequestInterception(true);\n\n      page\n        .on(\"console\", (message) => {\n          consoleMessages.push(message);\n        })\n        .on(\"pageerror\", (error) => {\n          pageErrors.push(error);\n        })\n        .on(\"request\", (interceptedRequest) => {\n          interceptedRequest.continue({ method: \"POST\" });\n        });\n\n      const response = await page.goto(\n        `http://localhost:${port}${staticPublicPath}/`,\n        {\n          waitUntil: \"networkidle0\",\n        },\n      );\n\n      expect(response.status()).toMatchSnapshot(\"response status\");\n\n      expect(consoleMessages.map((message) => message.text())).toMatchSnapshot(\n        \"console messages\",\n      );\n\n      expect(pageErrors).toMatchSnapshot(\"page errors\");\n    });\n\n    it(\"should not handle PUT request\", async () => {\n      await page.setRequestInterception(true);\n\n      page\n        .on(\"console\", (message) => {\n          consoleMessages.push(message);\n        })\n        .on(\"pageerror\", (error) => {\n          pageErrors.push(error);\n        })\n        .on(\"request\", (interceptedRequest) => {\n          interceptedRequest.continue({ method: \"PUT\" });\n        });\n\n      const response = await page.goto(\n        `http://localhost:${port}${staticPublicPath}/`,\n        {\n          waitUntil: \"networkidle0\",\n        },\n      );\n\n      expect(response.status()).toMatchSnapshot(\"response status\");\n\n      expect(consoleMessages.map((message) => message.text())).toMatchSnapshot(\n        \"console messages\",\n      );\n\n      expect(pageErrors).toMatchSnapshot(\"page errors\");\n    });\n\n    it(\"should not handle DELETE request\", async () => {\n      await page.setRequestInterception(true);\n\n      page\n        .on(\"console\", (message) => {\n          consoleMessages.push(message);\n        })\n        .on(\"pageerror\", (error) => {\n          pageErrors.push(error);\n        })\n        .on(\"request\", (interceptedRequest) => {\n          interceptedRequest.continue({ method: \"DELETE\" });\n        });\n\n      const response = await page.goto(\n        `http://localhost:${port}${staticPublicPath}/`,\n        {\n          waitUntil: \"networkidle0\",\n        },\n      );\n\n      expect(response.status()).toMatchSnapshot(\"response status\");\n\n      expect(consoleMessages.map((message) => message.text())).toMatchSnapshot(\n        \"console messages\",\n      );\n\n      expect(pageErrors).toMatchSnapshot(\"page errors\");\n    });\n\n    it(\"should not handle PATCH request\", async () => {\n      await page.setRequestInterception(true);\n\n      page\n        .on(\"console\", (message) => {\n          consoleMessages.push(message);\n        })\n        .on(\"pageerror\", (error) => {\n          pageErrors.push(error);\n        })\n        .on(\"request\", (interceptedRequest) => {\n          interceptedRequest.continue({ method: \"PATCH\" });\n        });\n\n      const response = await page.goto(\n        `http://localhost:${port}${staticPublicPath}/`,\n        {\n          waitUntil: \"networkidle0\",\n        },\n      );\n\n      expect(response.status()).toMatchSnapshot(\"response status\");\n\n      expect(consoleMessages.map((message) => message.text())).toMatchSnapshot(\n        \"console messages\",\n      );\n\n      expect(pageErrors).toMatchSnapshot(\"page errors\");\n    });\n  });\n\n  describe(\"multiple static.publicPath entries\", () => {\n    let compiler;\n    let server;\n    let page;\n    let browser;\n    let pageErrors;\n    let consoleMessages;\n\n    beforeEach(async () => {\n      compiler = webpack(config);\n\n      server = new Server(\n        {\n          static: [\n            {\n              directory: publicDirectory,\n              publicPath: staticPublicPath,\n              watch: true,\n            },\n            {\n              directory: otherPublicDirectory,\n              publicPath: otherStaticPublicPath,\n              watch: true,\n            },\n          ],\n          port,\n        },\n        compiler,\n      );\n\n      await server.start();\n\n      ({ page, browser } = await runBrowser());\n\n      pageErrors = [];\n      consoleMessages = [];\n    });\n\n    afterEach(async () => {\n      await browser.close();\n      await server.stop();\n    });\n\n    it(\"should handle request to the index of first path\", async () => {\n      page\n        .on(\"console\", (message) => {\n          consoleMessages.push(message);\n        })\n        .on(\"pageerror\", (error) => {\n          pageErrors.push(error);\n        });\n\n      const response = await page.goto(\n        `http://localhost:${port}${staticPublicPath}/`,\n        {\n          waitUntil: \"networkidle0\",\n        },\n      );\n\n      expect(response.status()).toMatchSnapshot(\"response status\");\n\n      expect(await response.text()).toMatchSnapshot(\"response text\");\n\n      expect(consoleMessages.map((message) => message.text())).toMatchSnapshot(\n        \"console messages\",\n      );\n\n      expect(pageErrors).toMatchSnapshot(\"page errors\");\n    });\n\n    it(\"should handle request to the other file of first path\", async () => {\n      page\n        .on(\"console\", (message) => {\n          consoleMessages.push(message);\n        })\n        .on(\"pageerror\", (error) => {\n          pageErrors.push(error);\n        });\n\n      const response = await page.goto(\n        `http://localhost:${port}${staticPublicPath}/other.html`,\n        {\n          waitUntil: \"networkidle0\",\n        },\n      );\n\n      expect(response.status()).toMatchSnapshot(\"response status\");\n\n      expect(await response.text()).toMatchSnapshot(\"response text\");\n\n      expect(consoleMessages.map((message) => message.text())).toMatchSnapshot(\n        \"console messages\",\n      );\n\n      expect(pageErrors).toMatchSnapshot(\"page errors\");\n    });\n\n    it(\"should handle request to the /foo route of second path\", async () => {\n      page\n        .on(\"console\", (message) => {\n          consoleMessages.push(message);\n        })\n        .on(\"pageerror\", (error) => {\n          pageErrors.push(error);\n        });\n\n      const response = await page.goto(\n        `http://localhost:${port}${otherStaticPublicPath}/foo.html`,\n        {\n          waitUntil: \"networkidle0\",\n        },\n      );\n\n      expect(response.status()).toMatchSnapshot(\"response status\");\n\n      expect(await response.text()).toMatchSnapshot(\"response text\");\n\n      expect(consoleMessages.map((message) => message.text())).toMatchSnapshot(\n        \"console messages\",\n      );\n\n      expect(pageErrors).toMatchSnapshot(\"page errors\");\n    });\n  });\n\n  describe(\"multiple static.publicPath entries with publicPath array\", () => {\n    let compiler;\n    let server;\n    let page;\n    let browser;\n    let pageErrors;\n    let consoleMessages;\n\n    beforeEach(async () => {\n      compiler = webpack(config);\n\n      server = new Server(\n        {\n          static: [\n            {\n              directory: publicDirectory,\n              publicPath: staticPublicPath,\n              watch: true,\n            },\n            {\n              directory: otherPublicDirectory,\n              publicPath: [staticPublicPath, otherStaticPublicPath],\n              watch: true,\n            },\n          ],\n          port,\n        },\n        compiler,\n      );\n\n      await server.start();\n\n      ({ page, browser } = await runBrowser());\n\n      pageErrors = [];\n      consoleMessages = [];\n    });\n\n    afterEach(async () => {\n      await browser.close();\n      await server.stop();\n    });\n\n    it(\"should handle request to the index of first path\", async () => {\n      page\n        .on(\"console\", (message) => {\n          consoleMessages.push(message);\n        })\n        .on(\"pageerror\", (error) => {\n          pageErrors.push(error);\n        });\n\n      const response = await page.goto(\n        `http://localhost:${port}${staticPublicPath}/`,\n        {\n          waitUntil: \"networkidle0\",\n        },\n      );\n\n      expect(response.status()).toMatchSnapshot(\"response status\");\n\n      expect(await response.text()).toMatchSnapshot(\"response text\");\n\n      expect(consoleMessages.map((message) => message.text())).toMatchSnapshot(\n        \"console messages\",\n      );\n\n      expect(pageErrors).toMatchSnapshot(\"page errors\");\n    });\n\n    it(\"should handle request to the other file of first path\", async () => {\n      page\n        .on(\"console\", (message) => {\n          consoleMessages.push(message);\n        })\n        .on(\"pageerror\", (error) => {\n          pageErrors.push(error);\n        });\n\n      const response = await page.goto(\n        `http://localhost:${port}${staticPublicPath}/other.html`,\n        {\n          waitUntil: \"networkidle0\",\n        },\n      );\n\n      expect(response.status()).toMatchSnapshot(\"response status\");\n\n      expect(await response.text()).toMatchSnapshot(\"response text\");\n\n      expect(consoleMessages.map((message) => message.text())).toMatchSnapshot(\n        \"console messages\",\n      );\n\n      expect(pageErrors).toMatchSnapshot(\"page errors\");\n    });\n\n    it(\"should handle request to the /foo route of first path\", async () => {\n      page\n        .on(\"console\", (message) => {\n          consoleMessages.push(message);\n        })\n        .on(\"pageerror\", (error) => {\n          pageErrors.push(error);\n        });\n\n      const response = await page.goto(\n        `http://localhost:${port}${staticPublicPath}/foo.html`,\n        {\n          waitUntil: \"networkidle0\",\n        },\n      );\n\n      expect(response.status()).toMatchSnapshot(\"response status\");\n\n      expect(await response.text()).toMatchSnapshot(\"response text\");\n\n      expect(consoleMessages.map((message) => message.text())).toMatchSnapshot(\n        \"console messages\",\n      );\n\n      expect(pageErrors).toMatchSnapshot(\"page errors\");\n    });\n\n    it(\"should handle request to the /foo route of second path\", async () => {\n      page\n        .on(\"console\", (message) => {\n          consoleMessages.push(message);\n        })\n        .on(\"pageerror\", (error) => {\n          pageErrors.push(error);\n        });\n\n      const response = await page.goto(\n        `http://localhost:${port}${otherStaticPublicPath}/foo.html`,\n        {\n          waitUntil: \"networkidle0\",\n        },\n      );\n\n      expect(response.status()).toMatchSnapshot(\"response status\");\n\n      expect(await response.text()).toMatchSnapshot(\"response text\");\n\n      expect(consoleMessages.map((message) => message.text())).toMatchSnapshot(\n        \"console messages\",\n      );\n\n      expect(pageErrors).toMatchSnapshot(\"page errors\");\n    });\n  });\n});\n"
  },
  {
    "path": "test/e2e/stats.test.js",
    "content": "\"use strict\";\n\nconst webpack = require(\"webpack\");\nconst Server = require(\"../../lib/Server\");\nconst config = require(\"../fixtures/client-config/webpack.config\");\nconst HTMLGeneratorPlugin = require(\"../helpers/html-generator-plugin\");\nconst runBrowser = require(\"../helpers/run-browser\");\nconst port = require(\"../ports-map\").stats;\n\njest.spyOn(globalThis.console, \"log\").mockImplementation();\n\ndescribe(\"stats\", () => {\n  const cases = [\n    {\n      title: 'should work when \"stats\" is not specified',\n      webpackOptions: {},\n    },\n    {\n      title: 'should work using \"{}\" value for the \"stats\" option',\n      webpackOptions: {\n        stats: {},\n      },\n    },\n    {\n      title: 'should work using \"undefined\" value for the \"stats\" option',\n      webpackOptions: {\n        stats: undefined,\n      },\n    },\n    {\n      title: 'should work using \"false\" value for the \"stats\" option',\n      webpackOptions: {\n        stats: false,\n      },\n    },\n    {\n      title: 'should work using \"errors-only\" value for the \"stats\" option',\n      webpackOptions: {\n        stats: \"errors-only\",\n      },\n    },\n    {\n      title:\n        'should work using \"{ assets: false }\" value for the \"stats\" option',\n      webpackOptions: {\n        stats: {\n          assets: false,\n        },\n      },\n    },\n    {\n      title:\n        'should work using \"{ assets: false }\" value for the \"stats\" option',\n      webpackOptions: {\n        stats: {\n          colors: {\n            green: \"\\u001B[32m\",\n          },\n        },\n      },\n    },\n    {\n      title:\n        'should work using \"{ warningsFilter: \\'test\\' }\" value for the \"stats\" option',\n      webpackOptions: {\n        plugins: [\n          {\n            apply(compiler) {\n              compiler.hooks.thisCompilation.tap(\n                \"warnings-webpack-plugin\",\n                (compilation) => {\n                  compilation.warnings.push(\n                    new Error(\"Warning from compilation\"),\n                  );\n                },\n              );\n            },\n          },\n          new HTMLGeneratorPlugin(),\n        ],\n        stats: { warningsFilter: /Warning from compilation/ },\n      },\n    },\n  ];\n\n  if (webpack.version.startsWith(\"5\")) {\n    cases.push({\n      title: 'should work and respect the \"ignoreWarnings\" option',\n      webpackOptions: {\n        plugins: [\n          {\n            apply(compiler) {\n              compiler.hooks.thisCompilation.tap(\n                \"warnings-webpack-plugin\",\n                (compilation) => {\n                  compilation.warnings.push(\n                    new Error(\"Warning from compilation\"),\n                  );\n                },\n              );\n            },\n          },\n          new HTMLGeneratorPlugin(),\n        ],\n        ignoreWarnings: [/Warning from compilation/],\n      },\n    });\n  }\n\n  for (const testCase of cases) {\n    it(testCase.title, async () => {\n      const compiler = webpack({ ...config, ...testCase.webpackOptions });\n      const devServerOptions = {\n        port,\n      };\n      const server = new Server(devServerOptions, compiler);\n\n      await server.start();\n\n      const { page, browser } = await runBrowser();\n\n      try {\n        const consoleMessages = [];\n\n        page.on(\"console\", (message) => {\n          consoleMessages.push(message);\n        });\n\n        await page.goto(`http://localhost:${port}/`, {\n          waitUntil: \"networkidle0\",\n        });\n\n        expect(\n          consoleMessages.map((message) => message.text()),\n        ).toMatchSnapshot();\n      } finally {\n        await browser.close();\n        await server.stop();\n      }\n    });\n  }\n});\n"
  },
  {
    "path": "test/e2e/target.test.js",
    "content": "\"use strict\";\n\nconst path = require(\"node:path\");\nconst webpack = require(\"webpack\");\nconst Server = require(\"../../lib/Server\");\nconst config = require(\"../fixtures/client-config/webpack.config\");\nconst workerConfig = require(\"../fixtures/worker-config/webpack.config\");\nconst workerConfigDevServerFalse = require(\"../fixtures/worker-config-dev-server-false/webpack.config\");\nconst runBrowser = require(\"../helpers/run-browser\");\nconst port = require(\"../ports-map\").target;\n\nconst sortByTerm = (data, term) =>\n  data.sort((a, b) => (a.indexOf(term) < b.indexOf(term) ? -1 : 1));\n\ndescribe(\"target\", () => {\n  const targets = [\n    false,\n    \"browserslist:defaults\",\n    \"web\",\n    \"webworker\",\n    \"node\",\n    \"async-node\",\n    \"electron-main\",\n    \"electron-preload\",\n    \"electron-renderer\",\n    \"nwjs\",\n    \"node-webkit\",\n    \"es5\",\n    [\"web\", \"es5\"],\n  ];\n\n  for (const target of targets) {\n    it(`should work using \"${target}\" target`, async () => {\n      const compiler = webpack({\n        ...config,\n        target,\n        ...(target === false || target === \"es5\"\n          ? {\n              output: { chunkFormat: \"array-push\", path: \"/\" },\n            }\n          : {}),\n      });\n      const server = new Server({ port }, compiler);\n\n      await server.start();\n\n      const { page, browser } = await runBrowser();\n\n      try {\n        const pageErrors = [];\n        const consoleMessages = [];\n\n        page\n          .on(\"console\", (message) => {\n            consoleMessages.push(message);\n          })\n          .on(\"pageerror\", (error) => {\n            pageErrors.push(error);\n          });\n\n        await page.goto(`http://localhost:${port}/`, {\n          waitUntil: \"networkidle0\",\n        });\n\n        expect(\n          consoleMessages.map((message) => message.text()),\n        ).toMatchSnapshot(\"console messages\");\n\n        if (\n          target === \"node\" ||\n          target === \"async-node\" ||\n          target === \"electron-main\" ||\n          target === \"electron-preload\" ||\n          target === \"electron-renderer\" ||\n          target === \"nwjs\" ||\n          target === \"node-webkit\"\n        ) {\n          const hasRequireOrGlobalError =\n            pageErrors.filter((pageError) =>\n              /require is not defined|global is not defined/.test(pageError),\n            ).length === 1;\n\n          expect(hasRequireOrGlobalError).toBe(true);\n        } else {\n          expect(pageErrors).toMatchSnapshot(\"page errors\");\n        }\n      } finally {\n        await browser.close();\n        await server.stop();\n      }\n    });\n  }\n\n  it(\"should work using multi compiler mode with `web` and `webworker` targets\", async () => {\n    const compiler = webpack(workerConfig);\n    const server = new Server({ port }, compiler);\n\n    await server.start();\n\n    const { page, browser } = await runBrowser();\n\n    try {\n      const pageErrors = [];\n      const consoleMessages = [];\n\n      page\n        .on(\"console\", (message) => {\n          consoleMessages.push(message);\n        })\n        .on(\"pageerror\", (error) => {\n          pageErrors.push(error);\n        });\n\n      await page.goto(`http://localhost:${port}/`, {\n        waitUntil: \"networkidle0\",\n      });\n\n      expect(\n        sortByTerm(\n          consoleMessages.map((message) => message.text()),\n          \"Worker said:\",\n        ),\n      ).toMatchSnapshot(\"console messages\");\n\n      expect(pageErrors).toMatchSnapshot(\"page errors\");\n    } finally {\n      await browser.close();\n      await server.stop();\n    }\n  });\n\n  it(\"should work using multi compiler mode with `web` and `webworker` targets with `devServer: false`\", async () => {\n    const compiler = webpack(workerConfigDevServerFalse);\n    const server = new Server(\n      {\n        port,\n        static: {\n          directory: path.resolve(\n            __dirname,\n            \"../fixtures/worker-config-dev-server-false/public/\",\n          ),\n        },\n      },\n      compiler,\n    );\n\n    await server.start();\n\n    const { page, browser } = await runBrowser();\n\n    try {\n      const pageErrors = [];\n      const consoleMessages = [];\n\n      page\n        .on(\"console\", (message) => {\n          consoleMessages.push(message);\n        })\n        .on(\"pageerror\", (error) => {\n          pageErrors.push(error);\n        });\n\n      await page.goto(`http://localhost:${port}/`, {\n        waitUntil: \"networkidle0\",\n      });\n\n      expect(\n        sortByTerm(\n          consoleMessages.map((message) => message.text()),\n          \"Worker said:\",\n        ),\n      ).toMatchSnapshot(\"console messages\");\n\n      expect(pageErrors).toMatchSnapshot(\"page errors\");\n    } finally {\n      await browser.close();\n      await server.stop();\n    }\n  });\n});\n"
  },
  {
    "path": "test/e2e/watch-files.test.js",
    "content": "\"use strict\";\n\nconst path = require(\"node:path\");\nconst chokidar = require(\"chokidar\");\nconst fs = require(\"graceful-fs\");\nconst webpack = require(\"webpack\");\nconst Server = require(\"../../lib/Server\");\nconst config = require(\"../fixtures/watch-files-config/webpack.config\");\nconst runBrowser = require(\"../helpers/run-browser\");\nconst port = require(\"../ports-map\")[\"watch-files-option\"];\n\nconst watchDir = path.resolve(\n  __dirname,\n  \"../fixtures/watch-files-config/public\",\n);\n\ndescribe(\"watchFiles option\", () => {\n  describe(\"should work with string and path to file\", () => {\n    const file = path.join(watchDir, \"assets/example.txt\");\n    let compiler;\n    let server;\n    let page;\n    let browser;\n    let pageErrors;\n    let consoleMessages;\n\n    beforeEach(async () => {\n      compiler = webpack(config);\n\n      server = new Server(\n        {\n          watchFiles: file,\n          port,\n        },\n        compiler,\n      );\n\n      await server.start();\n\n      ({ page, browser } = await runBrowser());\n\n      pageErrors = [];\n      consoleMessages = [];\n    });\n\n    afterEach(async () => {\n      await browser.close();\n      await server.stop();\n      fs.truncateSync(file);\n    });\n\n    it(\"should reload when file content is changed\", async () => {\n      page\n        .on(\"console\", (message) => {\n          consoleMessages.push(message);\n        })\n        .on(\"pageerror\", (error) => {\n          pageErrors.push(error);\n        });\n\n      const response = await page.goto(`http://localhost:${port}/`, {\n        waitUntil: \"networkidle0\",\n      });\n\n      expect(response.status()).toMatchSnapshot(\"response status\");\n\n      expect(consoleMessages.map((message) => message.text())).toMatchSnapshot(\n        \"console messages\",\n      );\n\n      expect(pageErrors).toMatchSnapshot(\"page errors\");\n\n      // change file content\n      fs.writeFileSync(file, \"Kurosaki Ichigo\", \"utf8\");\n\n      await new Promise((resolve) => {\n        server.staticWatchers[0].on(\"change\", async (changedPath) => {\n          // page reload\n          await page.waitForNavigation({ waitUntil: \"networkidle0\" });\n\n          expect(changedPath).toBe(file);\n\n          resolve();\n        });\n      });\n    });\n  });\n\n  describe(\"should work with string and path to directory\", () => {\n    const file = path.join(watchDir, \"assets/example.txt\");\n    let compiler;\n    let server;\n    let page;\n    let browser;\n    let pageErrors;\n    let consoleMessages;\n\n    beforeEach(async () => {\n      compiler = webpack(config);\n\n      server = new Server(\n        {\n          watchFiles: watchDir,\n          port,\n        },\n        compiler,\n      );\n\n      await server.start();\n\n      ({ page, browser } = await runBrowser());\n\n      pageErrors = [];\n      consoleMessages = [];\n    });\n\n    afterEach(async () => {\n      await browser.close();\n      await server.stop();\n      fs.truncateSync(file);\n    });\n\n    it(\"should reload when file content is changed\", async () => {\n      page\n        .on(\"console\", (message) => {\n          consoleMessages.push(message);\n        })\n        .on(\"pageerror\", (error) => {\n          pageErrors.push(error);\n        });\n\n      const response = await page.goto(`http://localhost:${port}/`, {\n        waitUntil: \"networkidle0\",\n      });\n\n      expect(response.status()).toMatchSnapshot(\"response status\");\n\n      expect(consoleMessages.map((message) => message.text())).toMatchSnapshot(\n        \"console messages\",\n      );\n\n      expect(pageErrors).toMatchSnapshot(\"page errors\");\n\n      // change file content\n      fs.writeFileSync(file, \"Kurosaki Ichigo\", \"utf8\");\n\n      await new Promise((resolve) => {\n        server.staticWatchers[0].on(\"change\", async (changedPath) => {\n          // page reload\n          await page.waitForNavigation({ waitUntil: \"networkidle0\" });\n\n          expect(changedPath).toBe(file);\n\n          resolve();\n        });\n      });\n    });\n  });\n\n  describe(\"should work with string and glob\", () => {\n    const file = path.join(watchDir, \"assets/example.txt\");\n    let compiler;\n    let server;\n    let page;\n    let browser;\n    let pageErrors;\n    let consoleMessages;\n\n    beforeEach(async () => {\n      compiler = webpack(config);\n\n      server = new Server(\n        {\n          watchFiles: `${watchDir}/**/*`,\n          port,\n        },\n        compiler,\n      );\n\n      await server.start();\n\n      ({ page, browser } = await runBrowser());\n\n      pageErrors = [];\n      consoleMessages = [];\n    });\n\n    afterEach(async () => {\n      await browser.close();\n      await server.stop();\n      fs.truncateSync(file);\n    });\n\n    it(\"should reload when file content is changed\", async () => {\n      page\n        .on(\"console\", (message) => {\n          consoleMessages.push(message);\n        })\n        .on(\"pageerror\", (error) => {\n          pageErrors.push(error);\n        });\n\n      const response = await page.goto(`http://localhost:${port}/`, {\n        waitUntil: \"networkidle0\",\n      });\n\n      expect(response.status()).toMatchSnapshot(\"response status\");\n\n      expect(consoleMessages.map((message) => message.text())).toMatchSnapshot(\n        \"console messages\",\n      );\n\n      expect(pageErrors).toMatchSnapshot(\"page errors\");\n\n      // change file content\n      fs.writeFileSync(file, \"Kurosaki Ichigo\", \"utf8\");\n\n      await new Promise((resolve) => {\n        server.staticWatchers[0].on(\"change\", async (changedPath) => {\n          // page reload\n          await page.waitForNavigation({ waitUntil: \"networkidle0\" });\n\n          expect(changedPath).toBe(file);\n\n          resolve();\n        });\n      });\n    });\n  });\n\n  describe(\"should not crash if file doesn't exist\", () => {\n    const nonExistFile = path.join(watchDir, \"assets/non-exist.txt\");\n    let compiler;\n    let server;\n    let page;\n    let browser;\n    let pageErrors;\n    let consoleMessages;\n\n    beforeEach(async () => {\n      try {\n        fs.unlinkSync(nonExistFile);\n      } catch {\n        // ignore\n      }\n\n      compiler = webpack(config);\n\n      server = new Server(\n        {\n          watchFiles: nonExistFile,\n          port,\n        },\n        compiler,\n      );\n\n      await server.start();\n\n      ({ page, browser } = await runBrowser());\n\n      pageErrors = [];\n      consoleMessages = [];\n    });\n\n    afterEach(async () => {\n      await browser.close();\n      await server.stop();\n    });\n\n    it(\"should reload when file content is changed\", async () => {\n      page\n        .on(\"console\", (message) => {\n          consoleMessages.push(message);\n        })\n        .on(\"pageerror\", (error) => {\n          pageErrors.push(error);\n        });\n\n      const response = await page.goto(`http://localhost:${port}/`, {\n        waitUntil: \"networkidle0\",\n      });\n\n      expect(response.status()).toMatchSnapshot(\"response status\");\n\n      expect(consoleMessages.map((message) => message.text())).toMatchSnapshot(\n        \"console messages\",\n      );\n\n      expect(pageErrors).toMatchSnapshot(\"page errors\");\n\n      await new Promise((resolve) => {\n        server.staticWatchers[0].on(\"change\", async (changedPath) => {\n          // page reload\n          await page.waitForNavigation({ waitUntil: \"networkidle0\" });\n\n          expect(changedPath).toBe(nonExistFile);\n          resolve();\n        });\n\n        // create file content\n        setTimeout(() => {\n          fs.writeFileSync(nonExistFile, \"Kurosaki Ichigo\", \"utf8\");\n          // change file content\n          setTimeout(() => {\n            fs.writeFileSync(nonExistFile, \"Kurosaki Ichigo\", \"utf8\");\n          }, 1000);\n        }, 1000);\n      });\n    });\n  });\n\n  describe(\"should work with object with single path\", () => {\n    const file = path.join(watchDir, \"assets/example.txt\");\n    let compiler;\n    let server;\n    let page;\n    let browser;\n    let pageErrors;\n    let consoleMessages;\n\n    beforeEach(async () => {\n      compiler = webpack(config);\n\n      server = new Server(\n        {\n          watchFiles: { paths: file },\n          port,\n        },\n        compiler,\n      );\n\n      await server.start();\n\n      ({ page, browser } = await runBrowser());\n\n      pageErrors = [];\n      consoleMessages = [];\n    });\n\n    afterEach(async () => {\n      await browser.close();\n      await server.stop();\n      fs.truncateSync(file);\n    });\n\n    it(\"should reload when file content is changed\", async () => {\n      page\n        .on(\"console\", (message) => {\n          consoleMessages.push(message);\n        })\n        .on(\"pageerror\", (error) => {\n          pageErrors.push(error);\n        });\n\n      const response = await page.goto(`http://localhost:${port}/`, {\n        waitUntil: \"networkidle0\",\n      });\n\n      expect(response.status()).toMatchSnapshot(\"response status\");\n\n      expect(consoleMessages.map((message) => message.text())).toMatchSnapshot(\n        \"console messages\",\n      );\n\n      expect(pageErrors).toMatchSnapshot(\"page errors\");\n\n      // change file content\n      fs.writeFileSync(file, \"Kurosaki Ichigo\", \"utf8\");\n\n      await new Promise((resolve) => {\n        server.staticWatchers[0].on(\"change\", async (changedPath) => {\n          // page reload\n          await page.waitForNavigation({ waitUntil: \"networkidle0\" });\n\n          expect(changedPath).toBe(file);\n\n          resolve();\n        });\n      });\n    });\n  });\n\n  describe(\"should work with object with multiple paths\", () => {\n    const file = path.join(watchDir, \"assets/example.txt\");\n    const other = path.join(watchDir, \"assets/other.txt\");\n    let compiler;\n    let server;\n    let page;\n    let browser;\n    let pageErrors;\n    let consoleMessages;\n\n    beforeEach(async () => {\n      compiler = webpack(config);\n\n      server = new Server(\n        {\n          watchFiles: { paths: [file, other] },\n          port,\n        },\n        compiler,\n      );\n\n      await server.start();\n\n      ({ page, browser } = await runBrowser());\n\n      pageErrors = [];\n      consoleMessages = [];\n    });\n\n    afterEach(async () => {\n      await browser.close();\n      await server.stop();\n      fs.truncateSync(file);\n      fs.truncateSync(other);\n    });\n\n    it(\"should reload when file content is changed\", async () => {\n      page\n        .on(\"console\", (message) => {\n          consoleMessages.push(message);\n        })\n        .on(\"pageerror\", (error) => {\n          pageErrors.push(error);\n        });\n\n      const response = await page.goto(`http://localhost:${port}/`, {\n        waitUntil: \"networkidle0\",\n      });\n\n      expect(response.status()).toMatchSnapshot(\"response status\");\n\n      expect(consoleMessages.map((message) => message.text())).toMatchSnapshot(\n        \"console messages\",\n      );\n\n      expect(pageErrors).toMatchSnapshot(\"page errors\");\n\n      // change file content\n      fs.writeFileSync(file, \"foo\", \"utf8\");\n      fs.writeFileSync(other, \"bar\", \"utf8\");\n\n      await new Promise((resolve) => {\n        const expected = [file, other];\n        let changed = 0;\n\n        server.staticWatchers[0].on(\"change\", async (changedPath) => {\n          // page reload\n          await page.waitForNavigation({ waitUntil: \"networkidle0\" });\n\n          expect(expected.includes(changedPath)).toBeTruthy();\n\n          changed += 1;\n\n          if (changed === 2) {\n            resolve();\n          }\n        });\n      });\n    });\n  });\n\n  describe(\"should work with array config\", () => {\n    const file = path.join(watchDir, \"assets/example.txt\");\n    const other = path.join(watchDir, \"assets/other.txt\");\n    let compiler;\n    let server;\n    let page;\n    let browser;\n    let pageErrors;\n    let consoleMessages;\n\n    beforeEach(async () => {\n      compiler = webpack(config);\n\n      server = new Server(\n        {\n          watchFiles: [{ paths: [file] }, other],\n          port,\n        },\n        compiler,\n      );\n\n      await server.start();\n\n      ({ page, browser } = await runBrowser());\n\n      pageErrors = [];\n      consoleMessages = [];\n    });\n\n    afterEach(async () => {\n      await browser.close();\n      await server.stop();\n      fs.truncateSync(file);\n      fs.truncateSync(other);\n    });\n\n    it(\"should reload when file content is changed\", async () => {\n      page\n        .on(\"console\", (message) => {\n          consoleMessages.push(message);\n        })\n        .on(\"pageerror\", (error) => {\n          pageErrors.push(error);\n        });\n\n      const response = await page.goto(`http://localhost:${port}/`, {\n        waitUntil: \"networkidle0\",\n      });\n\n      expect(response.status()).toMatchSnapshot(\"response status\");\n\n      expect(consoleMessages.map((message) => message.text())).toMatchSnapshot(\n        \"console messages\",\n      );\n\n      expect(pageErrors).toMatchSnapshot(\"page errors\");\n\n      // change file content\n      fs.writeFileSync(file, \"foo\", \"utf8\");\n      fs.writeFileSync(other, \"bar\", \"utf8\");\n\n      await new Promise((resolve) => {\n        let changed = 0;\n\n        server.staticWatchers[0].on(\"change\", async (changedPath) => {\n          // page reload\n          await page.waitForNavigation({ waitUntil: \"networkidle0\" });\n\n          expect(changedPath).toBe(file);\n\n          changed += 1;\n\n          if (changed === 2) {\n            resolve();\n          }\n        });\n        server.staticWatchers[1].on(\"change\", async (changedPath) => {\n          // page reload\n          await page.waitForNavigation({ waitUntil: \"networkidle0\" });\n\n          expect(changedPath).toBe(other);\n\n          changed += 1;\n\n          if (changed === 2) {\n            resolve();\n          }\n        });\n      });\n    });\n  });\n\n  describe(\"should work with options\", () => {\n    const file = path.join(watchDir, \"assets/example.txt\");\n\n    const chokidarMock = jest.spyOn(chokidar, \"watch\");\n\n    const optionCases = [\n      {\n        poll: true,\n      },\n      {\n        poll: 200,\n      },\n      {\n        usePolling: true,\n      },\n      {\n        usePolling: true,\n        poll: 200,\n      },\n      {\n        usePolling: false,\n      },\n      {\n        usePolling: false,\n        poll: 200,\n      },\n      {\n        usePolling: false,\n        poll: true,\n      },\n      {\n        interval: 400,\n        poll: 200,\n      },\n      {\n        usePolling: true,\n        interval: 200,\n        poll: 400,\n      },\n      {\n        usePolling: false,\n        interval: 200,\n        poll: 400,\n      },\n    ];\n\n    for (const optionCase of optionCases) {\n      describe(JSON.stringify(optionCase), () => {\n        let compiler;\n        let server;\n        let page;\n        let browser;\n        let pageErrors;\n        let consoleMessages;\n\n        beforeEach(async () => {\n          chokidarMock.mockClear();\n\n          compiler = webpack(config);\n\n          server = new Server(\n            {\n              watchFiles: {\n                paths: file,\n                options: optionCase,\n              },\n              port,\n            },\n            compiler,\n          );\n\n          await server.start();\n\n          ({ page, browser } = await runBrowser());\n\n          pageErrors = [];\n          consoleMessages = [];\n        });\n\n        afterEach(async () => {\n          await server.stop();\n          await browser.close();\n          fs.truncateSync(file);\n        });\n\n        it(\"should reload when file content is changed\", async () => {\n          page\n            .on(\"console\", (message) => {\n              consoleMessages.push(message);\n            })\n            .on(\"pageerror\", (error) => {\n              pageErrors.push(error);\n            });\n\n          const response = await page.goto(`http://localhost:${port}/`, {\n            waitUntil: \"networkidle0\",\n          });\n\n          // should pass correct options to chokidar config\n          expect(chokidarMock.mock.calls[0][1]).toMatchSnapshot();\n\n          expect(response.status()).toMatchSnapshot(\"response status\");\n\n          expect(\n            consoleMessages.map((message) => message.text()),\n          ).toMatchSnapshot(\"console messages\");\n\n          expect(pageErrors).toMatchSnapshot(\"page errors\");\n\n          // change file content\n          fs.writeFileSync(file, \"Kurosaki Ichigo\", \"utf8\");\n\n          await new Promise((resolve) => {\n            server.staticWatchers[0].on(\"change\", async (changedPath) => {\n              // page reload\n              await page.waitForNavigation({ waitUntil: \"networkidle0\" });\n\n              expect(changedPath).toBe(file);\n\n              resolve();\n            });\n          });\n        });\n      });\n    }\n  });\n});\n"
  },
  {
    "path": "test/e2e/web-socket-communication.test.js",
    "content": "\"use strict\";\n\nconst webpack = require(\"webpack\");\nconst WebSocket = require(\"ws\");\nconst Server = require(\"../../lib/Server\");\nconst WebsocketServer = require(\"../../lib/servers/WebsocketServer\");\nconst config = require(\"../fixtures/client-config/webpack.config\");\nconst runBrowser = require(\"../helpers/run-browser\");\nconst port = require(\"../ports-map\")[\"web-socket-communication\"];\n\ndescribe(\"web socket communication\", () => {\n  const webSocketServers = [\"ws\", \"sockjs\"];\n\n  for (const websocketServer of webSocketServers) {\n    it(`should work and close web socket client connection when web socket server closed (\"${websocketServer}\")`, async () => {\n      WebsocketServer.heartbeatInterval = 100;\n\n      const compiler = webpack(config);\n      const devServerOptions = {\n        port,\n        webSocketServer: websocketServer,\n      };\n      const server = new Server(devServerOptions, compiler);\n\n      await server.start();\n\n      const { page, browser } = await runBrowser();\n\n      try {\n        const pageErrors = [];\n        const consoleMessages = [];\n\n        page\n          .on(\"console\", (message) => {\n            consoleMessages.push(message.text());\n          })\n          .on(\"pageerror\", (error) => {\n            pageErrors.push(error);\n          });\n\n        await page.goto(`http://localhost:${port}/`, {\n          waitUntil: \"networkidle0\",\n        });\n\n        await server.stop();\n        await new Promise((resolve) => {\n          const interval = setInterval(() => {\n            if (\n              consoleMessages.includes(\"[webpack-dev-server] Disconnected!\")\n            ) {\n              clearInterval(interval);\n\n              resolve();\n            }\n          }, 100);\n        });\n\n        expect(consoleMessages).toMatchSnapshot(\"console messages\");\n        expect(pageErrors).toMatchSnapshot(\"page errors\");\n      } finally {\n        await browser.close();\n      }\n    });\n\n    it(`should work and terminate client that is not alive (\"${websocketServer}\")`, async () => {\n      WebsocketServer.heartbeatInterval = 100;\n\n      const compiler = webpack(config);\n      const devServerOptions = {\n        port,\n        webSocketServer: websocketServer,\n      };\n      const server = new Server(devServerOptions, compiler);\n\n      await server.start();\n\n      const { page, browser } = await runBrowser();\n\n      try {\n        const pageErrors = [];\n        const consoleMessages = [];\n\n        page\n          .on(\"console\", (message) => {\n            consoleMessages.push(message);\n          })\n          .on(\"pageerror\", (error) => {\n            pageErrors.push(error);\n          });\n\n        await page.goto(`http://localhost:${port}/`, {\n          waitUntil: \"networkidle0\",\n        });\n        await browser.close();\n\n        // Wait heartbeat\n        await new Promise((resolve) => {\n          setTimeout(() => {\n            resolve();\n          }, 200);\n        });\n\n        expect(server.webSocketServer.clients).toHaveLength(0);\n        expect(\n          consoleMessages.map((message) => message.text()),\n        ).toMatchSnapshot(\"console messages\");\n        expect(pageErrors).toMatchSnapshot(\"page errors\");\n      } finally {\n        await server.stop();\n      }\n    });\n\n    it(`should work and reconnect when the connection is lost (\"${websocketServer}\")`, async () => {\n      WebsocketServer.heartbeatInterval = 100;\n\n      const compiler = webpack(config);\n      const devServerOptions = {\n        port,\n        webSocketServer: websocketServer,\n      };\n      const server = new Server(devServerOptions, compiler);\n\n      await server.start();\n\n      const { page, browser } = await runBrowser();\n\n      try {\n        const pageErrors = [];\n        const consoleMessages = [];\n\n        page\n          .on(\"console\", (message) => {\n            consoleMessages.push(message);\n          })\n          .on(\"pageerror\", (error) => {\n            pageErrors.push(error);\n          });\n\n        await page.goto(`http://localhost:${port}/`, {\n          waitUntil: \"networkidle0\",\n        });\n\n        await server.stop();\n        await server.start();\n\n        await page.waitForNavigation({\n          waitUntil: \"networkidle0\",\n        });\n\n        expect(\n          consoleMessages.map((message) => message.text()),\n        ).toMatchSnapshot(\"console messages\");\n        expect(pageErrors).toMatchSnapshot(\"page errors\");\n      } finally {\n        await browser.close();\n        await server.stop();\n      }\n    });\n  }\n\n  it('should work and do heartbeat using (\"ws\" web socket server)', async () => {\n    WebsocketServer.heartbeatInterval = 100;\n\n    const compiler = webpack(config);\n    const devServerOptions = {\n      port,\n      webSocketServer: \"ws\",\n    };\n    const server = new Server(devServerOptions, compiler);\n\n    await server.start();\n\n    server.webSocketServer.heartbeatInterval = 100;\n\n    let opened = false;\n    let received = false;\n\n    await new Promise((resolve, reject) => {\n      const ws = new WebSocket(`ws://localhost:${devServerOptions.port}/ws`, {\n        headers: {\n          host: `localhost:${devServerOptions.port}`,\n          origin: `http://localhost:${devServerOptions.port}`,\n        },\n      });\n\n      ws.on(\"open\", () => {\n        opened = true;\n      });\n\n      ws.on(\"error\", (error) => {\n        reject(error);\n      });\n\n      ws.on(\"ping\", () => {\n        if (opened && received) {\n          ws.close();\n        }\n      });\n\n      ws.on(\"message\", (data) => {\n        const message = JSON.parse(data);\n\n        if (message.type === \"ok\") {\n          received = true;\n        }\n      });\n\n      ws.on(\"close\", () => {\n        resolve();\n      });\n    });\n\n    expect(opened).toBe(true);\n    expect(received).toBe(true);\n\n    await server.stop();\n  });\n});\n"
  },
  {
    "path": "test/e2e/web-socket-server-url.test.js",
    "content": "\"use strict\";\n\nconst express = require(\"express\");\nconst { createProxyMiddleware } = require(\"http-proxy-middleware\");\nconst webpack = require(\"webpack\");\nconst Server = require(\"../../lib/Server\");\nconst config = require(\"../fixtures/client-config/webpack.config\");\nconst runBrowser = require(\"../helpers/run-browser\");\nconst sessionSubscribe = require(\"../helpers/session-subscribe\");\nconst [port1, port2] = require(\"../ports-map\")[\"web-socket-server-url\"];\n\nconst webSocketServers = [\"ws\", \"sockjs\"];\n\ndescribe(\"web socket server URL\", () => {\n  for (const webSocketServer of webSocketServers) {\n    const websocketURLProtocol = webSocketServer === \"ws\" ? \"ws\" : \"http\";\n\n    it(`should work behind proxy, when hostnames are same and ports are different (\"${webSocketServer}\")`, async () => {\n      const devServerHost = \"127.0.0.1\";\n      const devServerPort = port1;\n      const proxyHost = devServerHost;\n      const proxyPort = port2;\n\n      const compiler = webpack(config);\n      const devServerOptions = {\n        webSocketServer,\n        port: devServerPort,\n        host: devServerHost,\n        allowedHosts: \"all\",\n      };\n      const server = new Server(devServerOptions, compiler);\n\n      await server.start();\n\n      function startProxy(callback) {\n        const app = express();\n        app.use(\n          \"/\",\n          createProxyMiddleware({\n            target: `http://${devServerHost}:${devServerPort}`,\n            ws: true,\n            changeOrigin: true,\n            logLevel: \"warn\",\n          }),\n        );\n\n        return app.listen(proxyPort, proxyHost, callback);\n      }\n\n      const proxy = await new Promise((resolve) => {\n        const proxyCreated = startProxy(() => {\n          resolve(proxyCreated);\n        });\n      });\n\n      const { page, browser } = await runBrowser();\n\n      try {\n        const pageErrors = [];\n        const consoleMessages = [];\n\n        page\n          .on(\"console\", (message) => {\n            consoleMessages.push(message);\n          })\n          .on(\"pageerror\", (error) => {\n            pageErrors.push(error);\n          });\n\n        const webSocketRequests = [];\n\n        if (webSocketServer === \"ws\") {\n          const session = await page.target().createCDPSession();\n\n          session.on(\"Network.webSocketCreated\", (test) => {\n            webSocketRequests.push(test);\n          });\n\n          await session.send(\"Target.setAutoAttach\", {\n            autoAttach: true,\n            flatten: true,\n            waitForDebuggerOnStart: true,\n          });\n\n          sessionSubscribe(session);\n        } else {\n          page.on(\"request\", (request) => {\n            if (/\\/ws\\//.test(request.url())) {\n              webSocketRequests.push({ url: request.url() });\n            }\n          });\n        }\n\n        await page.goto(`http://${proxyHost}:${proxyPort}/`, {\n          waitUntil: \"networkidle0\",\n        });\n        const [webSocketRequest] = webSocketRequests;\n\n        expect(webSocketRequest.url).toContain(\n          `${websocketURLProtocol}://${devServerHost}:${devServerPort}/ws`,\n        );\n        expect(\n          consoleMessages.map((message) => message.text()),\n        ).toMatchSnapshot(\"console messages\");\n        expect(pageErrors).toMatchSnapshot(\"page errors\");\n      } finally {\n        proxy.close();\n        await browser.close();\n        await server.stop();\n      }\n    });\n\n    it(`should work behind proxy, when hostnames are different and ports are same (\"${webSocketServer}\")`, async () => {\n      const devServerHost = \"127.0.0.1\";\n      const devServerPort = port1;\n      const proxyHost = Server.internalIPSync(\"v4\");\n      const proxyPort = port1;\n\n      const compiler = webpack(config);\n      const devServerOptions = {\n        webSocketServer,\n        port: devServerPort,\n        host: devServerHost,\n        allowedHosts: \"all\",\n      };\n      const server = new Server(devServerOptions, compiler);\n\n      await server.start();\n\n      function startProxy(callback) {\n        const app = express();\n        app.use(\n          \"/\",\n          createProxyMiddleware({\n            target: `http://${devServerHost}:${devServerPort}`,\n            ws: true,\n            changeOrigin: true,\n            logLevel: \"warn\",\n          }),\n        );\n\n        return app.listen(proxyPort, proxyHost, callback);\n      }\n\n      const proxy = await new Promise((resolve) => {\n        const proxyCreated = startProxy(() => {\n          resolve(proxyCreated);\n        });\n      });\n\n      const { page, browser } = await runBrowser();\n\n      try {\n        const pageErrors = [];\n        const consoleMessages = [];\n\n        page\n          .on(\"console\", (message) => {\n            consoleMessages.push(message);\n          })\n          .on(\"pageerror\", (error) => {\n            pageErrors.push(error);\n          });\n\n        const webSocketRequests = [];\n\n        if (webSocketServer === \"ws\") {\n          const session = await page.target().createCDPSession();\n\n          session.on(\"Network.webSocketCreated\", (test) => {\n            webSocketRequests.push(test);\n          });\n\n          await session.send(\"Target.setAutoAttach\", {\n            autoAttach: true,\n            flatten: true,\n            waitForDebuggerOnStart: true,\n          });\n\n          sessionSubscribe(session);\n        } else {\n          page.on(\"request\", (request) => {\n            if (/\\/ws\\//.test(request.url())) {\n              webSocketRequests.push({ url: request.url() });\n            }\n          });\n        }\n\n        await page.goto(`http://${proxyHost}:${proxyPort}/`, {\n          waitUntil: \"networkidle0\",\n        });\n\n        const [webSocketRequest] = webSocketRequests;\n\n        expect(webSocketRequest.url).toContain(\n          `${websocketURLProtocol}://${devServerHost}:${devServerPort}/ws`,\n        );\n        expect(\n          consoleMessages.map((message) => message.text()),\n        ).toMatchSnapshot(\"console messages\");\n        expect(pageErrors).toMatchSnapshot(\"page errors\");\n      } finally {\n        proxy.close();\n        await browser.close();\n        await server.stop();\n      }\n    });\n\n    it(`should work behind proxy, when hostnames are different and ports are different (\"${webSocketServer}\")`, async () => {\n      const devServerHost = \"localhost\";\n      const devServerPort = port1;\n      const proxyHost = Server.internalIPSync(\"v4\");\n      const proxyPort = port2;\n\n      const compiler = webpack(config);\n      const devServerOptions = {\n        client: {\n          webSocketURL: {\n            hostname: devServerHost,\n          },\n        },\n        webSocketServer,\n        port: devServerPort,\n        host: devServerHost,\n        allowedHosts: \"all\",\n      };\n      const server = new Server(devServerOptions, compiler);\n\n      await server.start();\n\n      function startProxy(callback) {\n        const app = express();\n        app.use(\n          \"/\",\n          createProxyMiddleware({\n            target: `http://${devServerHost}:${devServerPort}`,\n            ws: true,\n            changeOrigin: true,\n            logLevel: \"warn\",\n          }),\n        );\n\n        return app.listen(proxyPort, proxyHost, callback);\n      }\n\n      const proxy = await new Promise((resolve) => {\n        const proxyCreated = startProxy(() => {\n          resolve(proxyCreated);\n        });\n      });\n\n      const { page, browser } = await runBrowser();\n\n      try {\n        const pageErrors = [];\n        const consoleMessages = [];\n\n        page\n          .on(\"console\", (message) => {\n            consoleMessages.push(message);\n          })\n          .on(\"pageerror\", (error) => {\n            pageErrors.push(error);\n          });\n\n        const webSocketRequests = [];\n\n        if (webSocketServer === \"ws\") {\n          const session = await page.target().createCDPSession();\n\n          session.on(\"Network.webSocketCreated\", (test) => {\n            webSocketRequests.push(test);\n          });\n\n          await session.send(\"Target.setAutoAttach\", {\n            autoAttach: true,\n            flatten: true,\n            waitForDebuggerOnStart: true,\n          });\n\n          sessionSubscribe(session);\n        } else {\n          page.on(\"request\", (request) => {\n            if (/\\/ws\\//.test(request.url())) {\n              webSocketRequests.push({ url: request.url() });\n            }\n          });\n        }\n        await page.goto(`http://${proxyHost}:${proxyPort}/`, {\n          waitUntil: \"networkidle0\",\n        });\n\n        const [webSocketRequest] = webSocketRequests;\n\n        expect(webSocketRequest.url).toContain(\n          `${websocketURLProtocol}://${devServerHost}:${devServerPort}/ws`,\n        );\n        expect(\n          consoleMessages.map((message) => message.text()),\n        ).toMatchSnapshot(\"console messages\");\n        expect(pageErrors).toMatchSnapshot(\"page errors\");\n      } finally {\n        proxy.close();\n\n        await browser.close();\n        await server.stop();\n      }\n    });\n\n    it(`should work behind proxy, when the \"host\" option is \"local-ip\" and the \"port\" option is \"auto\" (\"${webSocketServer}\")`, async () => {\n      process.env.WEBPACK_DEV_SERVER_BASE_PORT = 40000;\n\n      const proxyHost = Server.internalIPSync(\"v4\");\n      const proxyPort = port2;\n\n      const compiler = webpack(config);\n      const devServerOptions = {\n        webSocketServer,\n        port: \"auto\",\n        host: \"local-ip\",\n        allowedHosts: \"all\",\n      };\n      const server = new Server(devServerOptions, compiler);\n\n      await server.start();\n\n      const resolvedHost = server.options.host;\n      const resolvedPort = server.options.port;\n\n      function startProxy(callback) {\n        const app = express();\n\n        app.use(\n          \"/\",\n          createProxyMiddleware({\n            target: `http://${resolvedHost}:${resolvedPort}`,\n            ws: true,\n            changeOrigin: true,\n            logLevel: \"warn\",\n          }),\n        );\n\n        return app.listen(proxyPort, proxyHost, callback);\n      }\n\n      const proxy = await new Promise((resolve) => {\n        const proxyCreated = startProxy(() => {\n          resolve(proxyCreated);\n        });\n      });\n\n      const { page, browser } = await runBrowser();\n\n      try {\n        const pageErrors = [];\n        const consoleMessages = [];\n\n        page\n          .on(\"console\", (message) => {\n            consoleMessages.push(message);\n          })\n          .on(\"pageerror\", (error) => {\n            pageErrors.push(error);\n          });\n\n        const webSocketRequests = [];\n\n        if (webSocketServer === \"ws\") {\n          const session = await page.target().createCDPSession();\n\n          session.on(\"Network.webSocketCreated\", (test) => {\n            webSocketRequests.push(test);\n          });\n\n          await session.send(\"Target.setAutoAttach\", {\n            autoAttach: true,\n            flatten: true,\n            waitForDebuggerOnStart: true,\n          });\n\n          sessionSubscribe(session);\n        } else {\n          page.on(\"request\", (request) => {\n            if (/\\/ws\\//.test(request.url())) {\n              webSocketRequests.push({ url: request.url() });\n            }\n          });\n        }\n\n        await page.goto(`http://${proxyHost}:${proxyPort}/`, {\n          waitUntil: \"networkidle0\",\n        });\n\n        const [webSocketRequest] = webSocketRequests;\n\n        expect(webSocketRequest.url).toContain(\n          `${websocketURLProtocol}://${resolvedHost}:${resolvedPort}/ws`,\n        );\n        expect(\n          consoleMessages.map((message) => message.text()),\n        ).toMatchSnapshot(\"console messages\");\n        expect(pageErrors).toMatchSnapshot(\"page errors\");\n      } finally {\n        proxy.close();\n\n        await browser.close();\n        await server.stop();\n\n        delete process.env.WEBPACK_DEV_SERVER_BASE_PORT;\n      }\n    });\n\n    it(`should work with the \"client.webSocketURL.protocol\" option (\"${webSocketServer}\")`, async () => {\n      const compiler = webpack(config);\n      const devServerOptions = {\n        client: {\n          webSocketURL: {\n            protocol: \"ws:\",\n          },\n        },\n        webSocketServer,\n        port: port1,\n        host: \"0.0.0.0\",\n        allowedHosts: \"all\",\n      };\n      const server = new Server(devServerOptions, compiler);\n\n      await server.start();\n\n      const { page, browser } = await runBrowser();\n\n      try {\n        const pageErrors = [];\n        const consoleMessages = [];\n\n        page\n          .on(\"console\", (message) => {\n            consoleMessages.push(message);\n          })\n          .on(\"pageerror\", (error) => {\n            pageErrors.push(error);\n          });\n\n        const webSocketRequests = [];\n\n        if (webSocketServer === \"ws\") {\n          const session = await page.target().createCDPSession();\n\n          session.on(\"Network.webSocketCreated\", (test) => {\n            webSocketRequests.push(test);\n          });\n\n          await session.send(\"Target.setAutoAttach\", {\n            autoAttach: true,\n            flatten: true,\n            waitForDebuggerOnStart: true,\n          });\n\n          sessionSubscribe(session);\n        } else {\n          page.on(\"request\", (request) => {\n            if (/\\/ws\\//.test(request.url())) {\n              webSocketRequests.push({ url: request.url() });\n            }\n          });\n        }\n\n        await page.goto(`http://localhost:${port1}/`, {\n          waitUntil: \"networkidle0\",\n        });\n\n        const [webSocketRequest] = webSocketRequests;\n\n        expect(webSocketRequest.url).toContain(\n          `${websocketURLProtocol}://localhost:${port1}/ws`,\n        );\n        expect(\n          consoleMessages.map((message) => message.text()),\n        ).toMatchSnapshot(\"console messages\");\n        expect(pageErrors).toMatchSnapshot(\"page errors\");\n      } finally {\n        await browser.close();\n        await server.stop();\n      }\n    });\n\n    it(`should work with the \"client.webSocketURL.protocol\" option using \"auto:\" value (\"${webSocketServer}\")`, async () => {\n      const compiler = webpack(config);\n      const devServerOptions = {\n        client: {\n          webSocketURL: {\n            protocol: \"auto:\",\n          },\n        },\n        webSocketServer,\n        port: port1,\n        host: \"0.0.0.0\",\n        allowedHosts: \"all\",\n      };\n      const server = new Server(devServerOptions, compiler);\n\n      await server.start();\n\n      const { page, browser } = await runBrowser();\n\n      try {\n        const pageErrors = [];\n        const consoleMessages = [];\n\n        page\n          .on(\"console\", (message) => {\n            consoleMessages.push(message);\n          })\n          .on(\"pageerror\", (error) => {\n            pageErrors.push(error);\n          });\n\n        const webSocketRequests = [];\n\n        if (webSocketServer === \"ws\") {\n          const session = await page.target().createCDPSession();\n\n          session.on(\"Network.webSocketCreated\", (test) => {\n            webSocketRequests.push(test);\n          });\n\n          await session.send(\"Target.setAutoAttach\", {\n            autoAttach: true,\n            flatten: true,\n            waitForDebuggerOnStart: true,\n          });\n\n          sessionSubscribe(session);\n        } else {\n          page.on(\"request\", (request) => {\n            if (/\\/ws\\//.test(request.url())) {\n              webSocketRequests.push({ url: request.url() });\n            }\n          });\n        }\n\n        await page.goto(`http://localhost:${port1}/`, {\n          waitUntil: \"networkidle0\",\n        });\n\n        const [webSocketRequest] = webSocketRequests;\n\n        expect(webSocketRequest.url).toContain(\n          `${websocketURLProtocol}://localhost:${port1}/ws`,\n        );\n        expect(\n          consoleMessages.map((message) => message.text()),\n        ).toMatchSnapshot(\"console messages\");\n        expect(pageErrors).toMatchSnapshot(\"page errors\");\n      } finally {\n        await browser.close();\n        await server.stop();\n      }\n    });\n\n    it(`should work with the \"client.webSocketURL.protocol\" option using \"http:\" value and convert to \"ws:\" (\"${webSocketServer}\")`, async () => {\n      const compiler = webpack(config);\n      const devServerOptions = {\n        client: {\n          webSocketURL: {\n            protocol: \"http:\",\n          },\n        },\n        webSocketServer,\n        port: port1,\n        host: \"0.0.0.0\",\n        allowedHosts: \"all\",\n      };\n      const server = new Server(devServerOptions, compiler);\n\n      await server.start();\n\n      const { page, browser } = await runBrowser();\n\n      try {\n        const pageErrors = [];\n        const consoleMessages = [];\n\n        page\n          .on(\"console\", (message) => {\n            consoleMessages.push(message);\n          })\n          .on(\"pageerror\", (error) => {\n            pageErrors.push(error);\n          });\n\n        const webSocketRequests = [];\n\n        if (webSocketServer === \"ws\") {\n          const session = await page.target().createCDPSession();\n\n          session.on(\"Network.webSocketCreated\", (test) => {\n            webSocketRequests.push(test);\n          });\n\n          await session.send(\"Target.setAutoAttach\", {\n            autoAttach: true,\n            flatten: true,\n            waitForDebuggerOnStart: true,\n          });\n\n          sessionSubscribe(session);\n        } else {\n          page.on(\"request\", (request) => {\n            if (/\\/ws\\//.test(request.url())) {\n              webSocketRequests.push({ url: request.url() });\n            }\n          });\n        }\n\n        await page.goto(`http://localhost:${port1}/`, {\n          waitUntil: \"networkidle0\",\n        });\n\n        const [webSocketRequest] = webSocketRequests;\n\n        expect(webSocketRequest.url).toContain(\n          `${websocketURLProtocol}://localhost:${port1}/ws`,\n        );\n        expect(\n          consoleMessages.map((message) => message.text()),\n        ).toMatchSnapshot(\"console messages\");\n        expect(pageErrors).toMatchSnapshot(\"page errors\");\n      } finally {\n        await browser.close();\n        await server.stop();\n      }\n    });\n\n    it(`should work with the \"client.webSocketURL.host\" option (\"${webSocketServer}\")`, async () => {\n      const compiler = webpack(config);\n      const devServerOptions = {\n        client: {\n          webSocketURL: {\n            hostname: \"127.0.0.1\",\n          },\n        },\n        webSocketServer,\n        port: port1,\n        host: \"0.0.0.0\",\n        allowedHosts: \"all\",\n      };\n      const server = new Server(devServerOptions, compiler);\n\n      await server.start();\n\n      const { page, browser } = await runBrowser();\n\n      try {\n        const pageErrors = [];\n        const consoleMessages = [];\n\n        page\n          .on(\"console\", (message) => {\n            consoleMessages.push(message);\n          })\n          .on(\"pageerror\", (error) => {\n            pageErrors.push(error);\n          });\n\n        const webSocketRequests = [];\n\n        if (webSocketServer === \"ws\") {\n          const session = await page.target().createCDPSession();\n\n          session.on(\"Network.webSocketCreated\", (test) => {\n            webSocketRequests.push(test);\n          });\n\n          await session.send(\"Target.setAutoAttach\", {\n            autoAttach: true,\n            flatten: true,\n            waitForDebuggerOnStart: true,\n          });\n\n          sessionSubscribe(session);\n        } else {\n          page.on(\"request\", (request) => {\n            if (/\\/ws\\//.test(request.url())) {\n              webSocketRequests.push({ url: request.url() });\n            }\n          });\n        }\n\n        await page.goto(`http://127.0.0.1:${port1}/`, {\n          waitUntil: \"networkidle0\",\n        });\n\n        const [webSocketRequest] = webSocketRequests;\n\n        expect(webSocketRequest.url).toContain(\n          `${websocketURLProtocol}://127.0.0.1:${port1}/ws`,\n        );\n        expect(\n          consoleMessages.map((message) => message.text()),\n        ).toMatchSnapshot(\"console messages\");\n        expect(pageErrors).toMatchSnapshot(\"page errors\");\n      } finally {\n        await browser.close();\n        await server.stop();\n      }\n    });\n\n    it(`should work with the \"client.webSocketURL.host\" option using \"0.0.0.0\" value (\"${webSocketServer}\")`, async () => {\n      const compiler = webpack(config);\n      const devServerOptions = {\n        client: {\n          webSocketURL: {\n            hostname: \"0.0.0.0\",\n          },\n        },\n        webSocketServer,\n        port: port1,\n        host: \"0.0.0.0\",\n        allowedHosts: \"all\",\n      };\n      const server = new Server(devServerOptions, compiler);\n\n      await server.start();\n\n      const { page, browser } = await runBrowser();\n\n      try {\n        const pageErrors = [];\n        const consoleMessages = [];\n\n        page\n          .on(\"console\", (message) => {\n            consoleMessages.push(message);\n          })\n          .on(\"pageerror\", (error) => {\n            pageErrors.push(error);\n          });\n\n        const webSocketRequests = [];\n\n        if (webSocketServer === \"ws\") {\n          const session = await page.target().createCDPSession();\n\n          session.on(\"Network.webSocketCreated\", (test) => {\n            webSocketRequests.push(test);\n          });\n\n          await session.send(\"Target.setAutoAttach\", {\n            autoAttach: true,\n            flatten: true,\n            waitForDebuggerOnStart: true,\n          });\n\n          sessionSubscribe(session);\n        } else {\n          page.on(\"request\", (request) => {\n            if (/\\/ws\\//.test(request.url())) {\n              webSocketRequests.push({ url: request.url() });\n            }\n          });\n        }\n        await page.goto(`http://127.0.0.1:${port1}/`, {\n          waitUntil: \"networkidle0\",\n        });\n\n        const [webSocketRequest] = webSocketRequests;\n\n        expect(webSocketRequest.url).toContain(\n          `${websocketURLProtocol}://127.0.0.1:${port1}/ws`,\n        );\n        expect(\n          consoleMessages.map((message) => message.text()),\n        ).toMatchSnapshot(\"console messages\");\n        expect(pageErrors).toMatchSnapshot(\"page errors\");\n      } finally {\n        await browser.close();\n        await server.stop();\n      }\n    });\n\n    it(`should work with the \"client.webSocketURL.port\" option (\"${webSocketServer}\")`, async () => {\n      const compiler = webpack(config);\n      const devServerOptions = {\n        client: {\n          webSocketURL: {\n            port: port1,\n          },\n        },\n        webSocketServer,\n        port: port1,\n        host: \"0.0.0.0\",\n        allowedHosts: \"all\",\n      };\n      const server = new Server(devServerOptions, compiler);\n\n      await server.start();\n\n      const { page, browser } = await runBrowser();\n\n      try {\n        const pageErrors = [];\n        const consoleMessages = [];\n\n        page\n          .on(\"console\", (message) => {\n            consoleMessages.push(message);\n          })\n          .on(\"pageerror\", (error) => {\n            pageErrors.push(error);\n          });\n\n        const webSocketRequests = [];\n\n        if (webSocketServer === \"ws\") {\n          const session = await page.target().createCDPSession();\n\n          session.on(\"Network.webSocketCreated\", (test) => {\n            webSocketRequests.push(test);\n          });\n\n          await session.send(\"Target.setAutoAttach\", {\n            autoAttach: true,\n            flatten: true,\n            waitForDebuggerOnStart: true,\n          });\n\n          sessionSubscribe(session);\n        } else {\n          page.on(\"request\", (request) => {\n            if (/\\/ws\\//.test(request.url())) {\n              webSocketRequests.push({ url: request.url() });\n            }\n          });\n        }\n\n        await page.goto(`http://127.0.0.1:${port1}/`, {\n          waitUntil: \"networkidle0\",\n        });\n\n        const [webSocketRequest] = webSocketRequests;\n\n        expect(webSocketRequest.url).toContain(\n          `${websocketURLProtocol}://127.0.0.1:${port1}/ws`,\n        );\n        expect(\n          consoleMessages.map((message) => message.text()),\n        ).toMatchSnapshot(\"console messages\");\n        expect(pageErrors).toMatchSnapshot(\"page errors\");\n      } finally {\n        await browser.close();\n        await server.stop();\n      }\n    });\n\n    it(`should work with the \"client.webSocketURL.port\" option as string (\"${webSocketServer}\")`, async () => {\n      const compiler = webpack(config);\n      const devServerOptions = {\n        client: {\n          webSocketURL: {\n            port: `${port1}`,\n          },\n        },\n        webSocketServer,\n        port: port1,\n        host: \"0.0.0.0\",\n        allowedHosts: \"all\",\n      };\n      const server = new Server(devServerOptions, compiler);\n\n      await server.start();\n\n      const { page, browser } = await runBrowser();\n\n      try {\n        const pageErrors = [];\n        const consoleMessages = [];\n\n        page\n          .on(\"console\", (message) => {\n            consoleMessages.push(message);\n          })\n          .on(\"pageerror\", (error) => {\n            pageErrors.push(error);\n          });\n\n        const webSocketRequests = [];\n\n        if (webSocketServer === \"ws\") {\n          const session = await page.target().createCDPSession();\n\n          session.on(\"Network.webSocketCreated\", (test) => {\n            webSocketRequests.push(test);\n          });\n\n          await session.send(\"Target.setAutoAttach\", {\n            autoAttach: true,\n            flatten: true,\n            waitForDebuggerOnStart: true,\n          });\n\n          sessionSubscribe(session);\n        } else {\n          page.on(\"request\", (request) => {\n            if (/\\/ws\\//.test(request.url())) {\n              webSocketRequests.push({ url: request.url() });\n            }\n          });\n        }\n\n        await page.goto(`http://127.0.0.1:${port1}/`, {\n          waitUntil: \"networkidle0\",\n        });\n\n        const [webSocketRequest] = webSocketRequests;\n\n        expect(webSocketRequest.url).toContain(\n          `${websocketURLProtocol}://127.0.0.1:${port1}/ws`,\n        );\n        expect(\n          consoleMessages.map((message) => message.text()),\n        ).toMatchSnapshot(\"console messages\");\n        expect(pageErrors).toMatchSnapshot(\"page errors\");\n      } finally {\n        await browser.close();\n        await server.stop();\n      }\n    });\n\n    it(`should work with \"client.webSocketURL.port\" and \"webSocketServer.options.port\" options as string (\"${webSocketServer}\")`, async () => {\n      const compiler = webpack(config);\n      const devServerOptions = {\n        webSocketServer: {\n          type: webSocketServer,\n          options: {\n            host: \"0.0.0.0\",\n            // \"sockjs\" doesn't support external server\n            port: webSocketServer === \"sockjs\" ? `${port1}` : `${port2}`,\n          },\n        },\n        port: port1,\n        host: \"0.0.0.0\",\n        client: {\n          webSocketURL: {\n            port: webSocketServer === \"sockjs\" ? `${port1}` : `${port2}`,\n          },\n        },\n        allowedHosts: \"all\",\n      };\n      const server = new Server(devServerOptions, compiler);\n\n      await server.start();\n\n      const { page, browser } = await runBrowser();\n\n      try {\n        const pageErrors = [];\n        const consoleMessages = [];\n\n        page\n          .on(\"console\", (message) => {\n            consoleMessages.push(message);\n          })\n          .on(\"pageerror\", (error) => {\n            pageErrors.push(error);\n          });\n\n        const webSocketRequests = [];\n\n        if (webSocketServer === \"ws\") {\n          const session = await page.target().createCDPSession();\n\n          session.on(\"Network.webSocketCreated\", (test) => {\n            webSocketRequests.push(test);\n          });\n\n          await session.send(\"Target.setAutoAttach\", {\n            autoAttach: true,\n            flatten: true,\n            waitForDebuggerOnStart: true,\n          });\n\n          sessionSubscribe(session);\n        } else {\n          page.on(\"request\", (request) => {\n            if (/\\/ws\\//.test(request.url())) {\n              webSocketRequests.push({ url: request.url() });\n            }\n          });\n        }\n\n        await page.goto(`http://127.0.0.1:${port1}/`, {\n          waitUntil: \"networkidle0\",\n        });\n\n        const [webSocketRequest] = webSocketRequests;\n\n        expect(webSocketRequest.url).toContain(\n          webSocketServer === \"sockjs\"\n            ? `${websocketURLProtocol}://127.0.0.1:${port1}/ws`\n            : `${websocketURLProtocol}://127.0.0.1:${port2}/ws`,\n        );\n        expect(\n          consoleMessages.map((message) => message.text()),\n        ).toMatchSnapshot(\"console messages\");\n        expect(pageErrors).toMatchSnapshot(\"page errors\");\n      } finally {\n        await browser.close();\n        await server.stop();\n      }\n    });\n\n    it(`should work with the \"client.webSocketURL.port\" option using \"0\" value (\"${webSocketServer}\")`, async () => {\n      const compiler = webpack(config);\n      const devServerOptions = {\n        client: {\n          webSocketURL: {\n            port: 0,\n          },\n        },\n        webSocketServer,\n        port: port1,\n        host: \"0.0.0.0\",\n        allowedHosts: \"all\",\n      };\n      const server = new Server(devServerOptions, compiler);\n\n      await server.start();\n\n      const { page, browser } = await runBrowser();\n\n      try {\n        const pageErrors = [];\n        const consoleMessages = [];\n\n        page\n          .on(\"console\", (message) => {\n            consoleMessages.push(message);\n          })\n          .on(\"pageerror\", (error) => {\n            pageErrors.push(error);\n          });\n\n        const webSocketRequests = [];\n\n        if (webSocketServer === \"ws\") {\n          const session = await page.target().createCDPSession();\n\n          session.on(\"Network.webSocketCreated\", (test) => {\n            webSocketRequests.push(test);\n          });\n\n          await session.send(\"Target.setAutoAttach\", {\n            autoAttach: true,\n            flatten: true,\n            waitForDebuggerOnStart: true,\n          });\n\n          sessionSubscribe(session);\n        } else {\n          page.on(\"request\", (request) => {\n            if (/\\/ws\\//.test(request.url())) {\n              webSocketRequests.push({ url: request.url() });\n            }\n          });\n        }\n        await page.goto(`http://127.0.0.1:${port1}/`, {\n          waitUntil: \"networkidle0\",\n        });\n\n        const [webSocketRequest] = webSocketRequests;\n\n        expect(webSocketRequest.url).toContain(\n          `${websocketURLProtocol}://127.0.0.1:${port1}/ws`,\n        );\n        expect(\n          consoleMessages.map((message) => message.text()),\n        ).toMatchSnapshot(\"console messages\");\n        expect(pageErrors).toMatchSnapshot(\"page errors\");\n      } finally {\n        await browser.close();\n        await server.stop();\n      }\n    });\n\n    it(`should work with the \"client.webSocketURL.pathname\" option (\"${webSocketServer}\")`, async () => {\n      const compiler = webpack(config);\n      const devServerOptions = {\n        client: {\n          webSocketURL: {\n            pathname: \"/ws\",\n          },\n        },\n        webSocketServer,\n        port: port1,\n        host: \"0.0.0.0\",\n        allowedHosts: \"all\",\n      };\n      const server = new Server(devServerOptions, compiler);\n\n      await server.start();\n\n      const { page, browser } = await runBrowser();\n\n      try {\n        const pageErrors = [];\n        const consoleMessages = [];\n\n        page\n          .on(\"console\", (message) => {\n            consoleMessages.push(message);\n          })\n          .on(\"pageerror\", (error) => {\n            pageErrors.push(error);\n          });\n\n        const webSocketRequests = [];\n\n        if (webSocketServer === \"ws\") {\n          const session = await page.target().createCDPSession();\n\n          session.on(\"Network.webSocketCreated\", (test) => {\n            webSocketRequests.push(test);\n          });\n\n          await session.send(\"Target.setAutoAttach\", {\n            autoAttach: true,\n            flatten: true,\n            waitForDebuggerOnStart: true,\n          });\n\n          sessionSubscribe(session);\n        } else {\n          page.on(\"request\", (request) => {\n            if (/\\/ws\\//.test(request.url())) {\n              webSocketRequests.push({ url: request.url() });\n            }\n          });\n        }\n\n        await page.goto(`http://127.0.0.1:${port1}/`, {\n          waitUntil: \"networkidle0\",\n        });\n\n        const [webSocketRequest] = webSocketRequests;\n\n        expect(webSocketRequest.url).toContain(\n          `${websocketURLProtocol}://127.0.0.1:${port1}/ws`,\n        );\n        expect(\n          consoleMessages.map((message) => message.text()),\n        ).toMatchSnapshot(\"console messages\");\n        expect(pageErrors).toMatchSnapshot(\"page errors\");\n      } finally {\n        await browser.close();\n        await server.stop();\n      }\n    });\n\n    it(`should work with default \"/ws\" value of the \"client.webSocketURL.pathname\" option (\"${webSocketServer}\")`, async () => {\n      const compiler = webpack(config);\n      const devServerOptions = {\n        webSocketServer,\n        port: port1,\n        host: \"0.0.0.0\",\n        allowedHosts: \"all\",\n      };\n      const server = new Server(devServerOptions, compiler);\n\n      await server.start();\n\n      const { page, browser } = await runBrowser();\n\n      try {\n        const pageErrors = [];\n        const consoleMessages = [];\n\n        page\n          .on(\"console\", (message) => {\n            consoleMessages.push(message);\n          })\n          .on(\"pageerror\", (error) => {\n            pageErrors.push(error);\n          });\n\n        const webSocketRequests = [];\n\n        if (webSocketServer === \"ws\") {\n          const session = await page.target().createCDPSession();\n\n          session.on(\"Network.webSocketCreated\", (test) => {\n            webSocketRequests.push(test);\n          });\n\n          await session.send(\"Target.setAutoAttach\", {\n            autoAttach: true,\n            flatten: true,\n            waitForDebuggerOnStart: true,\n          });\n\n          sessionSubscribe(session);\n        } else {\n          page.on(\"request\", (request) => {\n            if (/\\/ws\\//.test(request.url())) {\n              webSocketRequests.push({ url: request.url() });\n            }\n          });\n        }\n\n        await page.goto(`http://127.0.0.1:${port1}/`, {\n          waitUntil: \"networkidle0\",\n        });\n\n        const [webSocketRequest] = webSocketRequests;\n\n        expect(webSocketRequest.url).toContain(\n          `${websocketURLProtocol}://127.0.0.1:${port1}/ws`,\n        );\n        expect(\n          consoleMessages.map((message) => message.text()),\n        ).toMatchSnapshot(\"console messages\");\n        expect(pageErrors).toMatchSnapshot(\"page errors\");\n      } finally {\n        await browser.close();\n        await server.stop();\n      }\n    });\n\n    it(`should work with the \"client.webSocketURL.username\" option (\"${webSocketServer}\")`, async () => {\n      const compiler = webpack(config);\n      const devServerOptions = {\n        client: {\n          webSocketURL: {\n            username: \"zenitsu\",\n          },\n        },\n        webSocketServer,\n        port: port1,\n        host: \"0.0.0.0\",\n        allowedHosts: \"all\",\n      };\n      const server = new Server(devServerOptions, compiler);\n\n      await server.start();\n\n      const { page, browser } = await runBrowser();\n\n      try {\n        const pageErrors = [];\n        const consoleMessages = [];\n\n        page\n          .on(\"console\", (message) => {\n            consoleMessages.push(message);\n          })\n          .on(\"pageerror\", (error) => {\n            pageErrors.push(error);\n          });\n\n        const webSocketRequests = [];\n\n        if (webSocketServer === \"ws\") {\n          const session = await page.target().createCDPSession();\n\n          session.on(\"Network.webSocketCreated\", (test) => {\n            webSocketRequests.push(test);\n          });\n\n          await session.send(\"Target.setAutoAttach\", {\n            autoAttach: true,\n            flatten: true,\n            waitForDebuggerOnStart: true,\n          });\n\n          sessionSubscribe(session);\n        } else {\n          page.on(\"request\", (request) => {\n            if (/\\/ws\\//.test(request.url())) {\n              webSocketRequests.push({ url: request.url() });\n            }\n          });\n        }\n        await page.goto(`http://127.0.0.1:${port1}/`, {\n          waitUntil: \"networkidle0\",\n        });\n\n        const [webSocketRequest] = webSocketRequests;\n\n        expect(webSocketRequest.url).toContain(\n          `${websocketURLProtocol}://zenitsu@127.0.0.1:${port1}/ws`,\n        );\n        expect(\n          consoleMessages.map((message) => message.text()),\n        ).toMatchSnapshot(\"console messages\");\n        expect(pageErrors).toMatchSnapshot(\"page errors\");\n      } finally {\n        await browser.close();\n        await server.stop();\n      }\n    });\n\n    it(`should work with the \"client.webSocketURL.password\" option (\"${webSocketServer}\")`, async () => {\n      const compiler = webpack(config);\n      const devServerOptions = {\n        client: {\n          webSocketURL:\n            webSocketServer === \"ws\"\n              ? {\n                  username: \"foo\",\n                  password: \"chuntaro\",\n                }\n              : {},\n        },\n        webSocketServer,\n        port: port1,\n        host: \"0.0.0.0\",\n        allowedHosts: \"all\",\n      };\n      const server = new Server(devServerOptions, compiler);\n\n      await server.start();\n\n      const { page, browser } = await runBrowser();\n\n      try {\n        const pageErrors = [];\n        const consoleMessages = [];\n\n        page\n          .on(\"console\", (message) => {\n            consoleMessages.push(message);\n          })\n          .on(\"pageerror\", (error) => {\n            pageErrors.push(error);\n          });\n\n        const webSocketRequests = [];\n\n        if (webSocketServer === \"ws\") {\n          const session = await page.target().createCDPSession();\n\n          session.on(\"Network.webSocketCreated\", (test) => {\n            webSocketRequests.push(test);\n          });\n\n          await session.send(\"Target.setAutoAttach\", {\n            autoAttach: true,\n            flatten: true,\n            waitForDebuggerOnStart: true,\n          });\n\n          sessionSubscribe(session);\n        } else {\n          page.on(\"request\", (request) => {\n            if (/\\/ws\\//.test(request.url())) {\n              webSocketRequests.push({ url: request.url() });\n            }\n          });\n        }\n        await page.goto(`http://127.0.0.1:${port1}/`, {\n          waitUntil: \"networkidle0\",\n        });\n\n        const [webSocketRequest] = webSocketRequests;\n\n        expect(webSocketRequest.url).toContain(\n          // \"sockjs\" has bug with parsing URL\n          webSocketServer === \"ws\"\n            ? `${websocketURLProtocol}://foo:chuntaro@127.0.0.1:${port1}/ws`\n            : `${websocketURLProtocol}://127.0.0.1:${port1}/ws`,\n        );\n        expect(\n          consoleMessages.map((message) => message.text()),\n        ).toMatchSnapshot(\"console messages\");\n        expect(pageErrors).toMatchSnapshot(\"page errors\");\n      } finally {\n        await browser.close();\n        await server.stop();\n      }\n    });\n\n    it(`should work with the \"client.webSocketURL.username\" and \"client.webSocketURL.password\" option (\"${webSocketServer}\")`, async () => {\n      const compiler = webpack(config);\n      const devServerOptions = {\n        client: {\n          webSocketURL: {\n            username: \"zenitsu\",\n            password: \"chuntaro\",\n          },\n        },\n        webSocketServer,\n        port: port1,\n        host: \"0.0.0.0\",\n        allowedHosts: \"all\",\n      };\n      const server = new Server(devServerOptions, compiler);\n\n      await server.start();\n\n      const { page, browser } = await runBrowser();\n\n      try {\n        const pageErrors = [];\n        const consoleMessages = [];\n\n        page\n          .on(\"console\", (message) => {\n            consoleMessages.push(message);\n          })\n          .on(\"pageerror\", (error) => {\n            pageErrors.push(error);\n          });\n\n        const webSocketRequests = [];\n\n        if (webSocketServer === \"ws\") {\n          const session = await page.target().createCDPSession();\n\n          session.on(\"Network.webSocketCreated\", (test) => {\n            webSocketRequests.push(test);\n          });\n\n          await session.send(\"Target.setAutoAttach\", {\n            autoAttach: true,\n            flatten: true,\n            waitForDebuggerOnStart: true,\n          });\n\n          sessionSubscribe(session);\n        } else {\n          page.on(\"request\", (request) => {\n            if (/\\/ws\\//.test(request.url())) {\n              webSocketRequests.push({ url: request.url() });\n            }\n          });\n        }\n\n        await page.goto(`http://127.0.0.1:${port1}/`, {\n          waitUntil: \"networkidle0\",\n        });\n\n        const [webSocketRequest] = webSocketRequests;\n\n        expect(webSocketRequest.url).toContain(\n          `${websocketURLProtocol}://zenitsu:chuntaro@127.0.0.1:${port1}/ws`,\n        );\n        expect(\n          consoleMessages.map((message) => message.text()),\n        ).toMatchSnapshot(\"console messages\");\n        expect(pageErrors).toMatchSnapshot(\"page errors\");\n      } finally {\n        await browser.close();\n        await server.stop();\n      }\n    });\n\n    it(`should work with the custom web socket server \"path\" (\"${webSocketServer}\")`, async () => {\n      const compiler = webpack(config);\n      const devServerOptions = {\n        webSocketServer: {\n          type: webSocketServer,\n          options: {\n            path: \"/custom-ws/foo/bar\",\n          },\n        },\n        port: port1,\n        host: \"0.0.0.0\",\n        allowedHosts: \"all\",\n      };\n      const server = new Server(devServerOptions, compiler);\n\n      await server.start();\n\n      const { page, browser } = await runBrowser();\n\n      try {\n        const pageErrors = [];\n        const consoleMessages = [];\n\n        page\n          .on(\"console\", (message) => {\n            consoleMessages.push(message);\n          })\n          .on(\"pageerror\", (error) => {\n            pageErrors.push(error);\n          });\n\n        const webSocketRequests = [];\n\n        if (webSocketServer === \"ws\") {\n          const session = await page.target().createCDPSession();\n\n          session.on(\"Network.webSocketCreated\", (test) => {\n            webSocketRequests.push(test);\n          });\n\n          await session.send(\"Target.setAutoAttach\", {\n            autoAttach: true,\n            flatten: true,\n            waitForDebuggerOnStart: true,\n          });\n\n          sessionSubscribe(session);\n        } else {\n          page.on(\"request\", (request) => {\n            if (/\\/custom-ws\\/foo\\/bar/.test(request.url())) {\n              webSocketRequests.push({ url: request.url() });\n            }\n          });\n        }\n\n        await page.goto(`http://127.0.0.1:${port1}/`, {\n          waitUntil: \"networkidle0\",\n        });\n\n        const [webSocketRequest] = webSocketRequests;\n\n        expect(webSocketRequest.url).toContain(\n          `${websocketURLProtocol}://127.0.0.1:${port1}/custom-ws/foo/bar`,\n        );\n        expect(\n          consoleMessages.map((message) => message.text()),\n        ).toMatchSnapshot(\"console messages\");\n        expect(pageErrors).toMatchSnapshot(\"page errors\");\n      } finally {\n        await browser.close();\n        await server.stop();\n      }\n    });\n\n    // Only works for \"ws\" server\n    it(`should work with the custom web socket server \"path\" using empty value (\"${webSocketServer}\")`, async () => {\n      const compiler = webpack(config);\n      const devServerOptions = {\n        webSocketServer: {\n          type: webSocketServer,\n          options: {\n            path: webSocketServer === \"ws\" ? \"\" : \"/custom-ws\",\n          },\n        },\n        port: port1,\n        host: \"0.0.0.0\",\n        allowedHosts: \"all\",\n      };\n      const server = new Server(devServerOptions, compiler);\n\n      await server.start();\n\n      const { page, browser } = await runBrowser();\n\n      try {\n        const pageErrors = [];\n        const consoleMessages = [];\n\n        page\n          .on(\"console\", (message) => {\n            consoleMessages.push(message);\n          })\n          .on(\"pageerror\", (error) => {\n            pageErrors.push(error);\n          });\n\n        const webSocketRequests = [];\n\n        if (webSocketServer === \"ws\") {\n          const session = await page.target().createCDPSession();\n\n          session.on(\"Network.webSocketCreated\", (test) => {\n            webSocketRequests.push(test);\n          });\n\n          await session.send(\"Target.setAutoAttach\", {\n            autoAttach: true,\n            flatten: true,\n            waitForDebuggerOnStart: true,\n          });\n\n          sessionSubscribe(session);\n        } else {\n          page.on(\"request\", (request) => {\n            if (/\\/custom-ws\\//.test(request.url())) {\n              webSocketRequests.push({ url: request.url() });\n            }\n          });\n        }\n\n        await page.goto(`http://127.0.0.1:${port1}/`, {\n          waitUntil: \"networkidle0\",\n        });\n\n        const [webSocketRequest] = webSocketRequests;\n\n        expect(webSocketRequest.url).toContain(\n          webSocketServer === \"ws\"\n            ? `${websocketURLProtocol}://127.0.0.1:${port1}`\n            : `${websocketURLProtocol}://127.0.0.1:${port1}/custom-ws`,\n        );\n        expect(\n          consoleMessages.map((message) => message.text()),\n        ).toMatchSnapshot(\"console messages\");\n        expect(pageErrors).toMatchSnapshot(\"page errors\");\n      } finally {\n        await browser.close();\n        await server.stop();\n      }\n    });\n\n    it(`should work with the \"client.webSocketURL.pathname\" option and the custom web socket server \"path\" (\"${webSocketServer}\")`, async () => {\n      const compiler = webpack(config);\n      const devServerOptions = {\n        client: {\n          webSocketURL: {\n            pathname: \"/custom-ws/foo/bar\",\n          },\n        },\n        webSocketServer: {\n          type: webSocketServer,\n          options: {\n            path: \"/custom-ws/foo/bar\",\n          },\n        },\n        port: port1,\n        host: \"0.0.0.0\",\n        allowedHosts: \"all\",\n      };\n      const server = new Server(devServerOptions, compiler);\n\n      await server.start();\n\n      const { page, browser } = await runBrowser();\n\n      try {\n        const pageErrors = [];\n        const consoleMessages = [];\n\n        page\n          .on(\"console\", (message) => {\n            consoleMessages.push(message);\n          })\n          .on(\"pageerror\", (error) => {\n            pageErrors.push(error);\n          });\n\n        const webSocketRequests = [];\n\n        if (webSocketServer === \"ws\") {\n          const session = await page.target().createCDPSession();\n\n          session.on(\"Network.webSocketCreated\", (test) => {\n            webSocketRequests.push(test);\n          });\n\n          await session.send(\"Target.setAutoAttach\", {\n            autoAttach: true,\n            flatten: true,\n            waitForDebuggerOnStart: true,\n          });\n\n          sessionSubscribe(session);\n        } else {\n          page.on(\"request\", (request) => {\n            if (/\\/custom-ws\\/foo\\/bar/.test(request.url())) {\n              webSocketRequests.push({ url: request.url() });\n            }\n          });\n        }\n\n        await page.goto(`http://127.0.0.1:${port1}/`, {\n          waitUntil: \"networkidle0\",\n        });\n\n        const [webSocketRequest] = webSocketRequests;\n\n        expect(webSocketRequest.url).toContain(\n          `${websocketURLProtocol}://127.0.0.1:${port1}/custom-ws/foo/bar`,\n        );\n        expect(\n          consoleMessages.map((message) => message.text()),\n        ).toMatchSnapshot(\"console messages\");\n        expect(pageErrors).toMatchSnapshot(\"page errors\");\n      } finally {\n        await browser.close();\n        await server.stop();\n      }\n    });\n\n    it(`should work with the \"client.webSocketURL.pathname\" option and the custom web socket server \"path\" ending without slash (\"${webSocketServer}\")`, async () => {\n      const compiler = webpack(config);\n      const devServerOptions = {\n        client: {\n          webSocketURL: {\n            pathname: \"/custom-ws\",\n          },\n        },\n        webSocketServer: {\n          type: webSocketServer,\n          options: {\n            path: \"/custom-ws\",\n          },\n        },\n        port: port1,\n        host: \"0.0.0.0\",\n        allowedHosts: \"all\",\n      };\n      const server = new Server(devServerOptions, compiler);\n\n      await server.start();\n\n      const { page, browser } = await runBrowser();\n\n      try {\n        const pageErrors = [];\n        const consoleMessages = [];\n\n        page\n          .on(\"console\", (message) => {\n            consoleMessages.push(message);\n          })\n          .on(\"pageerror\", (error) => {\n            pageErrors.push(error);\n          });\n\n        const webSocketRequests = [];\n\n        if (webSocketServer === \"ws\") {\n          const session = await page.target().createCDPSession();\n\n          session.on(\"Network.webSocketCreated\", (test) => {\n            webSocketRequests.push(test);\n          });\n\n          await session.send(\"Target.setAutoAttach\", {\n            autoAttach: true,\n            flatten: true,\n            waitForDebuggerOnStart: true,\n          });\n\n          sessionSubscribe(session);\n        } else {\n          page.on(\"request\", (request) => {\n            if (/\\/custom-ws\\//.test(request.url())) {\n              webSocketRequests.push({ url: request.url() });\n            }\n          });\n        }\n\n        await page.goto(`http://127.0.0.1:${port1}/`, {\n          waitUntil: \"networkidle0\",\n        });\n\n        const [webSocketRequest] = webSocketRequests;\n\n        expect(webSocketRequest.url).toContain(\n          `${websocketURLProtocol}://127.0.0.1:${port1}/custom-ws`,\n        );\n        expect(\n          consoleMessages.map((message) => message.text()),\n        ).toMatchSnapshot(\"console messages\");\n        expect(pageErrors).toMatchSnapshot(\"page errors\");\n      } finally {\n        await browser.close();\n        await server.stop();\n      }\n    });\n\n    // Only works for \"ws\" server, \"sockjs\" adds \"/\" be default, because need do requests like \"/custom-ws/info?t=1624462615772\"\n    it(`should work with the \"client.webSocketURL.pathname\" option and the custom web socket server \"path\" ending with slash (\"${webSocketServer}\")`, async () => {\n      const compiler = webpack(config);\n      const devServerOptions = {\n        client: {\n          webSocketURL: {\n            pathname: webSocketServer === \"ws\" ? \"/custom-ws/\" : \"/custom-ws\",\n          },\n        },\n        webSocketServer: {\n          type: webSocketServer,\n          options: {\n            path: webSocketServer === \"ws\" ? \"/custom-ws/\" : \"/custom-ws\",\n          },\n        },\n        port: port1,\n        host: \"0.0.0.0\",\n        allowedHosts: \"all\",\n      };\n      const server = new Server(devServerOptions, compiler);\n\n      await server.start();\n\n      const { page, browser } = await runBrowser();\n\n      try {\n        const pageErrors = [];\n        const consoleMessages = [];\n\n        page\n          .on(\"console\", (message) => {\n            consoleMessages.push(message);\n          })\n          .on(\"pageerror\", (error) => {\n            pageErrors.push(error);\n          });\n\n        const webSocketRequests = [];\n\n        if (webSocketServer === \"ws\") {\n          const session = await page.target().createCDPSession();\n\n          session.on(\"Network.webSocketCreated\", (test) => {\n            webSocketRequests.push(test);\n          });\n\n          await session.send(\"Target.setAutoAttach\", {\n            autoAttach: true,\n            flatten: true,\n            waitForDebuggerOnStart: true,\n          });\n\n          sessionSubscribe(session);\n        } else {\n          page.on(\"request\", (request) => {\n            if (/\\/custom-ws\\//.test(request.url())) {\n              webSocketRequests.push({ url: request.url() });\n            }\n          });\n        }\n        await page.goto(`http://127.0.0.1:${port1}/`, {\n          waitUntil: \"networkidle0\",\n        });\n\n        const [webSocketRequest] = webSocketRequests;\n\n        expect(webSocketRequest.url).toContain(\n          `${websocketURLProtocol}://127.0.0.1:${port1}/custom-ws/`,\n        );\n        expect(\n          consoleMessages.map((message) => message.text()),\n        ).toMatchSnapshot(\"console messages\");\n        expect(pageErrors).toMatchSnapshot(\"page errors\");\n      } finally {\n        await browser.close();\n        await server.stop();\n      }\n    });\n\n    // Only works for \"ws\" server\n    it(`should work with the \"client.webSocketURL.pathname\" option and the custom web socket server \"path\" using empty value (\"${webSocketServer}\")`, async () => {\n      const compiler = webpack(config);\n      const devServerOptions = {\n        client: {\n          webSocketURL: {\n            pathname: webSocketServer === \"ws\" ? \"\" : \"/custom-ws\",\n          },\n        },\n        webSocketServer: {\n          type: webSocketServer,\n          options: {\n            path: webSocketServer === \"ws\" ? \"\" : \"/custom-ws\",\n          },\n        },\n        port: port1,\n        host: \"0.0.0.0\",\n        allowedHosts: \"all\",\n      };\n      const server = new Server(devServerOptions, compiler);\n\n      await server.start();\n\n      const { page, browser } = await runBrowser();\n\n      try {\n        const pageErrors = [];\n        const consoleMessages = [];\n\n        page\n          .on(\"console\", (message) => {\n            consoleMessages.push(message);\n          })\n          .on(\"pageerror\", (error) => {\n            pageErrors.push(error);\n          });\n\n        const webSocketRequests = [];\n\n        if (webSocketServer === \"ws\") {\n          const session = await page.target().createCDPSession();\n\n          session.on(\"Network.webSocketCreated\", (test) => {\n            webSocketRequests.push(test);\n          });\n\n          await session.send(\"Target.setAutoAttach\", {\n            autoAttach: true,\n            flatten: true,\n            waitForDebuggerOnStart: true,\n          });\n\n          sessionSubscribe(session);\n        } else {\n          page.on(\"request\", (request) => {\n            if (/\\/custom-ws\\//.test(request.url())) {\n              webSocketRequests.push({ url: request.url() });\n            }\n          });\n        }\n\n        await page.goto(`http://127.0.0.1:${port1}/`, {\n          waitUntil: \"networkidle0\",\n        });\n\n        const [webSocketRequest] = webSocketRequests;\n\n        expect(webSocketRequest.url).toContain(\n          webSocketServer === \"ws\"\n            ? `${websocketURLProtocol}://127.0.0.1:${port1}`\n            : `${websocketURLProtocol}://127.0.0.1:${port1}/custom-ws`,\n        );\n        expect(\n          consoleMessages.map((message) => message.text()),\n        ).toMatchSnapshot(\"console messages\");\n        expect(pageErrors).toMatchSnapshot(\"page errors\");\n      } finally {\n        await browser.close();\n        await server.stop();\n      }\n    });\n\n    // Only works for \"sockjs\" server\n    it(`should work with the \"client.webSocketURL.pathname\" option and the custom web socket server \"prefix\" for compatibility with \"sockjs\" (\"${webSocketServer}\")`, async () => {\n      const compiler = webpack(config);\n      const devServerOptions = {\n        client: {\n          webSocketURL: {\n            pathname: \"/custom-ws\",\n          },\n        },\n        webSocketServer: {\n          type: webSocketServer,\n          options:\n            webSocketServer === \"ws\"\n              ? { path: \"/custom-ws\" }\n              : { prefix: \"/custom-ws\" },\n        },\n        port: port1,\n        host: \"0.0.0.0\",\n        allowedHosts: \"all\",\n      };\n      const server = new Server(devServerOptions, compiler);\n\n      await server.start();\n\n      const { page, browser } = await runBrowser();\n\n      try {\n        const pageErrors = [];\n        const consoleMessages = [];\n\n        page\n          .on(\"console\", (message) => {\n            consoleMessages.push(message);\n          })\n          .on(\"pageerror\", (error) => {\n            pageErrors.push(error);\n          });\n\n        const webSocketRequests = [];\n\n        if (webSocketServer === \"ws\") {\n          const session = await page.target().createCDPSession();\n\n          session.on(\"Network.webSocketCreated\", (test) => {\n            webSocketRequests.push(test);\n          });\n\n          await session.send(\"Target.setAutoAttach\", {\n            autoAttach: true,\n            flatten: true,\n            waitForDebuggerOnStart: true,\n          });\n\n          sessionSubscribe(session);\n        } else {\n          page.on(\"request\", (request) => {\n            if (/\\/custom-ws/.test(request.url())) {\n              webSocketRequests.push({ url: request.url() });\n            }\n          });\n        }\n\n        await page.goto(`http://127.0.0.1:${port1}/`, {\n          waitUntil: \"networkidle0\",\n        });\n\n        const [webSocketRequest] = webSocketRequests;\n\n        expect(webSocketRequest.url).toContain(\n          `${websocketURLProtocol}://127.0.0.1:${port1}/custom-ws`,\n        );\n        expect(\n          consoleMessages.map((message) => message.text()),\n        ).toMatchSnapshot(\"console messages\");\n        expect(pageErrors).toMatchSnapshot(\"page errors\");\n      } finally {\n        await browser.close();\n        await server.stop();\n      }\n    });\n\n    it(`should work when \"host\" option is IPv4 (\"${webSocketServer}\")`, async () => {\n      const hostname = Server.internalIPSync(\"v4\");\n      const compiler = webpack(config);\n      const devServerOptions = {\n        webSocketServer,\n        port: port1,\n        host: hostname,\n      };\n      const server = new Server(devServerOptions, compiler);\n\n      await server.start();\n\n      const { page, browser } = await runBrowser();\n\n      try {\n        const pageErrors = [];\n        const consoleMessages = [];\n\n        page\n          .on(\"console\", (message) => {\n            consoleMessages.push(message);\n          })\n          .on(\"pageerror\", (error) => {\n            pageErrors.push(error);\n          });\n\n        const webSocketRequests = [];\n\n        if (webSocketServer === \"ws\") {\n          const session = await page.target().createCDPSession();\n\n          session.on(\"Network.webSocketCreated\", (test) => {\n            webSocketRequests.push(test);\n          });\n\n          await session.send(\"Target.setAutoAttach\", {\n            autoAttach: true,\n            flatten: true,\n            waitForDebuggerOnStart: true,\n          });\n\n          sessionSubscribe(session);\n        } else {\n          page.on(\"request\", (request) => {\n            if (/\\/ws\\//.test(request.url())) {\n              webSocketRequests.push({ url: request.url() });\n            }\n          });\n        }\n        await page.goto(`http://${hostname}:${port1}/`, {\n          waitUntil: \"networkidle0\",\n        });\n\n        const [webSocketRequest] = webSocketRequests;\n\n        expect(webSocketRequest.url).toContain(\n          `${websocketURLProtocol}://${hostname}:${port1}/ws`,\n        );\n        expect(\n          consoleMessages.map((message) => message.text()),\n        ).toMatchSnapshot(\"console messages\");\n        expect(pageErrors).toMatchSnapshot(\"page errors\");\n      } finally {\n        await browser.close();\n        await server.stop();\n      }\n    });\n\n    it(`should work when \"host\" option is \"local-ip\" (\"${webSocketServer}\")`, async () => {\n      const hostname = Server.internalIPSync(\"v4\");\n      const compiler = webpack(config);\n      const devServerOptions = {\n        webSocketServer,\n        port: port1,\n        host: \"local-ip\",\n      };\n      const server = new Server(devServerOptions, compiler);\n\n      await server.start();\n\n      const { page, browser } = await runBrowser();\n\n      try {\n        const pageErrors = [];\n        const consoleMessages = [];\n\n        page\n          .on(\"console\", (message) => {\n            consoleMessages.push(message);\n          })\n          .on(\"pageerror\", (error) => {\n            pageErrors.push(error);\n          });\n\n        const webSocketRequests = [];\n\n        if (webSocketServer === \"ws\") {\n          const session = await page.target().createCDPSession();\n\n          session.on(\"Network.webSocketCreated\", (test) => {\n            webSocketRequests.push(test);\n          });\n\n          await session.send(\"Target.setAutoAttach\", {\n            autoAttach: true,\n            flatten: true,\n            waitForDebuggerOnStart: true,\n          });\n\n          sessionSubscribe(session);\n        } else {\n          page.on(\"request\", (request) => {\n            if (/\\/ws\\//.test(request.url())) {\n              webSocketRequests.push({ url: request.url() });\n            }\n          });\n        }\n\n        await page.goto(`http://${hostname}:${port1}/`, {\n          waitUntil: \"networkidle0\",\n        });\n\n        const [webSocketRequest] = webSocketRequests;\n\n        expect(webSocketRequest.url).toContain(\n          `${websocketURLProtocol}://${hostname}:${port1}/ws`,\n        );\n        expect(\n          consoleMessages.map((message) => message.text()),\n        ).toMatchSnapshot(\"console messages\");\n        expect(pageErrors).toMatchSnapshot(\"page errors\");\n      } finally {\n        await browser.close();\n        await server.stop();\n      }\n    });\n\n    it(`should work when \"host\" option is \"local-ipv4\" (\"${webSocketServer}\")`, async () => {\n      const hostname = Server.internalIPSync(\"v4\");\n      const compiler = webpack(config);\n      const devServerOptions = {\n        webSocketServer,\n        port: port1,\n        host: \"local-ipv4\",\n      };\n      const server = new Server(devServerOptions, compiler);\n\n      await server.start();\n\n      const { page, browser } = await runBrowser();\n\n      try {\n        const pageErrors = [];\n        const consoleMessages = [];\n\n        page\n          .on(\"console\", (message) => {\n            consoleMessages.push(message);\n          })\n          .on(\"pageerror\", (error) => {\n            pageErrors.push(error);\n          });\n\n        const webSocketRequests = [];\n\n        if (webSocketServer === \"ws\") {\n          const session = await page.target().createCDPSession();\n\n          session.on(\"Network.webSocketCreated\", (test) => {\n            webSocketRequests.push(test);\n          });\n\n          await session.send(\"Target.setAutoAttach\", {\n            autoAttach: true,\n            flatten: true,\n            waitForDebuggerOnStart: true,\n          });\n\n          sessionSubscribe(session);\n        } else {\n          page.on(\"request\", (request) => {\n            if (/\\/ws\\//.test(request.url())) {\n              webSocketRequests.push({ url: request.url() });\n            }\n          });\n        }\n        await page.goto(`http://${hostname}:${port1}/`, {\n          waitUntil: \"networkidle0\",\n        });\n\n        const [webSocketRequest] = webSocketRequests;\n\n        expect(webSocketRequest.url).toContain(\n          `${websocketURLProtocol}://${hostname}:${port1}/ws`,\n        );\n        expect(\n          consoleMessages.map((message) => message.text()),\n        ).toMatchSnapshot(\"console messages\");\n        expect(pageErrors).toMatchSnapshot(\"page errors\");\n      } finally {\n        await browser.close();\n        await server.stop();\n      }\n    });\n\n    it(`should work with \"server: 'https'\" option (\"${webSocketServer}\")`, async () => {\n      const hostname = \"localhost\";\n      const compiler = webpack(config);\n      const devServerOptions = {\n        webSocketServer,\n        port: port1,\n        server: \"https\",\n      };\n      const server = new Server(devServerOptions, compiler);\n\n      await server.start();\n\n      const { page, browser } = await runBrowser();\n\n      try {\n        const pageErrors = [];\n        const consoleMessages = [];\n\n        page\n          .on(\"console\", (message) => {\n            consoleMessages.push(message);\n          })\n          .on(\"pageerror\", (error) => {\n            pageErrors.push(error);\n          });\n\n        const webSocketRequests = [];\n\n        if (webSocketServer === \"ws\") {\n          const session = await page.target().createCDPSession();\n\n          session.on(\"Network.webSocketCreated\", (test) => {\n            webSocketRequests.push(test);\n          });\n\n          await session.send(\"Target.setAutoAttach\", {\n            autoAttach: true,\n            flatten: true,\n            waitForDebuggerOnStart: true,\n          });\n\n          sessionSubscribe(session);\n        } else {\n          page.on(\"request\", (request) => {\n            if (/\\/ws\\//.test(request.url())) {\n              webSocketRequests.push({ url: request.url() });\n            }\n          });\n        }\n\n        await page.goto(`https://${hostname}:${port1}/`, {\n          waitUntil: \"networkidle0\",\n        });\n\n        const [webSocketRequest] = webSocketRequests;\n\n        if (webSocketServer === \"ws\") {\n          expect(webSocketRequest.url).toContain(\n            `wss://${hostname}:${port1}/ws`,\n          );\n        } else {\n          expect(webSocketRequest.url).toContain(\n            `https://${hostname}:${port1}/ws`,\n          );\n        }\n\n        expect(\n          consoleMessages.map((message) => message.text()),\n        ).toMatchSnapshot(\"console messages\");\n        expect(pageErrors).toMatchSnapshot(\"page errors\");\n      } finally {\n        await browser.close();\n        await server.stop();\n      }\n    });\n\n    const [major] = process.versions.node.split(\".\").map(Number);\n\n    (major >= 24 ? it.skip : it)(\n      `should work with \"server: 'spdy'\" option (\"${webSocketServer}\")`,\n      async () => {\n        const hostname = \"localhost\";\n        const compiler = webpack(config);\n        const devServerOptions = {\n          webSocketServer,\n          port: port1,\n          server: \"spdy\",\n        };\n        const server = new Server(devServerOptions, compiler);\n\n        await server.start();\n\n        const { page, browser } = await runBrowser();\n\n        try {\n          const pageErrors = [];\n          const consoleMessages = [];\n\n          page\n            .on(\"console\", (message) => {\n              consoleMessages.push(message);\n            })\n            .on(\"pageerror\", (error) => {\n              pageErrors.push(error);\n            });\n\n          const webSocketRequests = [];\n\n          if (webSocketServer === \"ws\") {\n            const session = await page.target().createCDPSession();\n\n            session.on(\"Network.webSocketCreated\", (test) => {\n              webSocketRequests.push(test);\n            });\n\n            await session.send(\"Target.setAutoAttach\", {\n              autoAttach: true,\n              flatten: true,\n              waitForDebuggerOnStart: true,\n            });\n\n            sessionSubscribe(session);\n          } else {\n            page.on(\"request\", (request) => {\n              if (/\\/ws\\//.test(request.url())) {\n                webSocketRequests.push({ url: request.url() });\n              }\n            });\n          }\n\n          await page.goto(`https://${hostname}:${port1}/`, {\n            waitUntil: \"networkidle0\",\n          });\n\n          const [webSocketRequest] = webSocketRequests;\n\n          /* eslint-disable jest/no-standalone-expect */\n          if (webSocketServer === \"ws\") {\n            expect(webSocketRequest.url).toContain(\n              `wss://${hostname}:${port1}/ws`,\n            );\n          } else {\n            expect(webSocketRequest.url).toContain(\n              `https://${hostname}:${port1}/ws`,\n            );\n          }\n\n          expect(consoleMessages.map((message) => message.text())).toEqual([\n            \"[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.\",\n            \"[HMR] Waiting for update signal from WDS...\",\n            \"Hey.\",\n          ]);\n          expect(pageErrors).toHaveLength(0);\n          /* eslint-enable jest/no-standalone-expect */\n        } finally {\n          await browser.close();\n          await server.stop();\n        }\n      },\n    );\n\n    it(`should work when \"port\" option is \"auto\" (\"${webSocketServer}\")`, async () => {\n      process.env.WEBPACK_DEV_SERVER_BASE_PORT = 50000;\n\n      const compiler = webpack(config);\n      const devServerOptions = {\n        webSocketServer,\n        port: \"auto\",\n        host: \"0.0.0.0\",\n        allowedHosts: \"all\",\n      };\n      const server = new Server(devServerOptions, compiler);\n\n      await server.start();\n\n      const resolvedFreePort = server.options.port;\n\n      const { page, browser } = await runBrowser();\n\n      try {\n        const pageErrors = [];\n        const consoleMessages = [];\n\n        page\n          .on(\"console\", (message) => {\n            consoleMessages.push(message);\n          })\n          .on(\"pageerror\", (error) => {\n            pageErrors.push(error);\n          });\n\n        const webSocketRequests = [];\n\n        if (webSocketServer === \"ws\") {\n          const session = await page.target().createCDPSession();\n\n          session.on(\"Network.webSocketCreated\", (test) => {\n            webSocketRequests.push(test);\n          });\n\n          await session.send(\"Target.setAutoAttach\", {\n            autoAttach: true,\n            flatten: true,\n            waitForDebuggerOnStart: true,\n          });\n\n          sessionSubscribe(session);\n        } else {\n          page.on(\"request\", (request) => {\n            if (/\\/ws\\//.test(request.url())) {\n              webSocketRequests.push({ url: request.url() });\n            }\n          });\n        }\n\n        await page.goto(`http://127.0.0.1:${resolvedFreePort}/`, {\n          waitUntil: \"networkidle0\",\n        });\n\n        const [webSocketRequest] = webSocketRequests;\n\n        expect(webSocketRequest.url).toContain(\n          `${websocketURLProtocol}://127.0.0.1:${resolvedFreePort}/ws`,\n        );\n        expect(\n          consoleMessages.map((message) => message.text()),\n        ).toMatchSnapshot(\"console messages\");\n        expect(pageErrors).toMatchSnapshot(\"page errors\");\n      } finally {\n        await browser.close();\n        await server.stop();\n\n        delete process.env.WEBPACK_DEV_SERVER_BASE_PORT;\n      }\n    });\n\n    it(`should work with \"client.webSocketURL.*\" options (\"${webSocketServer}\")`, async () => {\n      const compiler = webpack(config);\n      const devServerOptions = {\n        client: {\n          webSocketURL: {\n            protocol: \"ws:\",\n            hostname: \"127.0.0.1\",\n            port: port1,\n            pathname: \"/ws\",\n          },\n        },\n        webSocketServer,\n        port: port1,\n        host: \"0.0.0.0\",\n        allowedHosts: \"all\",\n      };\n      const server = new Server(devServerOptions, compiler);\n\n      await server.start();\n\n      const { page, browser } = await runBrowser();\n\n      try {\n        const pageErrors = [];\n        const consoleMessages = [];\n\n        page\n          .on(\"console\", (message) => {\n            consoleMessages.push(message);\n          })\n          .on(\"pageerror\", (error) => {\n            pageErrors.push(error);\n          });\n\n        const webSocketRequests = [];\n\n        if (webSocketServer === \"ws\") {\n          const session = await page.target().createCDPSession();\n\n          session.on(\"Network.webSocketCreated\", (test) => {\n            webSocketRequests.push(test);\n          });\n\n          await session.send(\"Target.setAutoAttach\", {\n            autoAttach: true,\n            flatten: true,\n            waitForDebuggerOnStart: true,\n          });\n\n          sessionSubscribe(session);\n        } else {\n          page.on(\"request\", (request) => {\n            if (/\\/ws\\//.test(request.url())) {\n              webSocketRequests.push({ url: request.url() });\n            }\n          });\n        }\n\n        await page.goto(`http://127.0.0.1:${port1}/`, {\n          waitUntil: \"networkidle0\",\n        });\n\n        const [webSocketRequest] = webSocketRequests;\n\n        expect(webSocketRequest.url).toContain(\n          `${websocketURLProtocol}://127.0.0.1:${port1}/ws`,\n        );\n        expect(\n          consoleMessages.map((message) => message.text()),\n        ).toMatchSnapshot(\"console messages\");\n        expect(pageErrors).toMatchSnapshot(\"page errors\");\n      } finally {\n        await browser.close();\n        await server.stop();\n      }\n    });\n\n    it(`should work with the \"client.webSocketURL\" option as \"string\" (\"${webSocketServer}\")`, async () => {\n      const compiler = webpack(config);\n      const devServerOptions = {\n        client: {\n          webSocketURL: `ws://127.0.0.1:${port1}/ws`,\n        },\n        webSocketServer,\n        port: port1,\n        host: \"0.0.0.0\",\n        allowedHosts: \"all\",\n      };\n      const server = new Server(devServerOptions, compiler);\n\n      await server.start();\n\n      const { page, browser } = await runBrowser();\n\n      try {\n        const pageErrors = [];\n        const consoleMessages = [];\n\n        page\n          .on(\"console\", (message) => {\n            consoleMessages.push(message);\n          })\n          .on(\"pageerror\", (error) => {\n            pageErrors.push(error);\n          });\n\n        const webSocketRequests = [];\n\n        if (webSocketServer === \"ws\") {\n          const session = await page.target().createCDPSession();\n\n          session.on(\"Network.webSocketCreated\", (test) => {\n            webSocketRequests.push(test);\n          });\n\n          await session.send(\"Target.setAutoAttach\", {\n            autoAttach: true,\n            flatten: true,\n            waitForDebuggerOnStart: true,\n          });\n\n          sessionSubscribe(session);\n        } else {\n          page.on(\"request\", (request) => {\n            if (/\\/ws\\//.test(request.url())) {\n              webSocketRequests.push({ url: request.url() });\n            }\n          });\n        }\n\n        await page.goto(`http://127.0.0.1:${port1}/`, {\n          waitUntil: \"networkidle0\",\n        });\n\n        const [webSocketRequest] = webSocketRequests;\n\n        expect(webSocketRequest.url).toContain(\n          `${websocketURLProtocol}://127.0.0.1:${port1}/ws`,\n        );\n        expect(\n          consoleMessages.map((message) => message.text()),\n        ).toMatchSnapshot(\"console messages\");\n        expect(pageErrors).toMatchSnapshot(\"page errors\");\n      } finally {\n        await browser.close();\n        await server.stop();\n      }\n    });\n\n    it(`should work and throw an error on invalid web socket URL (\"${webSocketServer}\")`, async () => {\n      const compiler = webpack(config);\n      const devServerOptions = {\n        client: {\n          webSocketURL: \"unknown://unknown.unknown/unknown\",\n        },\n        webSocketServer,\n        port: port1,\n        host: \"0.0.0.0\",\n        allowedHosts: \"all\",\n      };\n      const server = new Server(devServerOptions, compiler);\n\n      await server.start();\n\n      const { page, browser } = await runBrowser();\n\n      try {\n        const pageErrors = [];\n        const consoleMessages = [];\n\n        page\n          .on(\"console\", (message) => {\n            consoleMessages.push(message);\n          })\n          .on(\"pageerror\", (error) => {\n            pageErrors.push(error);\n          });\n\n        await page.goto(`http://localhost:${port1}/`, {\n          waitUntil: \"networkidle0\",\n        });\n\n        expect(\n          consoleMessages.map((message) => message.text()),\n        ).toMatchSnapshot(\"console messages\");\n        expect(\n          pageErrors.map((pageError) =>\n            pageError.message.split(\"\\n\")[0].replace(\"SyntaxError: \", \"\"),\n          ),\n        ).toMatchSnapshot(\"page errors\");\n      } finally {\n        await browser.close();\n        await server.stop();\n      }\n    });\n\n    it(`should not work and output disconnect wrong web socket URL (\"${webSocketServer}\")`, async () => {\n      const compiler = webpack(config);\n      const devServerOptions = {\n        client: {\n          webSocketURL: \"ws://unknown.unknown/unknown\",\n        },\n        webSocketServer,\n        port: port1,\n        host: \"0.0.0.0\",\n        allowedHosts: \"all\",\n      };\n      const server = new Server(devServerOptions, compiler);\n\n      await server.start();\n\n      const { page, browser } = await runBrowser();\n\n      try {\n        const pageErrors = [];\n        const consoleMessages = [];\n\n        let isDisconnected = false;\n\n        page\n          .on(\"console\", (message) => {\n            const text = message.text();\n\n            if (!isDisconnected) {\n              isDisconnected = /Disconnected!/.test(text);\n              consoleMessages.push(text.replaceAll(/:[\\d]+/g, \":<port>\"));\n            }\n          })\n          .on(\"pageerror\", (error) => {\n            pageErrors.push(error);\n          });\n\n        await page.goto(`http://localhost:${port1}/`, {\n          waitUntil: \"networkidle0\",\n        });\n\n        await new Promise((resolve) => {\n          const interval = setInterval(() => {\n            if (\n              consoleMessages.includes(\"[webpack-dev-server] Disconnected!\")\n            ) {\n              clearInterval(interval);\n\n              resolve();\n            }\n          }, 100);\n        });\n\n        expect(consoleMessages).toMatchSnapshot(\"console messages\");\n        expect(\n          pageErrors.map((pageError) => pageError.message.split(\"\\n\")[0]),\n        ).toMatchSnapshot(\"page errors\");\n      } finally {\n        await browser.close();\n        await server.stop();\n      }\n    });\n  }\n});\n"
  },
  {
    "path": "test/e2e/web-socket-server.test.js",
    "content": "\"use strict\";\n\nconst webpack = require(\"webpack\");\nconst Server = require(\"../../lib/Server\");\nconst config = require(\"../fixtures/client-config/webpack.config\");\nconst runBrowser = require(\"../helpers/run-browser\");\nconst sessionSubscribe = require(\"../helpers/session-subscribe\");\nconst port = require(\"../ports-map\")[\"web-socket-server-test\"];\n\ndescribe(\"web socket server\", () => {\n  it(\"should work allow to disable\", async () => {\n    const devServerPort = port;\n\n    const compiler = webpack(config);\n    const devServerOptions = {\n      webSocketServer: false,\n      port: devServerPort,\n    };\n    const server = new Server(devServerOptions, compiler);\n\n    await server.start();\n\n    const { page, browser } = await runBrowser();\n\n    try {\n      const pageErrors = [];\n      const consoleMessages = [];\n\n      page\n        .on(\"console\", (message) => {\n          consoleMessages.push(message);\n        })\n        .on(\"pageerror\", (error) => {\n          pageErrors.push(error);\n        });\n\n      const webSocketRequests = [];\n      const session = await page.target().createCDPSession();\n\n      session.on(\"Network.webSocketCreated\", (test) => {\n        webSocketRequests.push(test);\n      });\n\n      await session.send(\"Target.setAutoAttach\", {\n        autoAttach: true,\n        flatten: true,\n        waitForDebuggerOnStart: true,\n      });\n\n      sessionSubscribe(session);\n\n      await page.goto(`http://localhost:${port}/`, {\n        waitUntil: \"networkidle0\",\n      });\n\n      expect(webSocketRequests).toHaveLength(0);\n      expect(consoleMessages.map((message) => message.text())).toMatchSnapshot(\n        \"console messages\",\n      );\n      expect(pageErrors).toMatchSnapshot(\"page errors\");\n    } finally {\n      await browser.close();\n      await server.stop();\n    }\n  });\n});\n"
  },
  {
    "path": "test/fixtures/cli/foo.js",
    "content": "\"use strict\";\n\nconsole.log(\"i am foo!\");\n"
  },
  {
    "path": "test/fixtures/cli/webpack.config.js",
    "content": "\"use strict\";\n\nmodule.exports = {\n  mode: \"development\",\n  stats: \"detailed\",\n  context: __dirname,\n  entry: \"./foo.js\",\n};\n"
  },
  {
    "path": "test/fixtures/cli-colors-default-stats/foo.js",
    "content": "\"use strict\";\n\nconsole.log(\"i am foo!\");\n"
  },
  {
    "path": "test/fixtures/cli-colors-default-stats/webpack.config.js",
    "content": "\"use strict\";\n\nmodule.exports = {\n  mode: \"development\",\n  context: __dirname,\n  entry: \"./foo.js\",\n};\n"
  },
  {
    "path": "test/fixtures/cli-colors-disabled/foo.js",
    "content": "\"use strict\";\n\nconsole.log(\"i am foo!\");\n"
  },
  {
    "path": "test/fixtures/cli-colors-disabled/webpack.config.js",
    "content": "\"use strict\";\n\nmodule.exports = {\n  mode: \"development\",\n  stats: {\n    colors: false,\n  },\n  context: __dirname,\n  entry: \"./foo.js\",\n  infrastructureLogging: {\n    colors: false,\n  },\n};\n"
  },
  {
    "path": "test/fixtures/cli-colors-enabled/foo.js",
    "content": "\"use strict\";\n\nconsole.log(\"i am foo!\");\n"
  },
  {
    "path": "test/fixtures/cli-colors-enabled/webpack.config.js",
    "content": "\"use strict\";\n\nmodule.exports = {\n  mode: \"development\",\n  stats: {\n    colors: true,\n  },\n  context: __dirname,\n  entry: \"./foo.js\",\n  infrastructureLogging: {\n    colors: true,\n  },\n};\n"
  },
  {
    "path": "test/fixtures/cli-empty-entry/webpack.config.js",
    "content": "\"use strict\";\n\nmodule.exports = {\n  mode: \"development\",\n  stats: { orphanModules: true, preset: \"detailed\" },\n  entry: {},\n};\n"
  },
  {
    "path": "test/fixtures/cli-entry-as-descriptor/foo.js",
    "content": "\"use strict\";\n\nconsole.log(\"i am foo!\");\n"
  },
  {
    "path": "test/fixtures/cli-entry-as-descriptor/webpack.config.js",
    "content": "\"use strict\";\n\nmodule.exports = {\n  mode: \"development\",\n  context: __dirname,\n  entry: {\n    main: {\n      import: \"./foo.js\",\n    },\n  },\n};\n"
  },
  {
    "path": "test/fixtures/cli-multi-entry/bar.js",
    "content": "\"use strict\";\n\nconsole.log(\"I am bar\");\n"
  },
  {
    "path": "test/fixtures/cli-multi-entry/foo.js",
    "content": "\"use strict\";\n\nconsole.log(\"I am foo\");\n"
  },
  {
    "path": "test/fixtures/cli-multi-entry/webpack.config.js",
    "content": "\"use strict\";\n\nconst { resolve } = require(\"path\");\n\nmodule.exports = {\n  mode: \"development\",\n  stats: \"detailed\",\n  context: __dirname,\n  entry: {\n    foo: resolve(__dirname, \"./foo.js\"),\n    bar: resolve(__dirname, \"./bar.js\"),\n  },\n};\n"
  },
  {
    "path": "test/fixtures/cli-promise-config/foo.js",
    "content": "\"use strict\";\n\nconsole.log(\"i am foo!\");\n"
  },
  {
    "path": "test/fixtures/cli-promise-config/webpack.config.js",
    "content": "\"use strict\";\n\nconst { join } = require(\"path\");\n\nmodule.exports = () =>\n  new Promise((resolve) => {\n    resolve({\n      mode: \"development\",\n      entry: join(__dirname, \"foo.js\"),\n    });\n  });\n"
  },
  {
    "path": "test/fixtures/cli-single-entry/foo.js",
    "content": "\"use strict\";\n\nconsole.log(\"I am foo\");\n"
  },
  {
    "path": "test/fixtures/cli-single-entry/webpack.config.js",
    "content": "\"use strict\";\n\nconst { resolve } = require(\"path\");\n\nmodule.exports = {\n  mode: \"development\",\n  stats: \"detailed\",\n  entry: resolve(__dirname, \"./foo.js\"),\n};\n"
  },
  {
    "path": "test/fixtures/cli-target-config/foo.js",
    "content": "\"use strict\";\n\nconsole.log(\"I am foo\");\n"
  },
  {
    "path": "test/fixtures/cli-target-config/webpack.config.js",
    "content": "\"use strict\";\n\nconst { resolve } = require(\"path\");\n\nmodule.exports = {\n  mode: \"development\",\n  stats: \"detailed\",\n  entry: resolve(__dirname, \"./foo.js\"),\n  target: [\"web\"],\n};\n"
  },
  {
    "path": "test/fixtures/cli-universal-compiler-config/client.js",
    "content": "\"use strict\";\n\nconsole.log(\"Hello from the client\");\n"
  },
  {
    "path": "test/fixtures/cli-universal-compiler-config/server.js",
    "content": "\"use strict\";\n\nconsole.log(\"Hello from the server\");\n"
  },
  {
    "path": "test/fixtures/cli-universal-compiler-config/webpack.config.js",
    "content": "\"use strict\";\n\nmodule.exports = [\n  {\n    name: \"client\",\n    mode: \"development\",\n    context: __dirname,\n    stats: \"none\",\n    entry: \"./client.js\",\n    output: {\n      path: \"/\",\n      filename: \"client.js\",\n    },\n  },\n  {\n    name: \"server\",\n    mode: \"development\",\n    context: __dirname,\n    target: \"node\",\n    stats: \"none\",\n    entry: \"./server.js\",\n    output: {\n      path: \"/\",\n      filename: \"server.js\",\n    },\n    dependencies: [\"client\"],\n  },\n];\n"
  },
  {
    "path": "test/fixtures/client-config/bar.js",
    "content": "\"use strict\";\n\nconsole.log(\"Bar.\");\n"
  },
  {
    "path": "test/fixtures/client-config/foo.js",
    "content": "\"use strict\";\n\nconsole.log(\"Hey.\");\n"
  },
  {
    "path": "test/fixtures/client-config/index.html",
    "content": "<script src=\"index.js\"></script>\n"
  },
  {
    "path": "test/fixtures/client-config/static/foo.txt",
    "content": "Text"
  },
  {
    "path": "test/fixtures/client-config/webpack.config.js",
    "content": "\"use strict\";\n\nconst HTMLGeneratorPlugin = require(\"../../helpers/html-generator-plugin\");\n\nmodule.exports = {\n  devtool: false,\n  mode: \"development\",\n  context: __dirname,\n  stats: \"none\",\n  entry: \"./foo.js\",\n  output: {\n    path: \"/\",\n  },\n  infrastructureLogging: {\n    level: \"info\",\n    stream: {\n      write: () => {},\n    },\n  },\n  plugins: [new HTMLGeneratorPlugin()],\n};\n"
  },
  {
    "path": "test/fixtures/custom-client/CustomClientEntry.js",
    "content": "\"use strict\";\n\nconsole.log(\"custom client entry\");\n"
  },
  {
    "path": "test/fixtures/custom-client/CustomClientHotEntry.js",
    "content": "\"use strict\";\n\nconsole.log(\"custom client hot entry\");\n"
  },
  {
    "path": "test/fixtures/custom-client/CustomSockJSClient.js",
    "content": "\"use strict\";\n\nconst SockJS = require(\"sockjs-client/dist/sockjs\");\n\nmodule.exports = class SockJSClient {\n  constructor(url) {\n    this.sock = new SockJS(\n      url.replace(/^ws:/i, \"http://\").replace(/^wss:/i, \"https://\"),\n    );\n  }\n\n  onOpen(f) {\n    this.sock.onopen = () => {\n      console.log(\"open\");\n      f();\n    };\n  }\n\n  onClose(f) {\n    this.sock.onclose = () => {\n      console.log(\"close\");\n      f();\n    };\n  }\n\n  // call f with the message string as the first argument\n  onMessage(f) {\n    this.sock.onmessage = (e) => {\n      const obj = JSON.parse(e.data);\n      console.log(obj.type);\n      f(e.data);\n    };\n  }\n};\n"
  },
  {
    "path": "test/fixtures/dev-public-path/foo.js",
    "content": "\"use strict\";\n\nconsole.log(\"i am foo!\");\n"
  },
  {
    "path": "test/fixtures/dev-public-path/webpack.config.js",
    "content": "\"use strict\";\n\nconst { join } = require(\"path\");\n\nmodule.exports = {\n  mode: \"development\",\n  entry: join(__dirname, \"foo.js\"),\n  devServer: {\n    devMiddleware: {\n      publicPath: \"/foo/bar\",\n    },\n  },\n};\n"
  },
  {
    "path": "test/fixtures/dev-server/bar.js",
    "content": "\"use strict\";\n\nconsole.log(\"I am bar\");\n"
  },
  {
    "path": "test/fixtures/dev-server/client-custom-path-config.js",
    "content": "\"use strict\";\n\nconst { resolve } = require(\"path\");\n\nmodule.exports = {\n  mode: \"development\",\n  stats: \"detailed\",\n  entry: resolve(__dirname, \"./foo.js\"),\n  devServer: {\n    webSocketServer: {\n      type: \"ws\",\n      options: {\n        path: \"/custom/path\",\n      },\n    },\n  },\n};\n"
  },
  {
    "path": "test/fixtures/dev-server/client-default-path-config.js",
    "content": "\"use strict\";\n\nconst { resolve } = require(\"path\");\n\nmodule.exports = {\n  mode: \"development\",\n  stats: \"detailed\",\n  entry: resolve(__dirname, \"./foo.js\"),\n  devServer: {\n    webSocketServer: {\n      type: \"ws\",\n    },\n  },\n};\n"
  },
  {
    "path": "test/fixtures/dev-server/foo.js",
    "content": "\"use strict\";\n\nconsole.log(\"I am foo\");\n"
  },
  {
    "path": "test/fixtures/entry-as-function/foo.js",
    "content": "\"use strict\";\n\nconsole.log(\"i am foo!\");\n"
  },
  {
    "path": "test/fixtures/entry-as-function/webpack.config.js",
    "content": "\"use strict\";\n\nmodule.exports = {\n  mode: \"development\",\n  context: __dirname,\n  entry: () => \"./foo.js\",\n  plugins: [\n    {\n      apply(compiler) {\n        compiler.hooks.done.tap(\"webpack-dev-server\", (stats) => {\n          let exitCode = 0;\n          if (stats.hasErrors()) {\n            exitCode = 1;\n          }\n          setTimeout(() => process.exit(exitCode));\n        });\n      },\n    },\n  ],\n  infrastructureLogging: {\n    level: \"warn\",\n  },\n};\n"
  },
  {
    "path": "test/fixtures/historyapifallback-2-config/bar.html",
    "content": "Foobar\n"
  },
  {
    "path": "test/fixtures/historyapifallback-2-config/foo.js",
    "content": "\"use strict\";\n\nconsole.log(\"Hey.\");\n"
  },
  {
    "path": "test/fixtures/historyapifallback-2-config/other.html",
    "content": "Other file\n"
  },
  {
    "path": "test/fixtures/historyapifallback-2-config/random-file.txt",
    "content": "Random file\n"
  },
  {
    "path": "test/fixtures/historyapifallback-2-config/webpack.config.js",
    "content": "\"use strict\";\n\nmodule.exports = {\n  mode: \"development\",\n  context: __dirname,\n  stats: \"none\",\n  entry: \"./foo.js\",\n  output: {\n    path: \"/\",\n  },\n  infrastructureLogging: {\n    level: \"warn\",\n  },\n};\n"
  },
  {
    "path": "test/fixtures/historyapifallback-3-config/bar.html",
    "content": "In-memory file\n"
  },
  {
    "path": "test/fixtures/historyapifallback-3-config/foo.js",
    "content": "\"use strict\";\n\nrequire(\"./bar.html\");\n\nconsole.log(\"Hey.\");\n"
  },
  {
    "path": "test/fixtures/historyapifallback-3-config/index.html",
    "content": "static file\n"
  },
  {
    "path": "test/fixtures/historyapifallback-3-config/webpack.config.js",
    "content": "\"use strict\";\n\nconst moduleRuleForHTML = {\n  test: /\\.html$/,\n  type: \"asset/resource\",\n  generator: {\n    filename: \"index.html\",\n  },\n};\n\nmodule.exports = {\n  mode: \"development\",\n  context: __dirname,\n  stats: \"none\",\n  entry: \"./foo.js\",\n  output: {\n    path: \"/\",\n  },\n  module: {\n    rules: [\n      {\n        ...moduleRuleForHTML,\n      },\n    ],\n  },\n  infrastructureLogging: {\n    level: \"warn\",\n  },\n};\n"
  },
  {
    "path": "test/fixtures/historyapifallback-config/bar.html",
    "content": "Foobar\n"
  },
  {
    "path": "test/fixtures/historyapifallback-config/foo.js",
    "content": "\"use strict\";\n\nrequire(\"./index.html\");\nrequire(\"./bar.html\");\n\nconsole.log(\"Hey.\");\n"
  },
  {
    "path": "test/fixtures/historyapifallback-config/index.html",
    "content": "Heyyy\n"
  },
  {
    "path": "test/fixtures/historyapifallback-config/webpack.config.js",
    "content": "\"use strict\";\n\nconst moduleRuleForHTML = {\n  test: /\\.html$/,\n  type: \"asset/resource\",\n  generator: {\n    filename: \"[name][ext]\",\n  },\n};\n\nmodule.exports = {\n  mode: \"development\",\n  context: __dirname,\n  stats: \"none\",\n  entry: \"./foo.js\",\n  output: {\n    path: \"/\",\n  },\n  module: {\n    rules: [\n      {\n        ...moduleRuleForHTML,\n      },\n    ],\n  },\n  infrastructureLogging: {\n    level: \"warn\",\n  },\n};\n"
  },
  {
    "path": "test/fixtures/https-certificate/ca.pem",
    "content": "-----BEGIN RSA PRIVATE KEY-----\nMIIEpQIBAAKCAQEAxAUVLFM+K3XDLQkBi7xt0s1Ip7JoHYDskzUDQNHjjMkUq5kv\nC/hf5Ei1J6qruJs3Xqg86Nl4+ed4ynUajAkRRibhp0P1SG1tgPssIK6iC7g8heYu\nDy9WkFuMie0513zjSn6bMEAK5TegxYAWCbaCZX/Fw9bDniabL/zuOv4sf8J4EPhs\nEENnH6sUE9HxPUgQmNt1Tbd0j1Cd5PXrSTLyfVPRh0m9QhXTUHuxsse8XSn9U2sw\nduxJTWRINmhffYn+O7kbJGI77xYr8u58Rsf3HCMI8DTKZNvQLChvvtLJ9ckyu7Q+\nT8emgklStASm3V2UtnriaK/IQEhgSdxqVRib3QIDAQABAoIBAGqWKPE1QnT3T+3J\nG+ITz9P0dDFbvWltlTZmeSJh/s2q+WZloUNtBxdmwbqT/1QecnkyGgyzVCjvSKsu\nCgVjWNVAhysgtNtxRT4BVflffBXLVH2qsBjpsLRGU6EcMXuPGTiEp3YRHNuO6Aj8\noP8fEsCGPc9DlJMGgxQRAKlrVF8TN/0j6Qk+YpS4MZ0YFQfBY+WdKu04Z8TVTplQ\ntTkiGpBI+Oj85jF59aQiizglJgADkAZ6zmbrctm/G9jPxh7JLS2cKI0ECZgK5yAc\npk10E1YWhoCksjr9arxy6fS9TiX9P15vv06k+s7c4c5X7XDm3X0GWeSbqBMJb8q7\nBhZQNzECgYEA4kAtymDBvFYiZFq7+lzQBRKAI1RCq7YqxlieumH0PSkie2bba3dW\nNVdTi7at8+GDB9/cHUPKzg/skfJllek57MZmusiVwB/Lmp/IlW8YyGShdYZ7zQsV\nKMWJljpky3BEDM5sb08wIkfrOkelI/S4Bqqabd9JzOMJzoTiVOlMam8CgYEA3ctN\nyonWz2bsnCUstQvQCLdI5a8Q7GJvlH2awephxGXIKGUuRmyyop0AnRnIBEWtOQV7\nyZjW32bU+Wt+2BJ247EyJiIQ4gT+T51t+v/Wt1YNbL3dSj9ttOvwYd4H2W4E7EIO\nGKIF4I39FM7r8NfG7YE7S1aVcnrqs01N3nhd9HMCgYEAjepbzpmqbAxLPk97oase\nAFB+d6qetz5ozklAJwDSRprKukTmVR5hwMup5/UKX/OQURwl4WVojKCIb3NwLPxC\nDTbVsUuoQv6uo6qeEr3A+dHFRQa6GP9eolhl2Ql/t+wPg0jn01oEgzxBXCkceNVD\nqUrR2yE4FYBD4nqPzVsZR5kCgYEA1yTi7NkQeldIpZ6Z43T18753A/Xx4JsLyWqd\nuAT3mV9x7V1Yqg++qGbLtZjQoPRFt85N6ZxMsqA5b0iK3mXq1auJDdx1rAlT9z6q\n9JM/YNAkbZsvEVq9vIYxw31w98T1GYhpzBM+yDhzir+9tv5YhQKa1dXDWi1JhWwz\nYN45pWkCgYEAxuVsJ4D4Th5o050ppWpnxM/WuMhIUKqaoFTVucMKFzn+g24y9pv5\nmiYdNYIk4Y+4pzHG6ZGZSHJcQ9BLui6H/nLQnqkgCb2lT5nfp7/GKdus7BdcjPGs\nfcV46yL7/X0m8nDb3hkwwrDTU4mKFkMrzKpjdZBsttEmW0Aw/3y36gU=\n-----END RSA PRIVATE KEY-----\n"
  },
  {
    "path": "test/fixtures/https-certificate/server.crt",
    "content": "-----BEGIN CERTIFICATE-----\nMIIDXTCCAkWgAwIBAgIJALz8gD/gAt0OMA0GCSqGSIb3DQEBCwUAMEUxCzAJBgNV\nBAYTAkFVMRMwEQYDVQQIDApTb21lLVN0YXRlMSEwHwYDVQQKDBhJbnRlcm5ldCBX\naWRnaXRzIFB0eSBMdGQwHhcNMTgxMDIzMTgyMTQ5WhcNMTkxMDIzMTgyMTQ5WjBF\nMQswCQYDVQQGEwJBVTETMBEGA1UECAwKU29tZS1TdGF0ZTEhMB8GA1UECgwYSW50\nZXJuZXQgV2lkZ2l0cyBQdHkgTHRkMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIB\nCgKCAQEAxAUVLFM+K3XDLQkBi7xt0s1Ip7JoHYDskzUDQNHjjMkUq5kvC/hf5Ei1\nJ6qruJs3Xqg86Nl4+ed4ynUajAkRRibhp0P1SG1tgPssIK6iC7g8heYuDy9WkFuM\nie0513zjSn6bMEAK5TegxYAWCbaCZX/Fw9bDniabL/zuOv4sf8J4EPhsEENnH6sU\nE9HxPUgQmNt1Tbd0j1Cd5PXrSTLyfVPRh0m9QhXTUHuxsse8XSn9U2swduxJTWRI\nNmhffYn+O7kbJGI77xYr8u58Rsf3HCMI8DTKZNvQLChvvtLJ9ckyu7Q+T8emgklS\ntASm3V2UtnriaK/IQEhgSdxqVRib3QIDAQABo1AwTjAdBgNVHQ4EFgQUDZBhVKdb\n3BRhLIhuuE522Vsul0IwHwYDVR0jBBgwFoAUDZBhVKdb3BRhLIhuuE522Vsul0Iw\nDAYDVR0TBAUwAwEB/zANBgkqhkiG9w0BAQsFAAOCAQEABh9WWZwWLgb9/DcTxL72\n6pI96t4jiF79Q+pPefkaIIi0mE6yodWrTAsBQu9I6bNRaEcCSoiXkP2bqskD/UGg\nLwUFgSrDOAA3UjdHw3QU5g2NocduG7mcFwA40TB98sOsxsUyYlzSyWzoiQWwPYwb\nhek1djuWkqPXsTjlj54PTPN/SjTFmo4p5Ip6nbRf2nOREl7v0rJpGbJvXiCMYyd+\nZv+j4mRjCGo8ysMR2HjCUGkYReLAgKyyz3M7i8vevJhKslyOmy6Txn4F0nPVumaU\nDDIy4xXPW1STWfsmSYJfYW3wa0wk+pJQ3j2cTzkPQQ8gwpvM3U9DJl43uwb37v6I\n7Q==\n-----END CERTIFICATE-----\n"
  },
  {
    "path": "test/fixtures/https-certificate/server.key",
    "content": "-----BEGIN PRIVATE KEY-----\nMIIEvwIBADANBgkqhkiG9w0BAQEFAASCBKkwggSlAgEAAoIBAQDEBRUsUz4rdcMt\nCQGLvG3SzUinsmgdgOyTNQNA0eOMyRSrmS8L+F/kSLUnqqu4mzdeqDzo2Xj553jK\ndRqMCRFGJuGnQ/VIbW2A+ywgrqILuDyF5i4PL1aQW4yJ7TnXfONKfpswQArlN6DF\ngBYJtoJlf8XD1sOeJpsv/O46/ix/wngQ+GwQQ2cfqxQT0fE9SBCY23VNt3SPUJ3k\n9etJMvJ9U9GHSb1CFdNQe7Gyx7xdKf1TazB27ElNZEg2aF99if47uRskYjvvFivy\n7nxGx/ccIwjwNMpk29AsKG++0sn1yTK7tD5Px6aCSVK0BKbdXZS2euJor8hASGBJ\n3GpVGJvdAgMBAAECggEAapYo8TVCdPdP7ckb4hPP0/R0MVu9aW2VNmZ5ImH+zar5\nZmWhQ20HF2bBupP/VB5yeTIaDLNUKO9Iqy4KBWNY1UCHKyC023FFPgFV+V98FctU\nfaqwGOmwtEZToRwxe48ZOISndhEc247oCPyg/x8SwIY9z0OUkwaDFBEAqWtUXxM3\n/SPpCT5ilLgxnRgVB8Fj5Z0q7ThnxNVOmVC1OSIakEj46PzmMXn1pCKLOCUmAAOQ\nBnrOZuty2b8b2M/GHsktLZwojQQJmArnIBymTXQTVhaGgKSyOv1qvHLp9L1OJf0/\nXm+/TqT6ztzhzlftcObdfQZZ5JuoEwlvyrsGFlA3MQKBgQDiQC3KYMG8ViJkWrv6\nXNAFEoAjVEKrtirGWJ66YfQ9KSJ7Zttrd1Y1V1OLtq3z4YMH39wdQ8rOD+yR8mWV\n6Tnsxma6yJXAH8uan8iVbxjIZKF1hnvNCxUoxYmWOmTLcEQMzmxvTzAiR+s6R6Uj\n9LgGqppt30nM4wnOhOJU6UxqbwKBgQDdy03KidbPZuycJSy1C9AIt0jlrxDsYm+U\nfZrB6mHEZcgoZS5GbLKinQCdGcgERa05BXvJmNbfZtT5a37YEnbjsTImIhDiBP5P\nnW36/9a3Vg1svd1KP2206/Bh3gfZbgTsQg4YogXgjf0Uzuvw18btgTtLVpVyeuqz\nTU3eeF30cwKBgQCN6lvOmapsDEs+T3uhqx4AUH53qp63PmjOSUAnANJGmsq6ROZV\nHmHAy6nn9Qpf85BRHCXhZWiMoIhvc3As/EINNtWxS6hC/q6jqp4SvcD50cVFBroY\n/16iWGXZCX+37A+DSOfTWgSDPEFcKRx41UOpStHbITgVgEPieo/NWxlHmQKBgQDX\nJOLs2RB6V0ilnpnjdPXzvncD9fHgmwvJap24BPeZX3HtXViqD76oZsu1mNCg9EW3\nzk3pnEyyoDlvSIreZerVq4kN3HWsCVP3Pqr0kz9g0CRtmy8RWr28hjHDfXD3xPUZ\niGnMEz7IOHOKv722/liFAprV1cNaLUmFbDNg3jmlaQKBgQDG5WwngPhOHmjTnSml\namfEz9a4yEhQqpqgVNW5wwoXOf6DbjL2m/maJh01giThj7inMcbpkZlIclxD0Eu6\nLof+ctCeqSAJvaVPmd+nv8Yp26zsF1yM8ax9xXjrIvv9fSbycNveGTDCsNNTiYoW\nQyvMqmN1kGy20SZbQDD/fLfqBQ==\n-----END PRIVATE KEY-----\n"
  },
  {
    "path": "test/fixtures/lazy-compilation-multiple-entries/one.js",
    "content": "\"use strict\";\n\nconsole.log(\"One.\");\n"
  },
  {
    "path": "test/fixtures/lazy-compilation-multiple-entries/two.js",
    "content": "\"use strict\";\n\nconsole.log(\"Two.\");\n"
  },
  {
    "path": "test/fixtures/lazy-compilation-multiple-entries/webpack.config.js",
    "content": "\"use strict\";\n\nconst oneHTMLContent = `\n<!doctype html>\n<html>\n  <head>\n    <meta charset='UTF-8'>\n    <title>test</title>\n    <script src=\"one.js\"></script>\n  </head>\n  <body></body>\n</html>\n`;\nconst twoHTMLContent = `\n<!doctype html>\n<html>\n  <head>\n    <meta charset='UTF-8'>\n    <title>test</title>\n    <script src=\"two.js\"></script>\n  </head>\n  <body></body>\n</html>\n`;\n\nmodule.exports = {\n  devtool: false,\n  mode: \"development\",\n  context: __dirname,\n  stats: \"none\",\n  entry: {\n    one: \"./one.js\",\n    two: \"./two.js\",\n  },\n  output: {\n    path: \"/\",\n  },\n  experiments: {\n    lazyCompilation: true,\n  },\n  infrastructureLogging: {\n    level: \"info\",\n    stream: {\n      write: () => {},\n    },\n  },\n  plugins: [\n    {\n      apply(compiler) {\n        const pluginName = \"html-generator-plugin-test\";\n        const oneFilename = \"test-one.html\";\n        const twoFilename = \"test-two.html\";\n\n        compiler.hooks.thisCompilation.tap(pluginName, (compilation) => {\n          const { RawSource } = compiler.webpack.sources;\n\n          compilation.hooks.processAssets.tap(\n            {\n              name: pluginName,\n              stage:\n                compiler.webpack.Compilation.PROCESS_ASSETS_STAGE_ADDITIONAL,\n            },\n            () => {\n              const oneSource = new RawSource(oneHTMLContent);\n\n              compilation.emitAsset(oneFilename, oneSource);\n\n              const twoSource = new RawSource(twoHTMLContent);\n\n              compilation.emitAsset(twoFilename, twoSource);\n            },\n          );\n        });\n      },\n    },\n  ],\n};\n"
  },
  {
    "path": "test/fixtures/lazy-compilation-single-entry/entry.js",
    "content": "\"use strict\";\n\nconsole.log(\"Hey.\");\n"
  },
  {
    "path": "test/fixtures/lazy-compilation-single-entry/webpack.config.js",
    "content": "\"use strict\";\n\nconst HTMLContent = `\n<!doctype html>\n<html>\n  <head>\n    <meta charset='UTF-8'>\n    <title>test</title>\n    <script src=\"main.js\"></script>\n  </head>\n  <body></body>\n</html>\n`;\n\nmodule.exports = {\n  devtool: false,\n  mode: \"development\",\n  context: __dirname,\n  stats: \"none\",\n  entry: \"./entry.js\",\n  output: {\n    path: \"/\",\n  },\n  experiments: {\n    lazyCompilation: true,\n  },\n  infrastructureLogging: {\n    level: \"info\",\n    stream: {\n      write: () => {},\n    },\n  },\n  plugins: [\n    {\n      apply(compiler) {\n        const pluginName = \"html-generator-plugin-test\";\n        const filename = \"test.html\";\n\n        compiler.hooks.thisCompilation.tap(pluginName, (compilation) => {\n          const { RawSource } = compiler.webpack.sources;\n\n          compilation.hooks.processAssets.tap(\n            {\n              name: pluginName,\n              stage:\n                compiler.webpack.Compilation.PROCESS_ASSETS_STAGE_ADDITIONAL,\n            },\n            () => {\n              const source = new RawSource(HTMLContent);\n\n              compilation.emitAsset(filename, source);\n            },\n          );\n        });\n      },\n    },\n  ],\n};\n"
  },
  {
    "path": "test/fixtures/mime-types-config/file.custom",
    "content": "test\n"
  },
  {
    "path": "test/fixtures/mime-types-config/foo.js",
    "content": "\"use strict\";\n\nrequire(\"./file.custom\");\n\nconsole.log(\"Hey.\");\n"
  },
  {
    "path": "test/fixtures/mime-types-config/webpack.config.js",
    "content": "\"use strict\";\n\nconst moduleRuleForCustom = {\n  test: /\\.custom$/,\n  type: \"asset/resource\",\n  generator: {\n    filename: \"[name][ext]\",\n  },\n};\n\nmodule.exports = {\n  mode: \"development\",\n  context: __dirname,\n  stats: \"none\",\n  entry: \"./foo.js\",\n  output: {\n    path: \"/\",\n  },\n  node: false,\n  infrastructureLogging: {\n    level: \"warn\",\n  },\n  module: {\n    rules: [\n      {\n        ...moduleRuleForCustom,\n      },\n    ],\n  },\n};\n"
  },
  {
    "path": "test/fixtures/module-federation-config/entry1.js",
    "content": "\"use strict\";\n\nmodule.exports = \"entry1\";\n"
  },
  {
    "path": "test/fixtures/module-federation-config/entry2.js",
    "content": "\"use strict\";\n\nmodule.exports = \"entry2\";\n"
  },
  {
    "path": "test/fixtures/module-federation-config/webpack.config.js",
    "content": "\"use strict\";\n\nmodule.exports = {\n  mode: \"development\",\n  target: \"node\",\n  stats: \"none\",\n  context: __dirname,\n  entry: [\"./entry1.js\", \"./entry2.js\"],\n  output: {\n    path: \"/\",\n    libraryTarget: \"umd\",\n  },\n  infrastructureLogging: {\n    level: \"warn\",\n  },\n};\n"
  },
  {
    "path": "test/fixtures/module-federation-config/webpack.multi.config.js",
    "content": "\"use strict\";\n\nmodule.exports = [\n  {\n    mode: \"development\",\n    target: \"node\",\n    context: __dirname,\n    stats: \"none\",\n    entry: [\"./entry1.js\", \"./entry2.js\"],\n    output: {\n      path: \"/\",\n      libraryTarget: \"umd\",\n    },\n    infrastructureLogging: {\n      level: \"warn\",\n    },\n  },\n];\n"
  },
  {
    "path": "test/fixtures/module-federation-config/webpack.object-entry.config.js",
    "content": "\"use strict\";\n\nmodule.exports = {\n  mode: \"development\",\n  target: \"node\",\n  stats: \"none\",\n  context: __dirname,\n  entry: {\n    foo: \"./entry1.js\",\n    main: [\"./entry1.js\", \"./entry2.js\"],\n  },\n  output: {\n    path: \"/\",\n    libraryTarget: \"umd\",\n  },\n  infrastructureLogging: {\n    level: \"warn\",\n  },\n};\n"
  },
  {
    "path": "test/fixtures/module-federation-config/webpack.plugin.js",
    "content": "\"use strict\";\n\nconst ModuleFederationPlugin =\n  require(\"webpack\").container.ModuleFederationPlugin;\n\nmodule.exports = {\n  mode: \"development\",\n  target: \"node\",\n  stats: \"none\",\n  context: __dirname,\n  entry: [\"./entry1.js\"],\n  plugins: [\n    new ModuleFederationPlugin({\n      name: \"app1\",\n      library: { type: \"var\", name: \"app1\" },\n      filename: \"remoteEntry.js\",\n      exposes: {\n        \"./entry1\": \"./entry1\",\n      },\n    }),\n  ],\n  infrastructureLogging: {\n    level: \"warn\",\n  },\n};\n"
  },
  {
    "path": "test/fixtures/multi-compiler-one-configuration/foo.js",
    "content": "\"use strict\";\n\nconsole.log(\"Hey.\");\n"
  },
  {
    "path": "test/fixtures/multi-compiler-one-configuration/webpack.config.js",
    "content": "\"use strict\";\n\nconst HTMLGeneratorPlugin = require(\"../../helpers/html-generator-plugin\");\n\nmodule.exports = [\n  {\n    target: \"web\",\n    mode: \"development\",\n    context: __dirname,\n    stats: \"none\",\n    entry: \"./foo.js\",\n    output: {\n      path: \"/\",\n    },\n    node: false,\n    infrastructureLogging: {\n      level: \"info\",\n      stream: {\n        write: () => {},\n      },\n    },\n    plugins: [new HTMLGeneratorPlugin()],\n  },\n];\n"
  },
  {
    "path": "test/fixtures/multi-compiler-two-configurations/one.js",
    "content": "\"use strict\";\n\nconsole.log(\"one\");\n"
  },
  {
    "path": "test/fixtures/multi-compiler-two-configurations/two.js",
    "content": "\"use strict\";\n\nconsole.log(\"two\");\n"
  },
  {
    "path": "test/fixtures/multi-compiler-two-configurations/webpack.config.js",
    "content": "\"use strict\";\n\nconst HTMLGeneratorPlugin = require(\"../../helpers/html-generator-plugin\");\n\nmodule.exports = [\n  {\n    target: \"web\",\n    name: \"one\",\n    mode: \"development\",\n    context: __dirname,\n    entry: \"./one.js\",\n    stats: \"none\",\n    output: {\n      path: \"/\",\n      filename: \"one-[name].js\",\n    },\n    plugins: [new HTMLGeneratorPlugin()],\n    infrastructureLogging: {\n      level: \"info\",\n      stream: {\n        write: () => {},\n      },\n    },\n  },\n  {\n    target: \"web\",\n    name: \"two\",\n    mode: \"development\",\n    context: __dirname,\n    entry: \"./two.js\",\n    stats: \"none\",\n    output: {\n      path: \"/\",\n      filename: \"two-[name].js\",\n    },\n    plugins: [new HTMLGeneratorPlugin()],\n    infrastructureLogging: {\n      level: \"info\",\n      stream: {\n        write: () => {},\n      },\n    },\n  },\n];\n"
  },
  {
    "path": "test/fixtures/multi-public-path-config/bar.js",
    "content": "\"use strict\";\n\nconsole.log(\"Hey.\");\n"
  },
  {
    "path": "test/fixtures/multi-public-path-config/baz.js",
    "content": "\"use strict\";\n\nconsole.log(\"Hey.\");\n"
  },
  {
    "path": "test/fixtures/multi-public-path-config/foo.js",
    "content": "\"use strict\";\n\nrequire(\"./test.html\");\n"
  },
  {
    "path": "test/fixtures/multi-public-path-config/test.html",
    "content": "hello\n"
  },
  {
    "path": "test/fixtures/multi-public-path-config/webpack.config.js",
    "content": "\"use strict\";\n\nconst path = require(\"path\");\n\nconst moduleRuleForHTML = {\n  test: /\\.html$/,\n  type: \"asset/resource\",\n  generator: {\n    filename: \"path/to/file.html\",\n  },\n};\n\nmodule.exports = [\n  {\n    mode: \"development\",\n    context: __dirname,\n    stats: \"none\",\n    entry: \"./foo.js\",\n    output: {\n      path: __dirname,\n      filename: \"foo.js\",\n      publicPath: \"/bundle1/\",\n    },\n    infrastructureLogging: {\n      level: \"warn\",\n    },\n    module: {\n      rules: [\n        {\n          ...moduleRuleForHTML,\n        },\n      ],\n    },\n  },\n  {\n    mode: \"development\",\n    context: __dirname,\n    stats: \"none\",\n    entry: \"./bar.js\",\n    output: {\n      path: path.join(__dirname, \"named\"),\n      filename: \"bar.js\",\n      publicPath: \"/bundle2/\",\n    },\n    name: \"named\",\n    infrastructureLogging: {\n      level: \"warn\",\n    },\n  },\n  {\n    mode: \"development\",\n    context: __dirname,\n    entry: \"./bar.js\",\n    output: {\n      path: path.join(__dirname, \"dist\"),\n      filename: \"bar.js\",\n      publicPath: \"auto\",\n    },\n    name: \"other\",\n    stats: false,\n  },\n];\n"
  },
  {
    "path": "test/fixtures/overlay-config/foo.js",
    "content": ""
  },
  {
    "path": "test/fixtures/overlay-config/trusted-types.webpack.config.js",
    "content": "\"use strict\";\n\nconst HTMLGeneratorPlugin = require(\"../../helpers/trusted-types-html-generator-plugin\");\n\nmodule.exports = {\n  mode: \"development\",\n  context: __dirname,\n  stats: \"none\",\n  entry: \"./foo.js\",\n  output: {\n    path: \"/\",\n    trustedTypes: { policyName: \"webpack\" },\n  },\n  infrastructureLogging: {\n    level: \"info\",\n    stream: {\n      write: () => {},\n    },\n  },\n  plugins: [new HTMLGeneratorPlugin()],\n};\n"
  },
  {
    "path": "test/fixtures/overlay-config/webpack.config.js",
    "content": "\"use strict\";\n\nconst HTMLGeneratorPlugin = require(\"../../helpers/html-generator-plugin\");\n\nmodule.exports = {\n  mode: \"development\",\n  context: __dirname,\n  stats: \"none\",\n  entry: \"./foo.js\",\n  output: {\n    path: \"/\",\n  },\n  infrastructureLogging: {\n    level: \"info\",\n    stream: {\n      write: () => {},\n    },\n  },\n  plugins: [new HTMLGeneratorPlugin()],\n};\n"
  },
  {
    "path": "test/fixtures/provide-plugin-custom/foo.js",
    "content": "\"use strict\";\n\n// 'npm run prepare' must be run for this to work during testing\nconst CustomClient = require(\"../../fixtures/custom-client/CustomSockJSClient\");\n\nwindow.expectedClient = CustomClient;\n// eslint-disable-next-line camelcase, no-undef\nwindow.injectedClient = __webpack_dev_server_client__;\n"
  },
  {
    "path": "test/fixtures/provide-plugin-custom/webpack.config.js",
    "content": "\"use strict\";\n\nconst HTMLGeneratorPlugin = require(\"../../helpers/html-generator-plugin\");\n\nmodule.exports = {\n  mode: \"development\",\n  context: __dirname,\n  stats: \"none\",\n  entry: \"./foo.js\",\n  output: {\n    path: \"/\",\n  },\n  node: false,\n  infrastructureLogging: {\n    level: \"info\",\n    stream: {\n      write: () => {},\n    },\n  },\n  plugins: [new HTMLGeneratorPlugin()],\n};\n"
  },
  {
    "path": "test/fixtures/provide-plugin-default/foo.js",
    "content": "\"use strict\";\n\n// 'npm run prepare' must be run for this to work during testing\nconst WebsocketClient =\n  require(\"../../../client/clients/WebSocketClient\").default;\n\nwindow.expectedClient = WebsocketClient;\n// eslint-disable-next-line camelcase, no-undef\nwindow.injectedClient = __webpack_dev_server_client__.default;\n"
  },
  {
    "path": "test/fixtures/provide-plugin-default/webpack.config.js",
    "content": "\"use strict\";\n\nconst HTMLGeneratorPlugin = require(\"../../helpers/html-generator-plugin\");\n\nmodule.exports = {\n  mode: \"development\",\n  context: __dirname,\n  stats: \"none\",\n  entry: \"./foo.js\",\n  output: {\n    path: \"/\",\n  },\n  node: false,\n  infrastructureLogging: {\n    level: \"info\",\n    stream: {\n      write: () => {},\n    },\n  },\n  plugins: [new HTMLGeneratorPlugin()],\n};\n"
  },
  {
    "path": "test/fixtures/provide-plugin-sockjs-config/foo.js",
    "content": "\"use strict\";\n\n// 'npm run prepare' must be run for this to work during testing\nconst SockJSClient = require(\"../../../client/clients/SockJSClient\").default;\n\nwindow.expectedClient = SockJSClient;\n// eslint-disable-next-line camelcase, no-undef\nwindow.injectedClient = __webpack_dev_server_client__.default;\n"
  },
  {
    "path": "test/fixtures/provide-plugin-sockjs-config/webpack.config.js",
    "content": "\"use strict\";\n\nconst HTMLGeneratorPlugin = require(\"../../helpers/html-generator-plugin\");\n\nmodule.exports = {\n  mode: \"development\",\n  context: __dirname,\n  stats: \"none\",\n  entry: \"./foo.js\",\n  output: {\n    path: \"/\",\n  },\n  node: false,\n  infrastructureLogging: {\n    level: \"info\",\n    stream: {\n      write: () => {},\n    },\n  },\n  plugins: [new HTMLGeneratorPlugin()],\n};\n"
  },
  {
    "path": "test/fixtures/provide-plugin-ws-config/foo.js",
    "content": "\"use strict\";\n\n// 'npm run prepare' must be run for this to work during testing\nconst WebsocketClient =\n  require(\"../../../client/clients/WebSocketClient\").default;\n\nwindow.expectedClient = WebsocketClient;\n// eslint-disable-next-line camelcase, no-undef\nwindow.injectedClient = __webpack_dev_server_client__.default;\n"
  },
  {
    "path": "test/fixtures/provide-plugin-ws-config/webpack.config.js",
    "content": "\"use strict\";\n\nconst HTMLGeneratorPlugin = require(\"../../helpers/html-generator-plugin\");\n\nmodule.exports = {\n  mode: \"development\",\n  context: __dirname,\n  stats: \"none\",\n  entry: \"./foo.js\",\n  output: {\n    path: \"/\",\n  },\n  node: false,\n  infrastructureLogging: {\n    level: \"info\",\n    stream: {\n      write: () => {},\n    },\n  },\n  plugins: [new HTMLGeneratorPlugin()],\n};\n"
  },
  {
    "path": "test/fixtures/proxy-config/foo.js",
    "content": "\"use strict\";\n\nconsole.log(\"Hey.\");\n"
  },
  {
    "path": "test/fixtures/proxy-config/index.html",
    "content": "Hello\n"
  },
  {
    "path": "test/fixtures/proxy-config/webpack.config.js",
    "content": "\"use strict\";\n\nmodule.exports = {\n  mode: \"development\",\n  context: __dirname,\n  stats: \"none\",\n  entry: \"./foo.js\",\n  output: {\n    path: \"/\",\n  },\n  infrastructureLogging: {\n    level: \"warn\",\n  },\n};\n"
  },
  {
    "path": "test/fixtures/reload-config/foo.js",
    "content": "\"use strict\";\n\nrequire(\"./main.css\");\n"
  },
  {
    "path": "test/fixtures/reload-config/webpack.config.js",
    "content": "\"use strict\";\n\nconst HTMLGeneratorPlugin = require(\"../../helpers/html-generator-plugin\");\n\nmodule.exports = {\n  mode: \"development\",\n  context: __dirname,\n  entry: \"./foo.js\",\n  stats: \"none\",\n  output: {\n    path: \"/\",\n  },\n  module: {\n    rules: [\n      {\n        test: /\\.css$/,\n        use: [{ loader: \"style-loader\" }, { loader: \"css-loader\" }],\n      },\n    ],\n  },\n  infrastructureLogging: {\n    level: \"info\",\n    stream: {\n      write: () => {},\n    },\n  },\n  plugins: [new HTMLGeneratorPlugin()],\n};\n"
  },
  {
    "path": "test/fixtures/reload-config-2/foo.js",
    "content": "\"use strict\";\n\n// eslint-disable-next-line import/no-unresolved\nrequire(\"./main.css\");\n"
  },
  {
    "path": "test/fixtures/reload-config-2/webpack.config.js",
    "content": "\"use strict\";\n\nconst HTMLGeneratorPlugin = require(\"../../helpers/html-generator-plugin\");\n\nmodule.exports = {\n  mode: \"development\",\n  context: __dirname,\n  stats: \"none\",\n  entry: \"./foo.js\",\n  output: {\n    path: \"/\",\n  },\n  module: {\n    rules: [\n      {\n        test: /\\.css$/,\n        use: [{ loader: \"style-loader\" }, { loader: \"css-loader\" }],\n      },\n    ],\n  },\n  node: false,\n  infrastructureLogging: {\n    level: \"info\",\n    stream: {\n      write: () => {},\n    },\n  },\n  plugins: [new HTMLGeneratorPlugin()],\n};\n"
  },
  {
    "path": "test/fixtures/schema/webpack.config.simple.js",
    "content": "\"use strict\";\n\nmodule.exports = {\n  mode: \"development\",\n  context: __dirname,\n  entry: \"./foo.js\",\n  output: {\n    path: \"/\",\n  },\n  infrastructureLogging: {\n    level: \"warn\",\n  },\n};\n"
  },
  {
    "path": "test/fixtures/simple-config/foo.js",
    "content": "\"use strict\";\n\nconsole.log(\"Hey.\");\n"
  },
  {
    "path": "test/fixtures/simple-config/webpack.config.js",
    "content": "\"use strict\";\n\nconst HTMLGeneratorPlugin = require(\"../../helpers/html-generator-plugin\");\n\nmodule.exports = {\n  mode: \"development\",\n  context: __dirname,\n  stats: \"none\",\n  entry: \"./foo.js\",\n  output: {\n    path: \"/\",\n  },\n  node: false,\n  infrastructureLogging: {\n    level: \"info\",\n    stream: {\n      write: () => {},\n    },\n  },\n  plugins: [new HTMLGeneratorPlugin()],\n};\n"
  },
  {
    "path": "test/fixtures/simple-config-other/foo.js",
    "content": "\"use strict\";\n\nconsole.log(\n  \"Very Very Very Very Very Very Very Very Very Very Very Very Very Very Very Very Very Very Very Very Very Very Very Very Very Very Very Very Very Very Very Very Very Very Very Very Very Very Very Very Very Very Very Very Very Very Very Very Very Very Very Very Very Very Very Very Very Very Very Very Very Very Very Very Very Very Very Very Very Very Very Very Very Very Very Very Very Very Very Very Very Very Very Very Very Very Very Very Very Very Very Very Very Very Very Very Very Very Very Very Very Very Very Very Very Very Very Very Very Very Very Very Very Very Very Very Very Very Very Very Very Very Very Very Very Very Very Very Very Very Very Very Very Very Very Very Very Very Very Very Very Very Very Very Very Very Very Very Very Very Very Very Very Very Very Very Very Very Very Very Very Very Very Very Very Very Very Very Very Very Very Very Very Long Line.\",\n);\n"
  },
  {
    "path": "test/fixtures/simple-config-other/webpack.config.js",
    "content": "\"use strict\";\n\nmodule.exports = {\n  mode: \"development\",\n  context: __dirname,\n  stats: \"none\",\n  entry: \"./foo.js\",\n  output: {\n    path: \"/\",\n  },\n  node: false,\n  infrastructureLogging: {\n    level: \"warn\",\n  },\n};\n"
  },
  {
    "path": "test/fixtures/ssl/localhost-cert.pem",
    "content": "-----BEGIN CERTIFICATE-----\nMIIDCTCCAfGgAwIBAgIUevWiuCfenWuq9KyC8aQ/tc1Io14wDQYJKoZIhvcNAQEL\nBQAwFDESMBAGA1UEAwwJbG9jYWxob3N0MB4XDTI0MDQyNDE2MDYyMloXDTI0MDUy\nNDE2MDYyMlowFDESMBAGA1UEAwwJbG9jYWxob3N0MIIBIjANBgkqhkiG9w0BAQEF\nAAOCAQ8AMIIBCgKCAQEA1v/lb9u9WkqkF7zjIKe2R+b4S0sQnWIfBFZ0ggtaOL0a\nntud/EuaGQgLtJgSwO2M2xIqKx+yoLhoM+273EJe0KmfJMxYNAkhwP9h6vrKnaQJ\nmpAhoalfEGyCrnHHMKISAAn4Rlc8NXnULoFhHzNm8bdqvP33rCmsJ+tNYC5kwzyt\nHvRNFyg9BOUfACiPW17opFH0rao3IfZrQ6yRbknef1pX1x2pbDAH14rCT/vXaTs6\nVGuqLE/wRsSt+7nMHy/PmXxMyb4G4/UflYtnKfmXpDRw+TDEGzvTZedtoOz+rrJC\ne989R9qYGrlPfyfZbI+O348FV66I+jcD+/EUQs+HkwIDAQABo1MwUTAdBgNVHQ4E\nFgQU6bk4LSwtVQEt7V/ev+Zj270zdAkwHwYDVR0jBBgwFoAU6bk4LSwtVQEt7V/e\nv+Zj270zdAkwDwYDVR0TAQH/BAUwAwEB/zANBgkqhkiG9w0BAQsFAAOCAQEAUBgo\nE3CZrrc/MaadFg1meNk+eKACmTsIa5cT6zi7MsvoKakXEd4bGd+iLifUzlAa1ygj\ndQppfprb5t68I7oO9/lkh2DfKrXxW/RpdhB05KslUd8q/3XY5kyao5quzeiVoMHR\nu+XYjoy2mTwdUC2uzFy6rkHsAkJy2vJJoDdlNsrKn6AZmh+voHHKrAtOL4gnanQV\nwR1u8eBVfk2MKIl2pNSCA4bD16uZyp3+oqq097BEoVa1pR+l8nwbsh/YfALifq/d\nP3yiN5+EqgiOIF9b8PZORe+Ry1O7uvPnU2ZRkVWPJ1S17Ms0lnr7IY3qjSBTuK66\n5uYi7ojrb5Vf0UL5oQ==\n-----END CERTIFICATE-----\n"
  },
  {
    "path": "test/fixtures/ssl/localhost-privkey.pem",
    "content": "-----BEGIN PRIVATE KEY-----\nMIIEugIBADANBgkqhkiG9w0BAQEFAASCBKQwggSgAgEAAoIBAQDW/+Vv271aSqQX\nvOMgp7ZH5vhLSxCdYh8EVnSCC1o4vRqe2538S5oZCAu0mBLA7YzbEiorH7KguGgz\n7bvcQl7QqZ8kzFg0CSHA/2Hq+sqdpAmakCGhqV8QbIKucccwohIACfhGVzw1edQu\ngWEfM2bxt2q8/fesKawn601gLmTDPK0e9E0XKD0E5R8AKI9bXuikUfStqjch9mtD\nrJFuSd5/WlfXHalsMAfXisJP+9dpOzpUa6osT/BGxK37ucwfL8+ZfEzJvgbj9R+V\ni2cp+ZekNHD5MMQbO9Nl522g7P6uskJ73z1H2pgauU9/J9lsj47fjwVXroj6NwP7\n8RRCz4eTAgMBAAECggEAA+zbFv43iEj5kvdfXC7DrK9iVBmUPZNXhqA/c0paxNNr\nA4B182+76f4UHKF0IjKUEkHUJEJpY/bJ7DzIY76QdZXLMoRKjfSmuZvQAVa/0T33\n8Or1ujpZ4nZgsmegX9ptorOL5VjdYAqP3aN+DvBEzl/vYnDujyWZn4bzvDBMpaXS\n39qW1MkcZ8UiP1fRad76+S57WnieBV+NRHYEAiDdMFKXLuw/igX/xOSZgq5Jh3I2\nhLS49S41dN1P9l9H2bPMw0CthNvMPPaemwKHz+84hSS+P4VJOWJzlGnXEdIFuqBR\nGFBESQzcemfS9DDB22Yt06YujBCbwTVVAxj73lnKkQKBgQDvYXK36J9y/NphDAWi\nCwti5oE3eSfV0YazQwm+rRwC64wbpBFAm9ujwjUmaYBg75lBLF5nOOe8s1n95g5I\ntLfFb+zuZh8NNLjhfNE9/SNmRnnMvbcaDHeIE2RMAz+PuLN/gFLmsVIwK2X1LRC2\n0vHjw9Yzh6JLiOajAchzhZiCEQKBgQDl7R6Wfggo8myETA8Uv5tWot3IcquRkEl/\nTRCyao2/79rAGexS7piwD7FPdSDOk1zfZFYUOMzyMjj60sGcPRPqRX6D0usEODLQ\nTwsTJSCNgPnIOkqKkccwtqlTimbRIrPUSQfFPj56RzKKWdrJ/P3LPRjzkK7i3vLV\nEGlAENaLYwKBgHKSOnzpWr+HY+IFBgErthRs7LWnSDifYxATauuXIQwIvvNP0G4S\n6snzHss2vZonszstSDWxV8DKOq052eZUkIxv6H+l4wDIFiDeQ6uep73Ax3UF7EgM\nZX18gombGGXqagcBXSxK/GJPsynomtJWHi38Ql5BcZ0jdffY157q9zZxAoGAPZtD\nTt+GIDKUkP4wLEcKwDPzaPoQrngSuWFUz/ls8bi6zC4l/DKiBsqtn7Sqja8+ezzP\nM6vkfiCm084UwmA7LdJhC8E/52mHc/k55m9UQZYFV3kG8AoPbSYESLYUxoSd2ouW\n4WrEIs9g42EgFm8LMaG1Rc3GjlNejWhQSzI3yjECf3v7VoAcUwVfuVkwbm9W24vR\nneFTF8QBl//fxIdxZwoj5SrSgMOjmZ3pXA/ZbFJ0pB4Rh5dmKTYqdpfXsOTiBuwB\nXlqPVpN8UZEl3edpufLDyPldNej/9kEAkK5FS3YVyIQEg75739bCTlfzzCX1HdMx\nq98XYm/n5LWYFezsAt0=\n-----END PRIVATE KEY-----\n"
  },
  {
    "path": "test/fixtures/static/foo.js",
    "content": "\"use strict\";\n\nconsole.log(\"i am foo!\");\n"
  },
  {
    "path": "test/fixtures/static/static/index.html",
    "content": "<!doctype html>\n<html lang=\"en\">\n  <head>\n    <meta charset=\"UTF-8\" />\n    <meta\n      name=\"viewport\"\n      content=\"width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0\"\n    />\n    <meta http-equiv=\"X-UA-Compatible\" content=\"ie=edge\" />\n    <title>Document</title>\n  </head>\n  <body>\n    Test\n  </body>\n</html>\n"
  },
  {
    "path": "test/fixtures/static/webpack.config.js",
    "content": "\"use strict\";\n\nconst path = require(\"path\");\n\nmodule.exports = {\n  mode: \"development\",\n  entry: path.resolve(__dirname, \"foo.js\"),\n  devServer: {\n    static: path.resolve(__dirname, \"static\"),\n  },\n};\n"
  },
  {
    "path": "test/fixtures/static-config/foo.js",
    "content": "\"use strict\";\n\nconsole.log(\"Hey.\");\n"
  },
  {
    "path": "test/fixtures/static-config/other/foo.html",
    "content": "Foo!\n"
  },
  {
    "path": "test/fixtures/static-config/public/assets/example.txt",
    "content": ""
  },
  {
    "path": "test/fixtures/static-config/public/assets/other.txt",
    "content": ""
  },
  {
    "path": "test/fixtures/static-config/public/bar/index.html",
    "content": "Heyo\n"
  },
  {
    "path": "test/fixtures/static-config/public/foo.wasm",
    "content": ""
  },
  {
    "path": "test/fixtures/static-config/public/index.html",
    "content": "Heyo.\n"
  },
  {
    "path": "test/fixtures/static-config/public/node_modules/.gitkeep",
    "content": ""
  },
  {
    "path": "test/fixtures/static-config/public/other.html",
    "content": "Other html\n"
  },
  {
    "path": "test/fixtures/static-config/static/index.html",
    "content": "Heyo.\n"
  },
  {
    "path": "test/fixtures/static-config/webpack.config.js",
    "content": "\"use strict\";\n\nmodule.exports = {\n  mode: \"development\",\n  context: __dirname,\n  stats: \"none\",\n  entry: \"./foo.js\",\n  output: {\n    publicPath: \"/\",\n  },\n  infrastructureLogging: {\n    level: \"warn\",\n  },\n};\n"
  },
  {
    "path": "test/fixtures/universal-compiler-config/browser.js",
    "content": "\"use strict\";\n\nconsole.log(\"Hello from the browser\");\n"
  },
  {
    "path": "test/fixtures/universal-compiler-config/server.js",
    "content": "\"use strict\";\n\nconsole.log(\"Hello from the server\");\n"
  },
  {
    "path": "test/fixtures/universal-compiler-config/webpack.config.js",
    "content": "\"use strict\";\n\nconst HTMLGeneratorPlugin = require(\"../../helpers/html-generator-plugin\");\n\nmodule.exports = [\n  {\n    name: \"browser\",\n    mode: \"development\",\n    context: __dirname,\n    stats: \"none\",\n    entry: \"./browser.js\",\n    output: {\n      path: \"/\",\n      filename: \"browser.js\",\n    },\n    plugins: [new HTMLGeneratorPlugin()],\n    infrastructureLogging: {\n      level: \"info\",\n      stream: {\n        write: () => {},\n      },\n    },\n  },\n  {\n    name: \"server\",\n    mode: \"development\",\n    context: __dirname,\n    target: \"node\",\n    stats: \"none\",\n    entry: \"./server.js\",\n    output: {\n      path: \"/\",\n      filename: \"server.js\",\n    },\n    plugins: [new HTMLGeneratorPlugin()],\n    infrastructureLogging: {\n      level: \"info\",\n      stream: {\n        write: () => {},\n      },\n    },\n  },\n];\n"
  },
  {
    "path": "test/fixtures/watch-files-config/foo.js",
    "content": "\"use strict\";\n\nconsole.log(\"Hey.\");\n"
  },
  {
    "path": "test/fixtures/watch-files-config/other/foo.html",
    "content": "Foo!\n"
  },
  {
    "path": "test/fixtures/watch-files-config/public/assets/example.txt",
    "content": ""
  },
  {
    "path": "test/fixtures/watch-files-config/public/assets/other.txt",
    "content": ""
  },
  {
    "path": "test/fixtures/watch-files-config/public/bar/index.html",
    "content": "Heyo\n"
  },
  {
    "path": "test/fixtures/watch-files-config/public/other.html",
    "content": "Other html\n"
  },
  {
    "path": "test/fixtures/watch-files-config/static/index.html",
    "content": "Heyo.\n"
  },
  {
    "path": "test/fixtures/watch-files-config/webpack.config.js",
    "content": "\"use strict\";\n\nconst HTMLGeneratorPlugin = require(\"../../helpers/html-generator-plugin\");\n\nmodule.exports = {\n  mode: \"development\",\n  devtool: false,\n  context: __dirname,\n  stats: \"none\",\n  entry: \"./foo.js\",\n  output: {\n    publicPath: \"/\",\n  },\n  infrastructureLogging: {\n    level: \"warn\",\n  },\n  plugins: [new HTMLGeneratorPlugin()],\n};\n"
  },
  {
    "path": "test/fixtures/worker-config/index.js",
    "content": "\"use strict\";\n\nconst myWorker = new Worker(\"./worker.js\");\n\nmyWorker.onmessage = (event) => {\n  console.log(`Worker said: ${event.data}`);\n};\n\nmyWorker.postMessage(\"message\");\n"
  },
  {
    "path": "test/fixtures/worker-config/webpack.config.js",
    "content": "\"use strict\";\n\nconst HTMLGeneratorPlugin = require(\"../../helpers/html-generator-plugin\");\n\nmodule.exports = [\n  {\n    name: \"app\",\n    dependencies: [\"worker\"],\n    devtool: false,\n    target: \"web\",\n    entry: \"./index.js\",\n    mode: \"development\",\n    context: __dirname,\n    stats: \"none\",\n    output: {\n      path: \"/\",\n    },\n    infrastructureLogging: {\n      level: \"info\",\n      stream: {\n        write: () => {},\n      },\n    },\n    plugins: [new HTMLGeneratorPlugin()],\n  },\n  {\n    name: \"worker\",\n    devtool: false,\n    target: \"webworker\",\n    entry: \"./worker.js\",\n    mode: \"development\",\n    context: __dirname,\n    stats: \"none\",\n    output: {\n      path: \"/\",\n      filename: \"worker.js\",\n    },\n    infrastructureLogging: {\n      level: \"info\",\n      stream: {\n        write: () => {},\n      },\n    },\n  },\n];\n"
  },
  {
    "path": "test/fixtures/worker-config/worker.js",
    "content": "\"use strict\";\n\npostMessage(\"I'm working before postMessage\");\n\nonmessage = (event) => {\n  postMessage(`Message sent: ${event.data}`);\n};\n"
  },
  {
    "path": "test/fixtures/worker-config-dev-server-false/index.js",
    "content": "\"use strict\";\n\nconst myWorker = new Worker(\"./worker-bundle.js\");\n\nmyWorker.onmessage = (event) => {\n  console.log(`Worker said: ${event.data}`);\n};\n\nmyWorker.postMessage(\"message\");\n"
  },
  {
    "path": "test/fixtures/worker-config-dev-server-false/webpack.config.js",
    "content": "\"use strict\";\n\nconst path = require(\"path\");\nconst HTMLGeneratorPlugin = require(\"../../helpers/html-generator-plugin\");\n\nmodule.exports = [\n  {\n    name: \"app\",\n    // dependencies: [\"worker\"],\n    devtool: false,\n    target: \"web\",\n    entry: \"./index.js\",\n    mode: \"development\",\n    context: __dirname,\n    stats: \"none\",\n    output: {\n      path: path.resolve(__dirname, \"./dist/\"),\n    },\n    infrastructureLogging: {\n      level: \"info\",\n      stream: {\n        write: () => {},\n      },\n    },\n    plugins: [new HTMLGeneratorPlugin()],\n  },\n  {\n    name: \"worker\",\n    devtool: false,\n    target: \"webworker\",\n    entry: \"./worker.js\",\n    mode: \"development\",\n    context: __dirname,\n    stats: \"none\",\n    output: {\n      path: path.resolve(__dirname, \"public\"),\n      filename: \"worker-bundle.js\",\n    },\n    infrastructureLogging: {\n      level: \"info\",\n      stream: {\n        write: () => {},\n      },\n    },\n    devServer: false,\n  },\n];\n"
  },
  {
    "path": "test/fixtures/worker-config-dev-server-false/worker.js",
    "content": "\"use strict\";\n\npostMessage(\"I'm working before postMessage\");\n\nonmessage = (event) => {\n  postMessage(`Message sent: ${event.data}`);\n};\n"
  },
  {
    "path": "test/helpers/ExitOnDonePlugin.js",
    "content": "\"use strict\";\n\nmodule.exports = class ExitOnDonePlugin {\n  apply(compiler) {\n    compiler.hooks.afterDone.tap(\"webpack-dev-server\", (stats) => {\n      let exitCode = 0;\n\n      if (stats.hasErrors()) {\n        exitCode = 1;\n      }\n\n      setImmediate(() => {\n        // eslint-disable-next-line n/no-process-exit\n        process.exit(exitCode);\n      });\n    });\n  }\n};\n"
  },
  {
    "path": "test/helpers/conditional-test.js",
    "content": "\"use strict\";\n\n/* global test */\n\nconst isWindows = process.platform === \"win32\";\n\n/**\n * @param {string} reason reason\n * @returns {boolean} true when it is windows, otherwise false\n */\nfunction skipTestOnWindows(reason) {\n  if (isWindows) {\n    test.skip(reason, () => {});\n  }\n\n  return isWindows;\n}\n\nmodule.exports.skipTestOnWindows = skipTestOnWindows;\n"
  },
  {
    "path": "test/helpers/custom-http.js",
    "content": "\"use strict\";\n\nconst customHTTP = require(\"node:http\");\n\nmodule.exports = customHTTP;\n"
  },
  {
    "path": "test/helpers/html-generator-plugin.js",
    "content": "\"use strict\";\n\nconst HTMLContentForIndex = `\n<!DOCTYPE html>\n<html>\n  <head>\n    <meta charset='UTF-8'>\n    <title>webpack-dev-server</title>\n  </head>\n  <body>\n    <h1>webpack-dev-server is running...</h1>\n    <script type=\"text/javascript\" charset=\"utf-8\" src=\"/main.js\"></script>\n  </body>\n</html>\n`;\n\nconst HTMLContentForAssets = (assetName) => `\n<!DOCTYPE html>\n<html>\n  <head>\n    <meta charset='UTF-8'>\n    <title>webpack-dev-server</title>\n  </head>\n  <body>\n    <h1>(${assetName}>)webpack-dev-server is running...</h1>\n    <script type=\"text/javascript\" charset=\"utf-8\" src=${assetName}></script>\n  </body>\n</html>\n`;\n\nconst HTMLContentForTest = `\n<!DOCTYPE html>\n<html>\n  <head>\n    <meta charset='UTF-8'>\n    <title>test</title>\n  </head>\n  <body>\n    <h1>Created via HTMLGeneratorPlugin</h1>\n  </body>\n</html>\n`;\n\nmodule.exports = class HTMLGeneratorPlugin {\n  apply(compiler) {\n    const pluginName = \"html-generator-plugin\";\n\n    compiler.hooks.thisCompilation.tap(pluginName, (compilation) => {\n      const { RawSource } = compiler.webpack.sources;\n\n      compilation.hooks.processAssets.tap(\n        {\n          name: pluginName,\n          stage: compiler.webpack.Compilation.PROCESS_ASSETS_STAGE_ADDITIONAL,\n        },\n        () => {\n          const indexSource = new RawSource(HTMLContentForIndex);\n          const testSource = new RawSource(HTMLContentForTest);\n          const assets = compilation.getAssets();\n\n          compilation.emitAsset(\"index.html\", indexSource);\n          compilation.emitAsset(\"test.html\", testSource);\n\n          for (const asset of assets) {\n            const assetName = asset.name;\n\n            if (assetName !== \"main.js\") {\n              const assetSource = new RawSource(\n                // eslint-disable-next-line new-cap\n                HTMLContentForAssets(assetName),\n              );\n              compilation.emitAsset(\n                assetName.replace(\".js\", \".html\"),\n                assetSource,\n              );\n            }\n          }\n        },\n      );\n    });\n  }\n};\n"
  },
  {
    "path": "test/helpers/normalize-options.js",
    "content": "\"use strict\";\n\n/**\n * @param {import(\"https\").ServerOptions} options server options\n * @returns {Record<string, string | string[] | boolean>} normalized server options\n */\nfunction normalizeOptions(options) {\n  const normalizedOptions = {};\n\n  for (const propertyName in options) {\n    let value = options[propertyName];\n\n    if (Array.isArray(value)) {\n      value = value.map((item) => {\n        if (Buffer.isBuffer(item)) {\n          return \"<Buffer>\";\n        } else if (\n          typeof item.pem !== \"undefined\" &&\n          Buffer.isBuffer(item.pem)\n        ) {\n          item.pem = \"<Buffer>\";\n        } else if (\n          typeof item.buf !== \"undefined\" &&\n          Buffer.isBuffer(item.buf)\n        ) {\n          item.buf = \"<Buffer>\";\n        }\n\n        return item;\n      });\n    } else if (Buffer.isBuffer(value)) {\n      value = \"<Buffer>\";\n    }\n\n    normalizedOptions[propertyName] = value;\n  }\n\n  return normalizedOptions;\n}\n\nmodule.exports = normalizeOptions;\n"
  },
  {
    "path": "test/helpers/puppeteer-constants.js",
    "content": "\"use strict\";\n\nmodule.exports = {\n  reloadReadyDelay: 5000,\n  completeReloadDelay: 10000,\n  initConsoleDelay: 3000,\n  awaitServerCloseDelay: 1000,\n  beforeBrowserCloseDelay: 3000,\n  puppeteerArgs: [\n    \"--disable-background-timer-throttling\",\n    \"--disable-breakpad\",\n    \"--disable-client-side-phishing-detection\",\n    \"--disable-cloud-import\",\n    \"--disable-default-apps\",\n    \"--disable-dev-shm-usage\",\n    \"--disable-extensions\",\n    \"--disable-gesture-typing\",\n    \"--disable-hang-monitor\",\n    \"--disable-infobars\",\n    \"--disable-notifications\",\n    \"--disable-offer-store-unmasked-wallet-cards\",\n    \"--disable-offer-upload-credit-cards\",\n    \"--disable-popup-blocking\",\n    \"--disable-print-preview\",\n    \"--disable-prompt-on-repost\",\n    \"--disable-setuid-sandbox\",\n    \"--disable-speech-api\",\n    \"--disable-sync\",\n    \"--disable-tab-for-desktop-share\",\n    \"--disable-translate\",\n    \"--disable-voice-input\",\n    \"--disable-wake-on-wifi\",\n    \"--enable-async-dns\",\n    \"--enable-simple-cache-backend\",\n    \"--enable-tcp-fast-open\",\n    \"--enable-webgl\",\n    \"--hide-scrollbars\",\n    \"--ignore-gpu-blacklist\",\n    \"--media-cache-size=33554432\",\n    \"--metrics-recording-only\",\n    \"--mute-audio\",\n    \"--no-default-browser-check\",\n    \"--no-first-run\",\n    \"--no-pings\",\n    \"--no-sandbox\",\n    \"--no-zygote\",\n    \"--password-store=basic\",\n    \"--prerender-from-omnibox=disabled\",\n    \"--use-gl=swiftshader\",\n    \"--use-mock-keychain\",\n    \"--disable-field-trial-config\",\n  ],\n};\n"
  },
  {
    "path": "test/helpers/run-browser.js",
    "content": "\"use strict\";\n\nconst puppeteer = require(\"puppeteer\");\nconst { puppeteerArgs } = require(\"./puppeteer-constants\");\n\n/** @typedef {import('puppeteer').Browser} Browser */\n/** @typedef {import('puppeteer').Page} Page */\n/** @typedef {import('puppeteer').Device} Device */\n\n/**\n * @typedef {object} RunBrowserResult\n * @property {Page} page page\n * @property {Browser} browser browser\n */\n\n/**\n * @param {Browser} browser browser\n * @param {Device} device config\n * @returns {Promise<Page>} page\n */\nfunction runPage(browser, device) {\n  /**\n   * @type {Page}\n   */\n  let page;\n\n  const options = {\n    viewport: {\n      width: 500,\n      height: 500,\n    },\n    userAgent: \"\",\n    ...device,\n  };\n\n  return Promise.resolve()\n    .then(() => browser.newPage())\n    .then((newPage) => {\n      page = newPage;\n      page.emulate(options);\n\n      return page.setRequestInterception(true);\n    })\n    .then(() => {\n      page.on(\"request\", (interceptedRequest) => {\n        if (interceptedRequest.isInterceptResolutionHandled()) return;\n        if (interceptedRequest.url().includes(\"favicon.ico\")) {\n          interceptedRequest.respond({\n            status: 200,\n            contentType: \"image/png\",\n            body: \"Empty\",\n          });\n        } else {\n          interceptedRequest.continue(\n            interceptedRequest.continueRequestOverrides(),\n            10,\n          );\n        }\n      });\n\n      return page;\n    });\n}\n\n/**\n * @param {Device} device device\n * @returns {Promise<RunBrowserResult>} browser result\n */\nfunction runBrowser(device) {\n  return new Promise((resolve, reject) => {\n    /**\n     * @type {import('puppeteer').Page}\n     */\n    let page;\n    /**\n     * @type {import('puppeteer').Browser}\n     */\n    let browser;\n\n    puppeteer\n      .launch({\n        headless: \"new\",\n        // because of invalid localhost certificate\n        acceptInsecureCerts: true,\n        // args come from: https://github.com/alixaxel/chrome-aws-lambda/blob/master/source/index.js\n        args: puppeteerArgs,\n      })\n      .then((launchedBrowser) => {\n        browser = launchedBrowser;\n\n        return runPage(launchedBrowser, device);\n      })\n      .then((newPage) => {\n        page = newPage;\n\n        resolve({ page, browser });\n      })\n      .catch(reject);\n  });\n}\n\nmodule.exports = runBrowser;\nmodule.exports.runPage = runPage;\n"
  },
  {
    "path": "test/helpers/session-subscribe.js",
    "content": "\"use strict\";\n\nmodule.exports = async function sessionSubscribe(session) {\n  session.on(\"sessionattached\", (attachedSession) => {\n    sessionSubscribe(attachedSession);\n  });\n  session.send(\"Network.enable\");\n  session.send(\"Runtime.runIfWaitingForDebugger\");\n};\n"
  },
  {
    "path": "test/helpers/snapshotResolver.js",
    "content": "\"use strict\";\n\nconst path = require(\"node:path\");\nconst webpack = require(\"webpack\");\n\nconst [webpackVersion] = webpack.version;\nconst snapshotExtension = `.snap.webpack${webpackVersion}`;\n\nmodule.exports = {\n  resolveSnapshotPath: (testPath) =>\n    path.join(\n      path.dirname(testPath),\n      \"__snapshots__\",\n      `${path.basename(testPath)}${snapshotExtension}`,\n    ),\n  resolveTestPath: (snapshotPath) =>\n    snapshotPath\n      .replace(`${path.sep}__snapshots__`, \"\")\n      .slice(0, -snapshotExtension.length),\n  testPathForConsistencyCheck: path.join(\n    \"consistency_check\",\n    \"__tests__\",\n    \"example.test.js\",\n  ),\n};\n"
  },
  {
    "path": "test/helpers/test-bin.js",
    "content": "\"use strict\";\n\nconst os = require(\"node:os\");\nconst path = require(\"node:path\");\nconst util = require(\"node:util\");\nconst execa = require(\"execa\");\nconst { Writable } = require(\"readable-stream\");\n\nconst webpackDevServerPath = path.resolve(\n  __dirname,\n  \"../../bin/webpack-dev-server.js\",\n);\nconst basicConfigPath = path.resolve(\n  __dirname,\n  \"../fixtures/cli/webpack.config.js\",\n);\n\n// const isWindows = process.platform === \"win32\";\n\nconst processKill = (process) => {\n  process.kill();\n\n  // if (isWindows) {\n  //   exec(`taskkill /pid ${process.pid} /T /F`);\n  // } else {\n  //   process.kill();\n  // }\n};\n\nconst testBin = (testArgs = [], options = {}) => {\n  const cwd = process.cwd();\n  const env = {\n    WEBPACK_CLI_HELP_WIDTH: 2048,\n    NODE_ENV: process.env.NODE_ENV,\n  };\n\n  if (typeof testArgs === \"string\") {\n    testArgs = testArgs.split(\" \");\n  }\n\n  let args;\n\n  if (testArgs.includes(\"--help\")) {\n    args = [webpackDevServerPath, ...testArgs];\n  } else {\n    const configOptions = testArgs.includes(\"--config\")\n      ? []\n      : [\"--config\", basicConfigPath];\n\n    args = [webpackDevServerPath, ...configOptions, ...testArgs];\n  }\n\n  return new Promise((resolve, reject) => {\n    const outputKillStr =\n      options.outputKillStr ||\n      /Content not from webpack is served|For using 'serve' command you need to install/;\n    const subprocess = execa(\"node\", args, {\n      cwd,\n      env,\n      stdio: \"pipe\",\n      maxBuffer: Infinity,\n      reject: false,\n      ...options,\n    });\n\n    subprocess.stdout.pipe(\n      new Writable({\n        write(chunk, encoding, callback) {\n          const str = chunk.toString();\n          const output = util.stripVTControlCharacters(str);\n\n          if (outputKillStr.test(output)) {\n            processKill(subprocess);\n          }\n\n          callback();\n        },\n      }),\n    );\n\n    subprocess.stderr.pipe(\n      new Writable({\n        write(chunk, encoding, callback) {\n          const str = chunk.toString();\n          const output = util.stripVTControlCharacters(str);\n\n          if (outputKillStr.test(output)) {\n            processKill(subprocess);\n          }\n\n          callback();\n        },\n      }),\n    );\n\n    subprocess\n      .then((result) => {\n        // Sometimes we will kill our process early, so there is no exit code\n        if (!result.exitCode) {\n          result.exitCode = 0;\n        }\n\n        resolve(result);\n      })\n      .catch((error) => {\n        reject(error);\n      });\n  });\n};\n\nconst ipV4 =\n  \"(?:25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]\\\\d|\\\\d)(?:\\\\.(?:25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]\\\\d|\\\\d)){3}\";\nconst ipV6Seg = \"[a-fA-F\\\\d]{1,4}\";\nconst ipV6 = `\n(?:\n(?:${ipV6Seg}:){7}(?:${ipV6Seg}|:)|                                        // 1:2:3:4:5:6:7::  1:2:3:4:5:6:7:8\n(?:${ipV6Seg}:){6}(?:${ipV4}|:${ipV6Seg}|:)|                               // 1:2:3:4:5:6::    1:2:3:4:5:6::8   1:2:3:4:5:6::8  1:2:3:4:5:6::1.2.3.4\n(?:${ipV6Seg}:){5}(?::${ipV4}|(?::${ipV6Seg}){1,2}|:)|                     // 1:2:3:4:5::      1:2:3:4:5::7:8   1:2:3:4:5::8    1:2:3:4:5::7:1.2.3.4\n(?:${ipV6Seg}:){4}(?:(?::${ipV6Seg}){0,1}:${ipV4}|(?::${ipV6Seg}){1,3}|:)| // 1:2:3:4::        1:2:3:4::6:7:8   1:2:3:4::8      1:2:3:4::6:7:1.2.3.4\n(?:${ipV6Seg}:){3}(?:(?::${ipV6Seg}){0,2}:${ipV4}|(?::${ipV6Seg}){1,4}|:)| // 1:2:3::          1:2:3::5:6:7:8   1:2:3::8        1:2:3::5:6:7:1.2.3.4\n(?:${ipV6Seg}:){2}(?:(?::${ipV6Seg}){0,3}:${ipV4}|(?::${ipV6Seg}){1,5}|:)| // 1:2::            1:2::4:5:6:7:8   1:2::8          1:2::4:5:6:7:1.2.3.4\n(?:${ipV6Seg}:){1}(?:(?::${ipV6Seg}){0,4}:${ipV4}|(?::${ipV6Seg}){1,6}|:)| // 1::              1::3:4:5:6:7:8   1::8            1::3:4:5:6:7:1.2.3.4\n(?::(?:(?::${ipV6Seg}){0,5}:${ipV4}|(?::${ipV6Seg}){1,7}|:))               // ::2:3:4:5:6:7:8  ::2:3:4:5:6:7:8  ::8             ::1.2.3.4\n)(?:%[0-9a-zA-Z]{1,})?                                                     // %eth0            %1\n`\n  .replaceAll(/\\s*\\/\\/.*$/gm, \"\")\n  .replaceAll(\"\\n\", \"\")\n  .trim();\n\nconst normalizeStderr = (stderr, options = {}) => {\n  let normalizedStderr = util.stripVTControlCharacters(stderr);\n\n  normalizedStderr = normalizedStderr\n    .replaceAll(\"\\\\\", \"/\")\n    .replaceAll(new RegExp(process.cwd().replaceAll(\"\\\\\", \"/\"), \"g\"), \"<cwd>\")\n    .replaceAll(new RegExp(os.tmpdir().replaceAll(\"\\\\\", \"/\"), \"g\"), \"<tmp>\")\n    .replaceAll(new RegExp(\"\\\\\\\\.\\\\pipe\".replaceAll(\"\\\\\", \"/\"), \"g\"), \"<tmp>\")\n    .replaceAll(new RegExp(ipV4, \"g\"), \"<ip-v4>\")\n    .replaceAll(new RegExp(ipV6, \"g\"), \"<ip-v6>\");\n\n  // normalize node warnings\n  normalizedStderr = normalizedStderr.replaceAll(\n    /.*DeprecationWarning.*(\\n)*/gm,\n    \"\",\n  );\n  normalizedStderr = normalizedStderr.replaceAll(\n    /.*Use `node --trace-deprecation ...` to show where the warning was created.*(\\n)*/gm,\n    \"\",\n  );\n\n  normalizedStderr = normalizedStderr.split(\"\\n\");\n  normalizedStderr = normalizedStderr.filter(\n    (item) => !/.+wait until bundle finished.*(\\n)?/g.test(item),\n  );\n  normalizedStderr = normalizedStderr.join(\"\\n\");\n  normalizedStderr = normalizedStderr.replaceAll(/:[0-9]+\\//g, \":<port>/\");\n\n  if (options.https) {\n    // We have deprecation warning on windows in some cases\n    normalizedStderr = normalizedStderr.split(\"\\n\");\n    normalizedStderr = normalizedStderr.filter(\n      (item) => !/Generating SSL Certificate/g.test(item),\n    );\n    normalizedStderr = normalizedStderr.filter(\n      (item) =>\n        !/DeprecationWarning: The legacy HTTP parser is deprecated/g.test(item),\n    );\n    normalizedStderr = normalizedStderr.join(\"\\n\");\n  }\n\n  if (normalizedStderr.includes(\"Loopback:\")) {\n    normalizedStderr = normalizedStderr.split(\"\\n\");\n\n    const loopbackIndex = normalizedStderr.findIndex((item) =>\n      /Loopback:/.test(item),\n    );\n\n    const protocol = options.https ? \"https\" : \"http\";\n\n    normalizedStderr[loopbackIndex] =\n      `<i> Loopback: ${protocol}://localhost:<port>/, ${protocol}://<ip-v4>:<port>/, ${protocol}://[<ip-v6>]:<port>/`;\n    normalizedStderr = normalizedStderr.join(\"\\n\");\n  }\n\n  if (options.ipv6 && !normalizedStderr.includes(\"On Your Network (IPv6):\")) {\n    // Github Actions doesn't support IPv6 on ubuntu in some cases\n    normalizedStderr = normalizedStderr.split(\"\\n\");\n\n    const ipv4MessageIndex = normalizedStderr.findIndex((item) =>\n      /On Your Network \\(IPv4\\)/.test(item),\n    );\n\n    const protocol = options.https ? \"https\" : \"http\";\n\n    normalizedStderr.splice(\n      ipv4MessageIndex + 1,\n      0,\n      `<i> [webpack-dev-server] On Your Network (IPv6): ${protocol}://[<ip-v6>]:<port>/`,\n    );\n\n    normalizedStderr = normalizedStderr.join(\"\\n\");\n  }\n\n  if (/Gracefully shutting down/.test(normalizedStderr)) {\n    normalizedStderr = normalizedStderr.split(\"\\n\").slice(0, -1).join(\"\\n\");\n  }\n\n  return normalizedStderr;\n};\n\nmodule.exports = { normalizeStderr, testBin };\n"
  },
  {
    "path": "test/helpers/test-server.js",
    "content": "\"use strict\";\n\nconst webpack = require(\"webpack\");\nconst Server = require(\"../../lib/Server\");\n\n/** @typedef {import(\"webpack\").Configuration} Configuration */\n/** @typedef {import(\"../../lib/Server\").Configuration} DevServerConfiguration */\n/** @typedef {import(\"webpack\").Compiler} Compiler */\n/** @typedef {import(\"webpack\").MultiCompiler} MultiCompiler */\n\nlet server;\n\n// start server, returning the full setup of the server\n// (both the server and the compiler)\n\n/**\n * @param {Configuration} config configuration\n * @param {DevServerConfiguration} devServerConfig dev server configuration\n * @param {(err?: Error) => void=} done done callback\n * @returns {{ server: Server, compiler: Compiler | MultiCompiler }} server and compiler\n */\nfunction startFullSetup(config, devServerConfig, done) {\n  // disable watching by default for tests\n  if (typeof devServerConfig.static === \"undefined\") {\n    devServerConfig.static = false;\n  } else if (devServerConfig.static === null) {\n    // this provides a way of using the default static value\n    delete devServerConfig.static;\n  }\n\n  const compiler = webpack(config);\n\n  server = new Server(devServerConfig, compiler);\n\n  server.startCallback((error) => {\n    if (error && done) {\n      return done(error);\n    }\n\n    if (done) {\n      done();\n    }\n  });\n\n  return {\n    server,\n    compiler,\n  };\n}\n\n/**\n * @param {Configuration} config configuration\n * @param {DevServerConfiguration} devServerConfig dev server configuration\n * @param {(err?: Error) => void=} done done callback\n * @returns {Server} server\n */\nfunction start(config, devServerConfig, done) {\n  let readyCount = 0;\n\n  const ready = (error) => {\n    if (error && done) {\n      done(error);\n\n      return;\n    }\n\n    readyCount += 1;\n\n    if (readyCount === 2) {\n      done();\n    }\n  };\n\n  const result = startFullSetup(config, devServerConfig, ready);\n\n  // wait for compilation, since dev server can start before this\n  // https://github.com/webpack/webpack-dev-server/issues/847\n  result.compiler.hooks.done.tap(\"done\", () => {\n    ready();\n  });\n\n  return result.server;\n}\n\n/**\n * @param {() => void} done done callback\n */\nfunction close(done) {\n  if (server) {\n    server.stopCallback(() => {\n      server = null;\n      done();\n    });\n  } else {\n    done();\n  }\n}\n\nmodule.exports = {\n  close,\n  start,\n};\n"
  },
  {
    "path": "test/helpers/trusted-types-html-generator-plugin.js",
    "content": "\"use strict\";\n\nconst HTMLContentForIndex = `\n<!DOCTYPE html>\n<html>\n  <head>\n    <meta\n      http-equiv=\"Content-Security-Policy\"\n      content=\"require-trusted-types-for 'script'; trusted-types webpack webpack#dev-overlay;\"\n    />\n    <meta charset='UTF-8'>\n    <title>webpack-dev-server</title>\n  </head>\n  <body>\n    <h1>webpack-dev-server is running...</h1>\n    <script type=\"text/javascript\" charset=\"utf-8\" src=\"/main.js\"></script>\n  </body>\n</html>\n`;\n\nconst HTMLContentForTest = `\n<!DOCTYPE html>\n<html>\n  <head>\n    <meta\n      http-equiv=\"Content-Security-Policy\"\n      content=\"require-trusted-types-for 'script'; trusted-types webpack webpack#dev-overlay;\"\n    />\n    <meta charset='UTF-8'>\n    <title>test</title>\n  </head>\n  <body>\n    <h1>Created via HTMLGeneratorPlugin</h1>\n  </body>\n</html>\n`;\n\nmodule.exports = class HTMLGeneratorPlugin {\n  apply(compiler) {\n    const pluginName = \"html-generator-plugin\";\n\n    compiler.hooks.thisCompilation.tap(pluginName, (compilation) => {\n      if (compiler.webpack) {\n        const { RawSource } = compiler.webpack.sources;\n\n        compilation.hooks.processAssets.tap(\n          {\n            name: pluginName,\n            stage: compiler.webpack.Compilation.PROCESS_ASSETS_STAGE_ADDITIONAL,\n          },\n          () => {\n            const indexSource = new RawSource(HTMLContentForIndex);\n            const testSource = new RawSource(HTMLContentForTest);\n\n            compilation.emitAsset(\"index.html\", indexSource);\n            compilation.emitAsset(\"test.html\", testSource);\n          },\n        );\n      } else {\n        compilation.hooks.additionalAssets.tap(pluginName, () => {\n          compilation.emitAsset(\"index.html\", {\n            source() {\n              return HTMLContentForIndex;\n            },\n            size() {\n              return HTMLContentForIndex.length;\n            },\n          });\n          compilation.emitAsset(\"test.html\", {\n            source() {\n              return HTMLContentForTest;\n            },\n            size() {\n              return HTMLContentForTest.length;\n            },\n          });\n        });\n      }\n    });\n  }\n};\n"
  },
  {
    "path": "test/normalize-options.test.js",
    "content": "\"use strict\";\n\nconst { klona } = require(\"klona/full\");\nconst webpack = require(\"webpack\");\nconst Server = require(\"../lib/Server\");\nconst port = require(\"./ports-map\")[\"normalize-option\"];\n\ndescribe(\"normalize options\", () => {\n  const cases = [\n    {\n      title: \"no options\",\n      multiCompiler: false,\n      options: {},\n    },\n    {\n      title: \"port string\",\n      multiCompiler: false,\n      options: {\n        port: \"9000\",\n      },\n    },\n    {\n      title: \"client.webSocketTransport sockjs string\",\n      multiCompiler: false,\n      options: {\n        client: {\n          webSocketTransport: \"sockjs\",\n        },\n      },\n    },\n    {\n      title: \"client.webSocketTransport ws string\",\n      multiCompiler: false,\n      options: {\n        client: {\n          webSocketTransport: \"ws\",\n        },\n      },\n    },\n    {\n      title:\n        \"client.webSocketTransport ws string and webSocketServer ws string\",\n      multiCompiler: false,\n      options: {\n        client: {\n          webSocketTransport: \"ws\",\n        },\n        webSocketServer: \"ws\",\n      },\n    },\n    {\n      title: \"webSocketServer custom server path\",\n      multiCompiler: false,\n      options: {\n        webSocketServer: \"/path/to/custom/server/\",\n      },\n    },\n    {\n      title: \"webSocketServer custom server class\",\n      multiCompiler: false,\n      options: {\n        webSocketServer: class CustomServerImplementation {\n          constructor() {\n            this.implementation = {\n              close: (callback) => {\n                callback();\n              },\n            };\n          }\n        },\n      },\n    },\n    {\n      title: \"client.webSocketTransport ws string and webSocketServer object\",\n      multiCompiler: false,\n      options: {\n        client: {\n          webSocketTransport: \"ws\",\n        },\n        webSocketServer: {\n          type: \"ws\",\n          options: {\n            host: \"127.0.0.1\",\n            // TODO `jest` is freeze here\n            // port: 43334,\n            pathname: \"/ws\",\n          },\n        },\n      },\n    },\n    {\n      title:\n        \"client.webSocketTransport ws string and webSocketServer object with port as string\",\n      multiCompiler: false,\n      options: {\n        client: {\n          webSocketTransport: \"ws\",\n        },\n        webSocketServer: {\n          type: \"ws\",\n          options: {\n            host: \"127.0.0.1\",\n            // TODO `jest` is freeze here\n            // port: \"43335\",\n            pathname: \"/ws\",\n          },\n        },\n      },\n    },\n    {\n      title: \"client custom webSocketTransport path\",\n      multiCompiler: false,\n      options: {\n        client: {\n          webSocketTransport: \"/path/to/custom/client/\",\n        },\n      },\n    },\n    {\n      title: \"client host and port\",\n      multiCompiler: false,\n      options: {\n        client: {\n          webSocketURL: {\n            hostname: \"my.host\",\n            port: 9000,\n          },\n        },\n      },\n    },\n    {\n      title: \"client host and string port\",\n      multiCompiler: false,\n      options: {\n        client: {\n          webSocketURL: {\n            hostname: \"my.host\",\n            port: \"9000\",\n          },\n        },\n      },\n    },\n    {\n      title: \"client path\",\n      multiCompiler: false,\n      options: {\n        client: {\n          webSocketURL: {\n            pathname: \"/custom/path/\",\n          },\n        },\n      },\n    },\n    {\n      title: \"username and password\",\n      multiCompiler: false,\n      options: {\n        client: {\n          webSocketURL: {\n            username: \"zenitsu\",\n            password: \"chuntaro\",\n          },\n        },\n      },\n    },\n    {\n      title: \"client path without leading/ending slashes\",\n      multiCompiler: false,\n      options: {\n        client: {\n          webSocketURL: {\n            pathname: \"custom/path\",\n          },\n        },\n      },\n    },\n    {\n      title:\n        \"single compiler client.logging should default to infrastructureLogging.level\",\n      multiCompiler: false,\n      options: {},\n      webpackConfig: {\n        infrastructureLogging: {\n          level: \"verbose\",\n          stream: {\n            write: () => {},\n          },\n        },\n      },\n    },\n    {\n      title:\n        \"single compiler client.logging should override to infrastructureLogging.level\",\n      multiCompiler: false,\n      options: {\n        client: {\n          logging: \"none\",\n        },\n      },\n      webpackConfig: {\n        infrastructureLogging: {\n          level: \"verbose\",\n          stream: {\n            write: () => {},\n          },\n        },\n      },\n    },\n    {\n      title:\n        \"multi compiler client.logging should respect infrastructureLogging.level\",\n      multiCompiler: true,\n      options: {},\n      webpackConfig: [\n        {\n          target: \"node\",\n        },\n        // infrastructureLogging is set on the second compiler\n        {\n          target: \"web\",\n          infrastructureLogging: {\n            level: \"warn\",\n          },\n        },\n      ],\n    },\n    {\n      title:\n        \"multi compiler client.logging should respect infrastructureLogging.level\",\n      multiCompiler: true,\n      options: {},\n      webpackConfig: [\n        {},\n        // infrastructureLogging is set on the second compiler\n        {\n          devServer: {},\n          infrastructureLogging: {\n            level: \"warn\",\n          },\n        },\n      ],\n    },\n    {\n      title:\n        \"multi compiler client.logging should respect infrastructureLogging.level\",\n      multiCompiler: true,\n      options: {},\n      webpackConfig: [\n        // Fallback\n        {\n          infrastructureLogging: {\n            level: \"warn\",\n          },\n        },\n        {},\n      ],\n    },\n    {\n      title:\n        \"multi compiler client.logging should override infrastructureLogging.level\",\n      multiCompiler: true,\n      options: {\n        client: {\n          logging: \"none\",\n        },\n      },\n      webpackConfig: [\n        {\n          infrastructureLogging: {\n            level: \"warn\",\n          },\n        },\n        {},\n      ],\n    },\n    {\n      title: \"liveReload is true\",\n      multiCompiler: false,\n      options: {\n        liveReload: true,\n      },\n    },\n    {\n      title: \"liveReload is false\",\n      multiCompiler: false,\n      options: {\n        liveReload: false,\n      },\n    },\n    {\n      title: \"hot is true\",\n      multiCompiler: false,\n      options: {\n        hot: true,\n      },\n    },\n    {\n      title: \"hot is false\",\n      multiCompiler: false,\n      options: {\n        hot: false,\n      },\n    },\n    {\n      title: \"hot is only\",\n      multiCompiler: false,\n      options: {\n        hot: \"only\",\n      },\n    },\n    {\n      title: \"dev is set\",\n      multiCompiler: false,\n      options: {\n        devMiddleware: {\n          serverSideRender: true,\n        },\n      },\n    },\n    {\n      title: \"static is true\",\n      multiCompiler: false,\n      options: {\n        static: true,\n      },\n    },\n    {\n      title: \"static is false\",\n      multiCompiler: false,\n      options: {\n        static: false,\n      },\n    },\n    {\n      title: \"static is string\",\n      multiCompiler: false,\n      options: {\n        static: \"/static/path\",\n      },\n    },\n    {\n      title: \"static is an array of strings\",\n      multiCompiler: false,\n      options: {\n        static: [\"/static/path1\", \"/static/path2\"],\n      },\n    },\n    {\n      title: \"static is an array of static objects\",\n      multiCompiler: false,\n      options: {\n        static: [\n          {\n            directory: \"/static/path1\",\n          },\n          {\n            publicPath: \"/static/public/path\",\n          },\n        ],\n      },\n    },\n    {\n      title: \"static is an array of strings and static objects\",\n      multiCompiler: false,\n      options: {\n        static: [\n          \"/static/path1\",\n          {\n            publicPath: \"/static/public/path/\",\n          },\n        ],\n      },\n    },\n    {\n      title: \"static is an object\",\n      multiCompiler: false,\n      options: {\n        static: {\n          directory: \"/static/path\",\n        },\n      },\n    },\n    {\n      title: \"static is an object with staticOptions\",\n      multiCompiler: false,\n      options: {\n        static: {\n          directory: \"/static/path\",\n          staticOptions: {\n            redirect: true,\n            immutable: true,\n          },\n        },\n      },\n    },\n    {\n      title: \"static directory is an absolute url and throws error\",\n      multiCompiler: false,\n      options: {\n        static: {\n          directory: \"http://localhost:8080\",\n        },\n      },\n      throws: \"Using a URL as static.directory is not supported\",\n    },\n    {\n      title: \"static publicPath is a string\",\n      multiCompiler: false,\n      options: {\n        static: {\n          publicPath: \"/static/public/path/\",\n        },\n      },\n    },\n    {\n      title: \"static publicPath is an array\",\n      multiCompiler: false,\n      options: {\n        static: {\n          publicPath: [\"/static/public/path1/\", \"/static/public/path2/\"],\n        },\n      },\n    },\n    {\n      title: \"static watch is false\",\n      multiCompiler: false,\n      options: {\n        static: {\n          watch: false,\n        },\n      },\n    },\n    {\n      title: \"static watch is true\",\n      multiCompiler: false,\n      options: {\n        static: {\n          watch: true,\n        },\n      },\n    },\n    {\n      title: \"static watch is an object\",\n      multiCompiler: false,\n      options: {\n        static: {\n          watch: {\n            poll: 500,\n          },\n        },\n      },\n    },\n    {\n      title: \"static serveIndex is false\",\n      multiCompiler: false,\n      options: {\n        static: {\n          serveIndex: false,\n        },\n      },\n    },\n    {\n      title: \"static serveIndex is true\",\n      multiCompiler: false,\n      options: {\n        static: {\n          serveIndex: true,\n        },\n      },\n    },\n    {\n      title: \"static serveIndex is an object with icons false\",\n      multiCompiler: false,\n      options: {\n        static: {\n          serveIndex: {\n            icons: false,\n          },\n        },\n      },\n    },\n    {\n      title: \"static serveIndex is an object more options\",\n      multiCompiler: false,\n      options: {\n        static: {\n          serveIndex: {\n            hidden: true,\n            stylesheet: \"https://example.com/style.css\",\n            view: \"details\",\n          },\n        },\n      },\n    },\n\n    {\n      title: \"single compiler watchOptions is object\",\n      multiCompiler: false,\n      options: {},\n      webpackConfig: {\n        watch: true,\n        watchOptions: {\n          aggregateTimeout: 300,\n        },\n      },\n    },\n    {\n      title: \"single compiler watchOptions is object with watch false\",\n      multiCompiler: false,\n      options: {},\n      webpackConfig: {\n        watch: false,\n        watchOptions: {\n          aggregateTimeout: 300,\n        },\n      },\n    },\n    {\n      title: \"single compiler watchOptions is object with static watch true\",\n      multiCompiler: false,\n      options: {\n        static: {\n          watch: true,\n        },\n      },\n      webpackConfig: {\n        watch: true,\n        watchOptions: {\n          aggregateTimeout: 300,\n        },\n      },\n    },\n    {\n      title:\n        \"single compiler watchOptions is object with static watch overriding it\",\n      multiCompiler: false,\n      options: {\n        static: {\n          watch: {\n            poll: 500,\n          },\n        },\n      },\n      webpackConfig: {\n        watch: true,\n        watchOptions: {\n          aggregateTimeout: 300,\n        },\n      },\n    },\n    {\n      title: \"multi compiler watchOptions is set\",\n      multiCompiler: true,\n      options: {},\n      webpackConfig: [\n        {},\n        // watchOptions are set on the second compiler\n        {\n          watch: true,\n          watchOptions: {\n            aggregateTimeout: 300,\n          },\n        },\n      ],\n    },\n    {\n      title: \"allowedHosts is string\",\n      multiCompiler: false,\n      options: {\n        allowedHosts: \"all\",\n      },\n    },\n    {\n      title: \"allowedHosts is array\",\n      multiCompiler: false,\n      options: {\n        allowedHosts: [\"all\"],\n      },\n    },\n  ];\n\n  for (const item of cases) {\n    it(item.title, async () => {\n      let webpackConfig;\n\n      if (item.multiCompiler) {\n        webpackConfig = require(\"./fixtures/multi-compiler-one-configuration/webpack.config\");\n\n        if (Array.isArray(item.webpackConfig)) {\n          webpackConfig = item.webpackConfig.map((config, index) => ({\n            ...webpackConfig[index],\n            ...config,\n          }));\n        }\n      } else {\n        webpackConfig = require(\"./fixtures/simple-config/webpack.config\");\n\n        if (item.webpackConfig) {\n          webpackConfig = {\n            ...webpackConfig,\n            ...item.webpackConfig,\n          };\n        }\n      }\n\n      const compiler = webpack(webpackConfig);\n      const server = new Server({ ...item.options, port }, compiler);\n\n      let errored;\n\n      try {\n        await server.start();\n      } catch (error) {\n        errored = error;\n      }\n\n      try {\n        if (item.throws) {\n          expect(errored.message).toMatch(item.throws);\n        } else {\n          const optionsForSnapshot = klona(server.options);\n\n          optionsForSnapshot.port = \"<auto>\";\n\n          if (optionsForSnapshot.static.length > 0) {\n            for (const i of optionsForSnapshot.static) {\n              i.directory = i.directory\n                .replaceAll(\"\\\\\", \"/\")\n                .replaceAll(\n                  new RegExp(process.cwd().replaceAll(\"\\\\\", \"/\"), \"g\"),\n                  \"<cwd>\",\n                );\n            }\n          }\n\n          expect(optionsForSnapshot).toMatchSnapshot();\n        }\n      } finally {\n        await server.stop();\n      }\n    });\n  }\n});\n"
  },
  {
    "path": "test/ports-map.js",
    "content": "\"use strict\";\n\n// important: new port mappings must be added to the bottom of this list\nconst listOfTests = {\n  // CLI tests\n  \"cli-basic\": 1,\n  \"cli-port-option\": 1,\n  // e2e tests\n  bundle: 1,\n  \"sockjs-client\": 1,\n  \"web-socket-client\": 1,\n  \"hot-and-live-reload\": 1,\n  logging: 1,\n  overlay: 1,\n  progress: 1,\n  \"server-and-client-transport\": 1,\n  \"web-socket-server-url\": 2,\n  // integration tests\n  \"module-federation\": 1,\n  \"multi-compiler\": 1,\n  // unit tests\n  bonjour: 1,\n  \"client-option\": 1,\n  \"compress-option\": 1,\n  \"headers-option\": 1,\n  \"history-api-fallback-option\": 1,\n  \"host-option\": 1,\n  \"hot-option\": 1,\n  \"http2-option\": 1,\n  \"https-option\": 1,\n  \"mime-types-option\": 1,\n  \"magic-html-option\": 1,\n  \"on-after-setup-middleware-option\": 1,\n  \"on-before-setup-middleware-option\": 1,\n  \"on-listening-option\": 1,\n  \"open-option\": 1,\n  \"port-option\": 1,\n  \"proxy-option\": 4,\n  server: 1,\n  \"setup-exit-signals-option\": 1,\n  \"static-directory-option\": 1,\n  \"static-public-path-option\": 1,\n  \"stats-option\": 1,\n  \"watch-files-option\": 1,\n  \"web-socket-server-option\": 1,\n  \"sockjs-server\": 1,\n  \"web-socket-server\": 1,\n  routes: 1,\n  \"web-socket-communication\": 1,\n  ipc: 1,\n  stats: 1,\n  \"cli-allowed-hosts\": 1,\n  \"cli-bonjour\": 1,\n  \"cli-client\": 1,\n  \"cli-colors\": 1,\n  \"cli-compress\": 1,\n  \"cli-history-api-fallback\": 1,\n  \"cli-host\": 1,\n  \"cli-hot\": 1,\n  \"cli-http2\": 1,\n  \"cli-https\": 1,\n  \"cli-live-reload\": 1,\n  \"cli-magic-html\": 1,\n  \"cli-open\": 1,\n  \"cli-static\": 1,\n  \"cli-watch-files\": 1,\n  \"cli-web-socket-server\": 1,\n  target: 1,\n  entry: 1,\n  \"allowed-hosts\": 2,\n  host: 1,\n  api: 1,\n  \"lazy-compilation\": 1,\n  \"range-header\": 1,\n  port: 1,\n  \"web-socket-server-test\": 1,\n  \"client-reconnect-option\": 1,\n  \"cli-server\": 1,\n  \"server-option\": 1,\n  \"normalize-option\": 1,\n  \"setup-middlewares-option\": 1,\n  \"options-request-response\": 2,\n  app: 1,\n  \"cross-origin-request\": 2,\n};\n\nlet startPort = 8089;\n\nconst ports = {};\n\nfor (const key of Object.keys(listOfTests)) {\n  const value = listOfTests[key];\n\n  ports[key] =\n    value === 1\n      ? (startPort += 1)\n      : // eslint-disable-next-line no-loop-func\n        Array.from({ length: value }).map(() => (startPort += 1));\n}\n\nconst busy = {};\n\nmodule.exports = new Proxy(ports, {\n  get(target, name) {\n    if (!target[name]) {\n      throw new Error(\n        `Requested \"${name}\" port(s) for tests not found, please update \"test/ports-map.js\".`,\n      );\n    }\n\n    if (busy[name]) {\n      throw new Error(\n        `The \"${name}\" port is already in use in another test, please add a new one.`,\n      );\n    }\n\n    busy[name] = true;\n\n    return target[name];\n  },\n});\n"
  },
  {
    "path": "test/server/open-option.test.js",
    "content": "\"use strict\";\n\nconst webpack = require(\"webpack\");\nconst Server = require(\"../../lib/Server\");\nconst config = require(\"../fixtures/simple-config/webpack.config\");\nconst port = require(\"../ports-map\")[\"open-option\"];\n\nconst internalIPv4 = Server.internalIPSync(\"v4\");\n\nlet open;\n\nconst needRequireMock =\n  process.version.startsWith(\"v18\") || process.version.startsWith(\"v19\");\n\nif (needRequireMock) {\n  open = require(\"open\");\n\n  jest.mock(\"open\");\n\n  open.mockImplementation(() => ({\n    catch: jest.fn(),\n  }));\n}\n\ndescribe('\"open\" option', () => {\n  let compiler;\n\n  beforeEach(async () => {\n    compiler = webpack(config);\n\n    if (!needRequireMock) {\n      jest.unstable_mockModule(\"open\", () => ({\n        default: jest.fn(() => Promise.resolve()),\n      }));\n\n      open = (await import(\"open\")).default;\n    }\n  });\n\n  afterEach(async () => {\n    open.mockClear();\n  });\n\n  // eslint-disable-next-line jest/no-focused-tests\n  it.only(\"should work with unspecified host\", async () => {\n    const server = new Server(\n      {\n        open: true,\n        port,\n      },\n      compiler,\n    );\n\n    await server.start();\n    await server.stop();\n\n    expect(open).toHaveBeenCalledWith(`http://localhost:${port}/`, {\n      wait: false,\n    });\n  });\n\n  it(\"should work with the server: 'https' option\", async () => {\n    const server = new Server(\n      {\n        open: true,\n        port,\n        server: \"https\",\n      },\n      compiler,\n    );\n\n    await server.start();\n    await server.stop();\n\n    expect(open).toHaveBeenCalledWith(`https://localhost:${port}/`, {\n      wait: false,\n    });\n  });\n\n  it(\"should work with the server: 'spdy' option\", async () => {\n    const server = new Server(\n      {\n        open: true,\n        port,\n        server: \"spdy\",\n      },\n      compiler,\n    );\n\n    await server.start();\n    await server.stop();\n\n    expect(open).toHaveBeenCalledWith(`https://localhost:${port}/`, {\n      wait: false,\n    });\n  });\n\n  it(\"should work with '0.0.0.0' host but open localhost\", async () => {\n    const host = \"0.0.0.0\";\n\n    const server = new Server(\n      {\n        host,\n        port,\n        open: true,\n      },\n      compiler,\n    );\n\n    await server.start();\n    await server.stop();\n\n    expect(open).toHaveBeenCalledWith(`http://localhost:${port}/`, {\n      wait: false,\n    });\n  });\n\n  it(\"should work with '::' host\", async () => {\n    const host = \"::\";\n\n    const server = new Server(\n      {\n        host,\n        port,\n        open: true,\n      },\n      compiler,\n    );\n\n    await server.start();\n    await server.stop();\n\n    expect(open).toHaveBeenCalledWith(`http://localhost:${port}/`, {\n      wait: false,\n    });\n  });\n\n  it(\"should work with 'localhost' host\", async () => {\n    const host = \"localhost\";\n\n    const server = new Server(\n      {\n        host,\n        port,\n        open: true,\n      },\n      compiler,\n    );\n\n    await server.start();\n    await server.stop();\n\n    expect(open).toHaveBeenCalledWith(`http://${host}:${port}/`, {\n      wait: false,\n    });\n  });\n\n  it(\"should work with '127.0.0.1' host\", async () => {\n    const host = \"127.0.0.1\";\n\n    const server = new Server(\n      {\n        host,\n        port,\n        open: true,\n      },\n      compiler,\n    );\n\n    await server.start();\n    await server.stop();\n\n    expect(open).toHaveBeenCalledWith(`http://${host}:${port}/`, {\n      wait: false,\n    });\n  });\n\n  it(\"should work with '::1' host\", async () => {\n    const host = \"::1\";\n\n    const server = new Server(\n      {\n        host,\n        port,\n        open: true,\n      },\n      compiler,\n    );\n\n    await server.start();\n    await server.stop();\n\n    expect(open).toHaveBeenCalledWith(`http://[${host}]:${port}/`, {\n      wait: false,\n    });\n  });\n\n  it(`should work with '${internalIPv4}' host`, async () => {\n    const server = new Server(\n      {\n        host: internalIPv4,\n        port,\n        open: true,\n      },\n      compiler,\n    );\n\n    await server.start();\n    await server.stop();\n\n    expect(open).toHaveBeenCalledWith(`http://${internalIPv4}:${port}/`, {\n      wait: false,\n    });\n  });\n\n  it(\"should work with boolean\", async () => {\n    const host = \"localhost\";\n\n    const server = new Server(\n      {\n        host,\n        port,\n        open: true,\n      },\n      compiler,\n    );\n\n    await server.start();\n    await server.stop();\n\n    expect(open).toHaveBeenCalledWith(`http://${host}:${port}/`, {\n      wait: false,\n    });\n  });\n\n  it(\"should work with boolean but don't close with 'false' value\", async () => {\n    const host = \"localhost\";\n\n    const server = new Server(\n      {\n        host,\n        port,\n        open: false,\n      },\n      compiler,\n    );\n\n    await server.start();\n    await server.stop();\n\n    expect(open).not.toHaveBeenCalled();\n  });\n\n  it(\"should work with relative string\", async () => {\n    const host = \"localhost\";\n\n    const server = new Server(\n      {\n        host,\n        port,\n        open: \"index.html\",\n      },\n      compiler,\n    );\n\n    await server.start();\n    await server.stop();\n\n    expect(open).toHaveBeenCalledWith(`http://${host}:${port}/index.html`, {\n      wait: false,\n    });\n  });\n\n  it('should work with \"<url>\" pattern', async () => {\n    const host = \"localhost\";\n\n    const server = new Server(\n      {\n        host,\n        port,\n        open: \"<url>\",\n      },\n      compiler,\n    );\n\n    await server.start();\n    await server.stop();\n\n    expect(open).toHaveBeenCalledWith(`http://${host}:${port}/`, {\n      wait: false,\n    });\n  });\n\n  it('should work with relative string starting with \"/\"', async () => {\n    const host = \"localhost\";\n\n    const server = new Server(\n      {\n        host,\n        port,\n        open: \"/index.html\",\n      },\n      compiler,\n    );\n\n    await server.start();\n    await server.stop();\n\n    expect(open).toHaveBeenCalledWith(`http://${host}:${port}/index.html`, {\n      wait: false,\n    });\n  });\n\n  it(\"should work with absolute string\", async () => {\n    const host = \"localhost\";\n\n    const server = new Server(\n      {\n        open: `http://${host}:${port}/index.html`,\n        port,\n        host: \"localhost\",\n      },\n      compiler,\n    );\n\n    await server.start();\n    await server.stop();\n\n    expect(open).toHaveBeenCalledWith(`http://${host}:${port}/index.html`, {\n      wait: false,\n    });\n  });\n\n  it(\"should work with multiple relative strings\", async () => {\n    const host = \"localhost\";\n\n    const server = new Server(\n      {\n        host: \"localhost\",\n        port,\n        open: [\"first.html\", \"second.html\"],\n      },\n      compiler,\n    );\n\n    await server.start();\n    await server.stop();\n\n    expect(open).toHaveBeenNthCalledWith(\n      1,\n      `http://${host}:${port}/first.html`,\n      {\n        wait: false,\n      },\n    );\n    expect(open).toHaveBeenNthCalledWith(\n      2,\n      `http://${host}:${port}/second.html`,\n      {\n        wait: false,\n      },\n    );\n  });\n\n  it(\"should work with multiple absolute strings\", async () => {\n    const host = \"localhost\";\n\n    const server = new Server(\n      {\n        host: \"localhost\",\n        port,\n        open: [\n          `http://${host}:${port}/first.html`,\n          `http://${host}:${port}/second.html`,\n        ],\n      },\n      compiler,\n    );\n\n    await server.start();\n    await server.stop();\n\n    expect(open).toHaveBeenNthCalledWith(\n      1,\n      `http://${host}:${port}/first.html`,\n      {\n        wait: false,\n      },\n    );\n    expect(open).toHaveBeenNthCalledWith(\n      2,\n      `http://${host}:${port}/second.html`,\n      {\n        wait: false,\n      },\n    );\n  });\n\n  it('should work with \"<url>\" pattern in multiple strings', async () => {\n    const host = \"localhost\";\n\n    const server = new Server(\n      {\n        host: \"localhost\",\n        port,\n        open: [\"<url>\", \"second.html\"],\n      },\n      compiler,\n    );\n\n    await server.start();\n    await server.stop();\n\n    expect(open).toHaveBeenNthCalledWith(1, `http://${host}:${port}/`, {\n      wait: false,\n    });\n    expect(open).toHaveBeenNthCalledWith(\n      2,\n      `http://${host}:${port}/second.html`,\n      {\n        wait: false,\n      },\n    );\n  });\n\n  it(\"should work with empty object\", async () => {\n    const host = \"localhost\";\n\n    const server = new Server(\n      {\n        host,\n        port,\n        open: {},\n      },\n      compiler,\n    );\n\n    await server.start();\n    await server.stop();\n\n    expect(open).toHaveBeenCalledWith(`http://${host}:${port}/`, {\n      wait: false,\n    });\n  });\n\n  it(\"should work with object and with the 'target' option\", async () => {\n    const host = \"localhost\";\n\n    const server = new Server(\n      {\n        host,\n        port,\n        open: {\n          target: \"index.html\",\n        },\n      },\n      compiler,\n    );\n\n    await server.start();\n    await server.stop();\n\n    expect(open).toHaveBeenCalledWith(`http://${host}:${port}/index.html`, {\n      wait: false,\n    });\n  });\n\n  it(\"should work with object and with multiple values of the 'target' option\", async () => {\n    const host = \"localhost\";\n\n    const server = new Server(\n      {\n        host,\n        port,\n        open: {\n          target: [\"first.html\", \"second.html\"],\n        },\n      },\n      compiler,\n    );\n\n    await server.start();\n    await server.stop();\n\n    expect(open).toHaveBeenNthCalledWith(\n      1,\n      `http://${host}:${port}/first.html`,\n      {\n        wait: false,\n      },\n    );\n    expect(open).toHaveBeenNthCalledWith(\n      2,\n      `http://${host}:${port}/second.html`,\n      {\n        wait: false,\n      },\n    );\n  });\n\n  it(\"should work with object and with the 'app' option\", async () => {\n    const host = \"localhost\";\n\n    const server = new Server(\n      {\n        host,\n        port,\n        open: {\n          app: \"google-chrome\",\n        },\n      },\n      compiler,\n    );\n\n    await server.start();\n    await server.stop();\n\n    expect(open).toHaveBeenCalledWith(`http://${host}:${port}/`, {\n      app: { name: \"google-chrome\" },\n      wait: false,\n    });\n  });\n\n  it(\"should work with object and with the 'app' and 'arguments' options\", async () => {\n    const host = \"localhost\";\n\n    const server = new Server(\n      {\n        host,\n        port,\n        open: {\n          app: { name: \"google-chrome\", arguments: [\"--incognito\"] },\n        },\n      },\n      compiler,\n    );\n\n    await server.start();\n    await server.stop();\n\n    expect(open).toHaveBeenCalledWith(`http://${host}:${port}/`, {\n      app: { name: \"google-chrome\", arguments: [\"--incognito\"] },\n      wait: false,\n    });\n  });\n\n  it('should work with object with \"target\" and \"app\" options', async () => {\n    const host = \"localhost\";\n\n    const server = new Server(\n      {\n        host,\n        port,\n        open: {\n          target: \"index.html\",\n          app: \"google-chrome\",\n        },\n      },\n      compiler,\n    );\n\n    await server.start();\n    await server.stop();\n\n    expect(open).toHaveBeenCalledWith(`http://${host}:${port}/index.html`, {\n      app: { name: \"google-chrome\" },\n      wait: false,\n    });\n  });\n\n  it('should work with <url> pattern in \"target\" and \"app\" options', async () => {\n    const host = \"localhost\";\n\n    const server = new Server(\n      {\n        host,\n        port,\n        open: {\n          target: \"<url>\",\n          app: \"google-chrome\",\n        },\n      },\n      compiler,\n    );\n\n    await server.start();\n    await server.stop();\n\n    expect(open).toHaveBeenCalledWith(`http://${host}:${port}/`, {\n      app: { name: \"google-chrome\" },\n      wait: false,\n    });\n  });\n\n  it(\"should work with object, with multiple value of the 'target' option and with the 'app' and 'arguments' options\", async () => {\n    const host = \"localhost\";\n\n    const server = new Server(\n      {\n        host,\n        port,\n        open: {\n          target: [\"first.html\", \"second.html\"],\n          app: { name: \"google-chrome\", arguments: [\"--incognito\"] },\n        },\n      },\n      compiler,\n    );\n\n    await server.start();\n    await server.stop();\n\n    expect(open).toHaveBeenNthCalledWith(\n      1,\n      `http://${host}:${port}/first.html`,\n      {\n        wait: false,\n        app: { name: \"google-chrome\", arguments: [\"--incognito\"] },\n      },\n    );\n    expect(open).toHaveBeenNthCalledWith(\n      2,\n      `http://${host}:${port}/second.html`,\n      {\n        wait: false,\n        app: { name: \"google-chrome\", arguments: [\"--incognito\"] },\n      },\n    );\n  });\n\n  it(\"should work with object, with multiple value of the 'target' option (relative and absolute URLs) and with the 'app' option with arguments\", async () => {\n    const host = \"localhost\";\n\n    const server = new Server(\n      {\n        host,\n        port,\n        open: {\n          target: [\"first.html\", `http://${host}:${port}/second.html`],\n          app: { name: \"google-chrome\", arguments: [\"--incognito\"] },\n        },\n      },\n      compiler,\n    );\n\n    await server.start();\n    await server.stop();\n\n    expect(open).toHaveBeenNthCalledWith(\n      1,\n      `http://${host}:${port}/first.html`,\n      {\n        wait: false,\n        app: { name: \"google-chrome\", arguments: [\"--incognito\"] },\n      },\n    );\n    expect(open).toHaveBeenNthCalledWith(\n      2,\n      `http://${host}:${port}/second.html`,\n      {\n        wait: false,\n        app: { name: \"google-chrome\", arguments: [\"--incognito\"] },\n      },\n    );\n  });\n\n  it(\"should work with <url> pattern in multiple open options\", async () => {\n    const host = \"localhost\";\n\n    const server = new Server(\n      {\n        host,\n        port,\n        open: [\n          {\n            target: \"<url>\",\n            app: \"google-chrome\",\n          },\n          {\n            target: \"<url>\",\n            app: \"firefox\",\n          },\n        ],\n      },\n      compiler,\n    );\n\n    await server.start();\n    await server.stop();\n\n    expect(open).toHaveBeenCalledWith(`http://${host}:${port}/`, {\n      app: { name: \"google-chrome\" },\n      wait: false,\n    });\n\n    expect(open).toHaveBeenCalledWith(`http://${host}:${port}/`, {\n      app: { name: \"firefox\" },\n      wait: false,\n    });\n  });\n\n  it(\"should work with multiple open options without target\", async () => {\n    const host = \"localhost\";\n\n    const server = new Server(\n      {\n        host,\n        port,\n        open: [\n          {\n            app: \"google-chrome\",\n          },\n          {\n            app: \"firefox\",\n          },\n        ],\n      },\n      compiler,\n    );\n\n    await server.start();\n    await server.stop();\n\n    expect(open).toHaveBeenCalledWith(`http://${host}:${port}/`, {\n      app: { name: \"google-chrome\" },\n      wait: false,\n    });\n\n    expect(open).toHaveBeenCalledWith(`http://${host}:${port}/`, {\n      app: { name: \"firefox\" },\n      wait: false,\n    });\n  });\n\n  it(\"should log warning when can't open\", async () => {\n    open.mockRejectedValue(undefined);\n\n    const loggerWarnSpy = jest.fn();\n    const getInfrastructureLoggerSpy = jest\n      .spyOn(compiler, \"getInfrastructureLogger\")\n      .mockImplementation(() => ({\n        warn: loggerWarnSpy,\n        info: () => {},\n        log: () => {},\n      }));\n\n    const server = new Server(\n      {\n        port,\n        open: true,\n      },\n      compiler,\n    );\n\n    await server.start();\n    await server.stop();\n\n    expect(open).toHaveBeenCalledWith(`http://localhost:${port}/`, {\n      wait: false,\n    });\n    expect(loggerWarnSpy).toHaveBeenCalledWith(\n      `Unable to open \"http://localhost:${port}/\" page. If you are running in a headless environment, please do not use the \"open\" option or related flags like \"--open\", \"--open-target\", and \"--open-app-name\".`,\n    );\n\n    getInfrastructureLoggerSpy.mockRestore();\n    loggerWarnSpy.mockRestore();\n  });\n\n  it(\"should log warning when can't open with string\", async () => {\n    open.mockRejectedValue(undefined);\n\n    const loggerWarnSpy = jest.fn();\n    const getInfrastructureLoggerSpy = jest\n      .spyOn(compiler, \"getInfrastructureLogger\")\n      .mockImplementation(() => ({\n        warn: loggerWarnSpy,\n        info: () => {},\n        log: () => {},\n      }));\n\n    const server = new Server(\n      {\n        open: \"index.html\",\n        port,\n      },\n      compiler,\n    );\n\n    await server.start();\n    await server.stop();\n\n    expect(open).toHaveBeenCalledWith(`http://localhost:${port}/index.html`, {\n      wait: false,\n    });\n    expect(loggerWarnSpy).toHaveBeenCalledWith(\n      `Unable to open \"http://localhost:${port}/index.html\" page. If you are running in a headless environment, please do not use the \"open\" option or related flags like \"--open\", \"--open-target\", and \"--open-app-name\".`,\n    );\n\n    getInfrastructureLoggerSpy.mockRestore();\n    loggerWarnSpy.mockRestore();\n  });\n\n  it(\"should log warning when can't open with object\", async () => {\n    open.mockRejectedValue(undefined);\n\n    const loggerWarnSpy = jest.fn();\n    const getInfrastructureLoggerSpy = jest\n      .spyOn(compiler, \"getInfrastructureLogger\")\n      .mockImplementation(() => ({\n        warn: loggerWarnSpy,\n        info: () => {},\n        log: () => {},\n      }));\n\n    const server = new Server(\n      {\n        open: {\n          target: \"index.html\",\n          app: \"google-chrome\",\n        },\n        port,\n      },\n      compiler,\n    );\n\n    await server.start();\n    await server.stop();\n\n    expect(open).toHaveBeenCalledWith(`http://localhost:${port}/index.html`, {\n      app: { name: \"google-chrome\" },\n      wait: false,\n    });\n    expect(loggerWarnSpy).toHaveBeenCalledWith(\n      `Unable to open \"http://localhost:${port}/index.html\" page in \"google-chrome\" app. If you are running in a headless environment, please do not use the \"open\" option or related flags like \"--open\", \"--open-target\", and \"--open-app-name\".`,\n    );\n\n    loggerWarnSpy.mockRestore();\n    getInfrastructureLoggerSpy.mockRestore();\n  });\n\n  it(\"should log warning when can't open with object with the 'app' option with arguments\", async () => {\n    open.mockRejectedValue(undefined);\n\n    const loggerWarnSpy = jest.fn();\n    const getInfrastructureLoggerSpy = jest\n      .spyOn(compiler, \"getInfrastructureLogger\")\n      .mockImplementation(() => ({\n        warn: loggerWarnSpy,\n        info: () => {},\n        log: () => {},\n      }));\n\n    const server = new Server(\n      {\n        open: {\n          target: \"index.html\",\n          app: {\n            name: \"google-chrome\",\n            arguments: [\"--incognito\", \"--new-window\"],\n          },\n        },\n        port,\n      },\n      compiler,\n    );\n\n    await server.start();\n    await server.stop();\n\n    expect(open).toHaveBeenCalledWith(`http://localhost:${port}/index.html`, {\n      app: {\n        name: \"google-chrome\",\n        arguments: [\"--incognito\", \"--new-window\"],\n      },\n      wait: false,\n    });\n    expect(loggerWarnSpy).toHaveBeenCalledWith(\n      `Unable to open \"http://localhost:${port}/index.html\" page in \"google-chrome\" app with \"--incognito --new-window\" arguments. If you are running in a headless environment, please do not use the \"open\" option or related flags like \"--open\", \"--open-target\", and \"--open-app-name\".`,\n    );\n\n    getInfrastructureLoggerSpy.mockRestore();\n    loggerWarnSpy.mockRestore();\n  });\n\n  it(\"should log warning when can't open with object with the 'app' option with arguments #2\", async () => {\n    open.mockRejectedValue(undefined);\n\n    const loggerWarnSpy = jest.fn();\n    const getInfrastructureLoggerSpy = jest\n      .spyOn(compiler, \"getInfrastructureLogger\")\n      .mockImplementation(() => ({\n        warn: loggerWarnSpy,\n        info: () => {},\n        log: () => {},\n      }));\n\n    const server = new Server(\n      {\n        open: {\n          target: [\"first.html\", `http://localhost:${port}/second.html`],\n          app: {\n            name: \"google-chrome\",\n            arguments: [\"--incognito\", \"--new-window\"],\n          },\n        },\n        port,\n      },\n      compiler,\n    );\n\n    await server.start();\n    await server.stop();\n\n    expect(open).toHaveBeenNthCalledWith(\n      1,\n      `http://localhost:${port}/first.html`,\n      {\n        wait: false,\n        app: {\n          name: \"google-chrome\",\n          arguments: [\"--incognito\", \"--new-window\"],\n        },\n      },\n    );\n    expect(open).toHaveBeenNthCalledWith(\n      2,\n      `http://localhost:${port}/second.html`,\n      {\n        wait: false,\n        app: {\n          name: \"google-chrome\",\n          arguments: [\"--incognito\", \"--new-window\"],\n        },\n      },\n    );\n    expect(loggerWarnSpy).toHaveBeenNthCalledWith(\n      1,\n      `Unable to open \"http://localhost:${port}/first.html\" page in \"google-chrome\" app with \"--incognito --new-window\" arguments. If you are running in a headless environment, please do not use the \"open\" option or related flags like \"--open\", \"--open-target\", and \"--open-app-name\".`,\n    );\n    expect(loggerWarnSpy).toHaveBeenNthCalledWith(\n      2,\n      `Unable to open \"http://localhost:${port}/second.html\" page in \"google-chrome\" app with \"--incognito --new-window\" arguments. If you are running in a headless environment, please do not use the \"open\" option or related flags like \"--open\", \"--open-target\", and \"--open-app-name\".`,\n    );\n\n    getInfrastructureLoggerSpy.mockRestore();\n    loggerWarnSpy.mockRestore();\n  });\n});\n"
  },
  {
    "path": "test/server/proxy-option.test.js",
    "content": "\"use strict\";\n\nconst path = require(\"node:path\");\nconst util = require(\"node:util\");\nconst express = require(\"express\");\nconst request = require(\"supertest\");\nconst webpack = require(\"webpack\");\nconst WebSocket = require(\"ws\");\nconst Server = require(\"../../lib/Server\");\nconst config = require(\"../fixtures/proxy-config/webpack.config\");\nconst [port1, port2, port3, port4] = require(\"../ports-map\")[\"proxy-option\"];\n\nconst WebSocketServer = WebSocket.Server;\nconst staticDirectory = path.resolve(__dirname, \"../fixtures/proxy-config\");\n\nconst proxyOptionPathsAsProperties = [\n  {\n    context: \"/proxy1\",\n    target: `http://localhost:${port1}`,\n  },\n  {\n    context: \"/api/proxy2\",\n    target: `http://localhost:${port2}`,\n    pathRewrite: { \"^/api\": \"\" },\n  },\n  {\n    context: \"/foo\",\n    bypass(req) {\n      if (/\\.html$/.test(req.path || req.url)) {\n        return \"/index.html\";\n      }\n\n      return null;\n    },\n  },\n  {\n    context: \"proxyfalse\",\n    bypass(req) {\n      if (/\\/proxyfalse$/.test(req.path || req.url)) {\n        return false;\n      }\n    },\n  },\n  {\n    context: \"/proxy/async\",\n    bypass(req, res) {\n      if (/\\/proxy\\/async$/.test(req.path || req.url)) {\n        return new Promise((resolve) => {\n          setTimeout(() => {\n            res.end(\"proxy async response\");\n            resolve(true);\n          }, 10);\n        });\n      }\n    },\n  },\n  {\n    context: \"/bypass-with-target\",\n    target: `http://localhost:${port1}`,\n    changeOrigin: true,\n    secure: false,\n    bypass(req) {\n      if (/\\.(html)$/i.test(req.path || req.url)) {\n        return req.url;\n      }\n    },\n  },\n];\n\nconst proxyOption = [\n  {\n    context: () => true,\n    target: `http://localhost:${port1}`,\n  },\n];\n\nlet maxServerListeners = 0;\nconst proxyOptionOfArray = [\n  { context: \"/proxy1\", target: `http://localhost:${port1}` },\n  function proxy(req, res, next) {\n    if (req) {\n      const socket = req.socket || req.connection;\n      const server = socket ? socket.server : null;\n      if (server) {\n        maxServerListeners = Math.max(\n          maxServerListeners,\n          server.listeners(\"close\").length,\n        );\n      }\n    }\n    return {\n      context: \"/api/proxy2\",\n      target: `http://localhost:${port2}`,\n      pathRewrite: { \"^/api\": \"\" },\n      bypass: () => {\n        if (req) {\n          const resolveUrl = new URL(req.url, `http://${req.headers.host}`);\n          const params = new URLSearchParams(resolveUrl.search);\n          const foo = params.get(\"foo\");\n\n          if (foo) {\n            res.end(`foo+${next.name}+${typeof next}`);\n\n            return false;\n          }\n        }\n      },\n    };\n  },\n];\n\nconst proxyOptionOfArrayWithoutTarget = [\n  {\n    router: () => `http://localhost:${port1}`,\n  },\n];\n\nconst proxyWithPath = [\n  {\n    context: \"/proxy1\",\n    path: `http://localhost:${port1}`,\n    target: `http://localhost:${port1}`,\n  },\n];\n\nconst proxyWithString = [\n  {\n    context: \"/proxy1\",\n    target: `http://localhost:${port1}`,\n  },\n];\n\nconst proxyWithRouterAsObject = [\n  {\n    router: () => `http://localhost:${port1}`,\n  },\n];\n\ndescribe(\"proxy option\", () => {\n  let proxyServer1;\n  let proxyServer2;\n\n  async function listenProxyServers() {\n    const proxyApp1 = express();\n    const proxyApp2 = express();\n\n    proxyApp1.get(\"/proxy1\", (req, res) => {\n      res.send(\"from proxy1\");\n    });\n    proxyApp1.get(\"/api\", (req, res) => {\n      res.send(\"api response from proxy1\");\n    });\n    proxyApp2.get(\"/proxy2\", (req, res) => {\n      res.send(\"from proxy2\");\n    });\n\n    await new Promise((resolve) => {\n      proxyServer1 = proxyApp1.listen(port1, () => {\n        resolve();\n      });\n    });\n\n    await new Promise((resolve) => {\n      proxyServer2 = proxyApp2.listen(port2, () => {\n        resolve();\n      });\n    });\n  }\n\n  async function closeProxyServers() {\n    await new Promise((resolve) => {\n      proxyServer1.close(() => {\n        resolve();\n      });\n    });\n\n    await new Promise((resolve) => {\n      proxyServer2.close(() => {\n        resolve();\n      });\n    });\n  }\n\n  describe(\"as an object of paths with properties\", () => {\n    let server;\n    let req;\n\n    beforeAll(async () => {\n      const compiler = webpack(config);\n\n      server = new Server(\n        {\n          static: {\n            directory: staticDirectory,\n            watch: false,\n          },\n          proxy: proxyOptionPathsAsProperties,\n          port: port3,\n        },\n        compiler,\n      );\n\n      await server.start();\n\n      await listenProxyServers();\n\n      req = request(server.app);\n    });\n\n    afterAll(async () => {\n      await server.stop();\n      await closeProxyServers();\n    });\n\n    describe(\"target\", () => {\n      it(\"respects a proxy option when a request path is matched\", async () => {\n        const response = await req.get(\"/proxy1\");\n\n        expect(response.status).toBe(200);\n        expect(response.text).toContain(\"from proxy1\");\n      });\n    });\n\n    describe(\"pathRewrite\", () => {\n      it(\"respects a pathRewrite option\", async () => {\n        const response = await req.get(\"/api/proxy2\");\n\n        expect(response.status).toBe(200);\n        expect(response.text).toContain(\"from proxy2\");\n      });\n    });\n\n    describe(\"bypass\", () => {\n      it(\"should log deprecation warning when bypass is used\", async () => {\n        const utilSpy = jest.spyOn(util, \"deprecate\");\n\n        const response = await req.get(\"/foo/bar.html\");\n\n        expect(response.status).toBe(200);\n        expect(response.text).toContain(\"Hello\");\n\n        const lastCall = utilSpy.mock.calls[utilSpy.mock.calls.length - 1];\n\n        expect(lastCall[1]).toBe(\n          \"Using the 'bypass' option is deprecated. Please use the 'router' or 'context' options. Read more at https://github.com/chimurai/http-proxy-middleware/tree/v2.0.6#http-proxy-middleware-options\",\n        );\n        expect(lastCall[2]).toBe(\n          \"DEP_WEBPACK_DEV_SERVER_PROXY_BYPASS_ARGUMENT\",\n        );\n\n        utilSpy.mockRestore();\n      });\n\n      it(\"can rewrite a request path\", async () => {\n        const response = await req.get(\"/foo/bar.html\");\n\n        expect(response.status).toBe(200);\n        expect(response.text).toContain(\"Hello\");\n      });\n\n      it(\"can rewrite a request path regardless of the target defined a bypass option\", async () => {\n        const response = await req.get(\"/baz/hoge.html\");\n\n        expect(response.status).toBe(200);\n        expect(response.text).toContain(\"Hello\");\n      });\n\n      it(\"should pass through a proxy when a bypass function returns null\", async () => {\n        const response = await req.get(\"/foo.js\");\n\n        expect(response.status).toBe(200);\n        expect(response.text).toContain(\"Hey\");\n      });\n\n      it(\"should not pass through a proxy when a bypass function returns false\", async () => {\n        const response = await req.get(\"/proxyfalse\");\n\n        expect(response.status).toBe(404);\n      });\n\n      it(\"should wait if bypass returns promise\", async () => {\n        const response = await req.get(\"/proxy/async\");\n\n        expect(response.status).toBe(200);\n        expect(response.text).toContain(\"proxy async response\");\n      });\n\n      it(\"should work with the 'target' option\", async () => {\n        const response = await req.get(\"/bypass-with-target/foo.js\");\n\n        expect(response.status).toBe(404);\n      });\n\n      it(\"should work with the 'target' option #2\", async () => {\n        const response = await req.get(\"/bypass-with-target/index.html\");\n\n        expect(response.status).toBe(200);\n        expect(response.text).toContain(\"Hello\");\n      });\n    });\n  });\n\n  describe(\"as an option is an object with the `context` option\", () => {\n    let server;\n    let req;\n\n    beforeAll(async () => {\n      const compiler = webpack(config);\n\n      server = new Server(\n        {\n          proxy: proxyOption,\n          port: port3,\n        },\n        compiler,\n      );\n\n      await server.start();\n\n      await listenProxyServers();\n\n      req = request(server.app);\n    });\n\n    afterAll(async () => {\n      await server.stop();\n      await closeProxyServers();\n    });\n\n    it(\"respects a proxy option\", async () => {\n      const response = await req.get(\"/proxy1\");\n\n      expect(response.status).toBe(200);\n      expect(response.text).toContain(\"from proxy1\");\n    });\n  });\n\n  describe(\"as an option is an object with `context` and `target` as string\", () => {\n    let server;\n    let req;\n\n    beforeAll(async () => {\n      const compiler = webpack(config);\n\n      server = new Server(\n        {\n          proxy: proxyWithString,\n          port: port3,\n        },\n        compiler,\n      );\n\n      await server.start();\n\n      await listenProxyServers();\n\n      req = request(server.app);\n    });\n\n    afterAll(async () => {\n      await server.stop();\n      await closeProxyServers();\n    });\n\n    it(\"respects a proxy option\", async () => {\n      const response = await req.get(\"/proxy1\");\n\n      expect(response.status).toBe(200);\n      expect(response.text).toContain(\"from proxy1\");\n    });\n  });\n\n  describe(\"as an option is an object with the `path` option (`context` alias)\", () => {\n    let server;\n    let req;\n\n    beforeAll(async () => {\n      const compiler = webpack(config);\n\n      server = new Server(\n        {\n          proxy: proxyWithPath,\n          port: port3,\n        },\n        compiler,\n      );\n\n      await server.start();\n\n      await listenProxyServers();\n\n      req = request(server.app);\n    });\n\n    afterAll(async () => {\n      await server.stop();\n      await closeProxyServers();\n    });\n\n    it(\"respects a proxy option\", async () => {\n      const response = await req.get(\"/proxy1\");\n\n      expect(response.status).toBe(200);\n      expect(response.text).toContain(\"from proxy1\");\n    });\n  });\n\n  describe(\"as an option is an object with the `router` option\", () => {\n    let server;\n    let req;\n\n    beforeAll(async () => {\n      const compiler = webpack(config);\n\n      server = new Server(\n        {\n          proxy: proxyWithRouterAsObject,\n          port: port3,\n        },\n        compiler,\n      );\n\n      await server.start();\n\n      await listenProxyServers();\n\n      req = request(server.app);\n    });\n\n    afterAll(async () => {\n      await server.stop();\n      await closeProxyServers();\n    });\n\n    it(\"respects a proxy option\", async () => {\n      const response = await req.get(\"/proxy1\");\n\n      expect(response.status).toBe(200);\n      expect(response.text).toContain(\"from proxy1\");\n    });\n  });\n\n  describe(\"as an array\", () => {\n    let server;\n    let req;\n\n    beforeAll(async () => {\n      const compiler = webpack(config);\n\n      server = new Server(\n        {\n          proxy: proxyOptionOfArray,\n          port: port3,\n        },\n        compiler,\n      );\n\n      await server.start();\n\n      await listenProxyServers();\n\n      req = request(server.app);\n    });\n\n    afterAll(async () => {\n      await server.stop();\n      await closeProxyServers();\n    });\n\n    it(\"respects a proxy option\", async () => {\n      const response = await req.get(\"/proxy1\");\n\n      expect(response.status).toBe(200);\n      expect(response.text).toContain(\"from proxy1\");\n    });\n\n    it(\"respects a proxy option of function\", async () => {\n      const response = await req.get(\"/api/proxy2\");\n\n      expect(response.status).toBe(200);\n      expect(response.text).toContain(\"from proxy2\");\n    });\n\n    it(\"should allow req, res, and next\", async () => {\n      const response = await req.get(\"/api/proxy2?foo=true\");\n\n      expect(response.statusCode).toBe(200);\n      expect(response.text).toBe(\"foo+next+function\");\n    });\n\n    it(\"should not exist multiple close events registered\", async () => {\n      expect(maxServerListeners).toBeLessThanOrEqual(1);\n    });\n  });\n\n  describe(\"as an array without the `route` option\", () => {\n    let server;\n    let req;\n\n    beforeAll(async () => {\n      const compiler = webpack(config);\n\n      server = new Server(\n        {\n          proxy: proxyOptionOfArrayWithoutTarget,\n          port: port3,\n        },\n        compiler,\n      );\n\n      await server.start();\n\n      await listenProxyServers();\n\n      req = request(server.app);\n    });\n\n    afterAll(async () => {\n      await server.stop();\n      await closeProxyServers();\n    });\n\n    it(\"respects a proxy option\", async () => {\n      const response = await req.get(\"/proxy1\");\n\n      expect(response.status).toBe(200);\n      expect(response.text).toContain(\"from proxy1\");\n    });\n  });\n\n  describe(\"should sharing a proxy option\", () => {\n    let server;\n    let req;\n    let listener;\n\n    beforeAll(async () => {\n      const compiler = webpack(config);\n\n      server = new Server(\n        {\n          proxy: [\n            {\n              context: \"/proxy1\",\n              target: `http://localhost:${port1}`,\n            },\n            {\n              context: \"/proxy2\",\n              target: `http://localhost:${port1}`,\n            },\n          ],\n          port: port3,\n        },\n        compiler,\n      );\n\n      await server.start();\n\n      const proxy = express();\n\n      proxy.get(\"*\", (proxyReq, res) => {\n        res.send(\"from proxy\");\n      });\n\n      listener = proxy.listen(port1);\n\n      req = request(server.app);\n    });\n\n    afterAll(async () => {\n      await server.stop();\n      await new Promise((resolve) => {\n        listener.close(() => {\n          resolve();\n        });\n      });\n    });\n\n    it(\"respects proxy1 option\", async () => {\n      const response = await req.get(\"/proxy1\");\n\n      expect(response.status).toBe(200);\n      expect(response.text).toContain(\"from proxy\");\n    });\n\n    it(\"respects proxy2 option\", async () => {\n      const response = await req.get(\"/proxy2\");\n\n      expect(response.status).toBe(200);\n      expect(response.text).toContain(\"from proxy\");\n    });\n  });\n\n  describe(\"should handles external websocket upgrade\", () => {\n    let ws;\n    let server;\n    let webSocketServer;\n    let responseMessage;\n\n    const webSocketServerTypes = [\"sockjs\", \"ws\"];\n\n    for (const webSocketServerType of webSocketServerTypes) {\n      // eslint-disable-next-line no-loop-func\n      describe(`with webSocketServerType: ${webSocketServerType}`, () => {\n        beforeAll(async () => {\n          const compiler = webpack(config);\n\n          server = new Server(\n            {\n              webSocketServer: webSocketServerType,\n              proxy: [\n                {\n                  context: \"/\",\n                  target: `http://localhost:${port4}`,\n                  ws: true,\n                },\n              ],\n              port: port3,\n            },\n            compiler,\n          );\n\n          await server.start();\n\n          webSocketServer = new WebSocketServer({ port: port4 });\n          webSocketServer.on(\"connection\", (connection) => {\n            connection.on(\"message\", (message) => {\n              connection.send(message);\n            });\n          });\n        });\n\n        beforeEach((done) => {\n          ws = new WebSocket(`ws://localhost:${port3}/proxy3/socket`);\n\n          ws.on(\"message\", (message) => {\n            responseMessage = message.toString();\n            done();\n          });\n\n          ws.on(\"open\", () => {\n            ws.send(\"foo\");\n          });\n        });\n\n        afterAll(async () => {\n          webSocketServer.close();\n\n          for (const client of webSocketServer.clients) {\n            client.terminate();\n          }\n\n          await server.stop();\n        });\n\n        it(\"should receive response\", () => {\n          expect(responseMessage).toBe(\"foo\");\n        });\n      });\n    }\n  });\n\n  describe(\"should supports http methods\", () => {\n    let server;\n    let req;\n    let listener;\n\n    beforeAll(async () => {\n      const compiler = webpack(config);\n\n      server = new Server(\n        {\n          proxy: [\n            {\n              context: \"**\",\n              target: `http://localhost:${port1}`,\n            },\n          ],\n          port: port3,\n        },\n        compiler,\n      );\n\n      await server.start();\n\n      const proxy = express();\n\n      // Parse application/x-www-form-urlencoded\n      proxy.use(express.urlencoded({ extended: false }));\n\n      // Parse application/json\n      proxy.use(express.json());\n\n      // This forces Express to try to decode URLs, which is needed for the test\n      // associated with the middleware below.\n      proxy.all(\"*\", (_req, res, next) => {\n        next();\n      });\n      // We must define all 4 params in order for this to be detected as an\n      // error handling middleware.\n      // eslint-disable-next-line no-unused-vars\n      proxy.use((error, proxyReq, res, next) => {\n        res.status(500);\n        res.send(\"error from proxy\");\n      });\n\n      proxy.get(\"/get\", (proxyReq, res) => {\n        res.send(\"GET method from proxy\");\n      });\n\n      proxy.head(\"/head\", (proxyReq, res) => {\n        res.send(\"HEAD method from proxy\");\n      });\n\n      proxy.post(\"/post-x-www-form-urlencoded\", (proxyReq, res) => {\n        const { id } = proxyReq.body;\n\n        res.status(200).send(`POST method from proxy (id: ${id})`);\n      });\n\n      proxy.post(\"/post-application-json\", (proxyReq, res) => {\n        const { id } = proxyReq.body;\n\n        res.status(200).send({ answer: `POST method from proxy (id: ${id})` });\n      });\n\n      proxy.delete(\"/delete\", (proxyReq, res) => {\n        res.send(\"DELETE method from proxy\");\n      });\n\n      listener = proxy.listen(port1);\n      req = request(server.app);\n    });\n\n    afterAll(async () => {\n      await server.stop();\n\n      await new Promise((resolve) => {\n        listener.close(() => {\n          resolve();\n        });\n      });\n    });\n\n    it(\"errors\", async () => {\n      const response = await req.get(\"/%\");\n\n      expect(response.status).toBe(500);\n      expect(response.text).toContain(\"error from proxy\");\n    });\n\n    it(\"gET method\", async () => {\n      const response = await req.get(\"/get\");\n\n      expect(response.status).toBe(200);\n      expect(response.text).toContain(\"GET method from proxy\");\n    });\n\n    it(\"hEAD method\", async () => {\n      const response = await req.head(\"/head\");\n\n      expect(response.status).toBe(200);\n    });\n\n    it(\"pOST method (application/x-www-form-urlencoded)\", async () => {\n      const response = await req\n        .post(\"/post-x-www-form-urlencoded\")\n        .send(\"id=1\");\n\n      expect(response.status).toBe(200);\n      expect(response.text).toContain(\"POST method from proxy (id: 1)\");\n    });\n\n    it(\"pOST method (application/json)\", async () => {\n      const response = await req\n        .post(\"/post-application-json\")\n        .send({ id: \"1\" })\n        .set(\"Accept\", \"application/json\");\n\n      expect(response.status).toBe(200);\n      expect(response.headers[\"content-type\"]).toBe(\n        \"application/json; charset=utf-8\",\n      );\n      expect(response.text).toContain(\"POST method from proxy (id: 1)\");\n    });\n\n    it(\"dELETE method\", async () => {\n      const response = await req.delete(\"/delete\");\n\n      expect(response.status).toBe(200);\n      expect(response.text).toContain(\"DELETE method from proxy\");\n    });\n  });\n\n  describe(\"should work in multi compiler mode\", () => {\n    let server;\n    let req;\n\n    beforeAll(async () => {\n      const compiler = webpack([config, config]);\n\n      server = new Server(\n        {\n          proxy: [\n            {\n              context: () => true,\n              target: `http://localhost:${port1}`,\n            },\n          ],\n          port: port3,\n        },\n        compiler,\n      );\n\n      await server.start();\n\n      await listenProxyServers();\n\n      req = request(server.app);\n    });\n\n    afterAll(async () => {\n      await server.stop();\n      await closeProxyServers();\n    });\n\n    it(\"respects a proxy option\", async () => {\n      const response = await req.get(\"/proxy1\");\n\n      expect(response.status).toBe(200);\n      expect(response.text).toContain(\"from proxy1\");\n    });\n  });\n\n  describe(\"should work and respect `logProvider` and `logLevel` options\", () => {\n    let server;\n    let req;\n    let customLogProvider;\n\n    beforeAll(async () => {\n      customLogProvider = {\n        log: jest.fn(),\n        debug: jest.fn(),\n        info: jest.fn(),\n        warn: jest.fn(),\n        error: jest.fn(),\n      };\n\n      const compiler = webpack([config, config]);\n\n      server = new Server(\n        {\n          proxy: [\n            {\n              context: \"/my-path\",\n              target: \"http://unknown:1234\",\n              logProvider: () => customLogProvider,\n              logLevel: \"error\",\n            },\n          ],\n          port: port3,\n        },\n        compiler,\n      );\n\n      await server.start();\n\n      await listenProxyServers();\n\n      req = request(server.app);\n    });\n\n    afterAll(async () => {\n      await server.stop();\n      await closeProxyServers();\n    });\n\n    describe(\"target\", () => {\n      it(\"respects a proxy option when a request path is matched\", async () => {\n        await req.get(\"/my-path\");\n\n        expect(customLogProvider.error).toHaveBeenCalledTimes(1);\n      });\n    });\n  });\n\n  describe(\"should work and respect the `logLevel` option with `silent` value\", () => {\n    let server;\n    let req;\n    let customLogProvider;\n\n    beforeAll(async () => {\n      customLogProvider = {\n        log: jest.fn(),\n        debug: jest.fn(),\n        info: jest.fn(),\n        warn: jest.fn(),\n        error: jest.fn(),\n      };\n\n      const compiler = webpack([config, config]);\n\n      server = new Server(\n        {\n          proxy: [\n            {\n              context: \"my-path\",\n              target: \"http://unknown:1234\",\n              logProvider: () => customLogProvider,\n              logLevel: \"silent\",\n            },\n          ],\n          port: port3,\n        },\n        compiler,\n      );\n\n      await server.start();\n\n      await listenProxyServers();\n\n      req = request(server.app);\n    });\n\n    afterAll(async () => {\n      await server.stop();\n      await closeProxyServers();\n    });\n\n    describe(\"target\", () => {\n      it(\"respects a proxy option when a request path is matched\", async () => {\n        await req.get(\"/my-path\");\n\n        expect(customLogProvider.error).toHaveBeenCalledTimes(0);\n      });\n    });\n  });\n\n  describe(\"should work and respect the `infrastructureLogging.level` option\", () => {\n    let server;\n    let req;\n    let customLogProvider;\n\n    beforeAll(async () => {\n      customLogProvider = {\n        log: jest.fn(),\n        debug: jest.fn(),\n        info: jest.fn(),\n        warn: jest.fn(),\n        error: jest.fn(),\n      };\n\n      const compiler = webpack({\n        ...config,\n        infrastructureLogging: { level: \"error\" },\n      });\n\n      server = new Server(\n        {\n          proxy: [\n            {\n              context: \"/my-path\",\n              target: \"http://unknown:1234\",\n              logProvider: () => customLogProvider,\n            },\n          ],\n          port: port3,\n        },\n        compiler,\n      );\n\n      await server.start();\n\n      await listenProxyServers();\n\n      req = request(server.app);\n    });\n\n    afterAll(async () => {\n      await server.stop();\n      await closeProxyServers();\n    });\n\n    describe(\"target\", () => {\n      it(\"respects a proxy option when a request path is matched\", async () => {\n        await req.get(\"/my-path\");\n\n        expect(customLogProvider.error).toHaveBeenCalledTimes(1);\n      });\n    });\n  });\n\n  describe(\"should work and respect the `infrastructureLogging.level` option with `none` value\", () => {\n    let server;\n    let req;\n    let customLogProvider;\n\n    beforeAll(async () => {\n      customLogProvider = {\n        log: jest.fn(),\n        debug: jest.fn(),\n        info: jest.fn(),\n        warn: jest.fn(),\n        error: jest.fn(),\n      };\n\n      const compiler = webpack({\n        ...config,\n        infrastructureLogging: { level: \"none\" },\n      });\n\n      server = new Server(\n        {\n          proxy: [\n            {\n              context: \"/my-path\",\n              target: \"http://unknown:1234\",\n              logProvider: () => customLogProvider,\n            },\n          ],\n          port: port3,\n        },\n        compiler,\n      );\n\n      await server.start();\n\n      req = request(server.app);\n    });\n\n    afterAll(async () => {\n      await server.stop();\n    });\n\n    describe(\"target\", () => {\n      it(\"respects a proxy option when a request path is matched\", async () => {\n        await req.get(\"/my-path\");\n\n        expect(customLogProvider.error).toHaveBeenCalledTimes(0);\n      });\n    });\n  });\n});\n"
  },
  {
    "path": "test/validate-options.test.js",
    "content": "\"use strict\";\n\nconst os = require(\"node:os\");\nconst path = require(\"node:path\");\nconst { readFileSync } = require(\"graceful-fs\");\nconst { Volume, createFsFromVolume } = require(\"memfs\");\nconst webpack = require(\"webpack\");\nconst Server = require(\"../lib/Server\");\nconst config = require(\"./fixtures/simple-config/webpack.config\");\n\nconst httpsCertificateDirectory = path.join(\n  __dirname,\n  \"./fixtures/https-certificate\",\n);\n\nconst tests = {\n  bonjour: {\n    success: [false, true, { type: \"https\" }],\n    failure: [\"\"],\n  },\n  client: {\n    success: [\n      {},\n      {\n        logging: \"none\",\n      },\n      {\n        logging: \"error\",\n      },\n      {\n        logging: \"warn\",\n      },\n      {\n        logging: \"info\",\n      },\n      {\n        logging: \"log\",\n      },\n      {\n        logging: \"verbose\",\n      },\n      {\n        progress: false,\n      },\n      {\n        reconnect: false,\n      },\n      {\n        reconnect: true,\n      },\n      {\n        reconnect: 5,\n      },\n      {\n        overlay: true,\n      },\n      {\n        overlay: {},\n      },\n      {\n        overlay: {\n          errors: true,\n        },\n      },\n      {\n        overlay: {\n          warnings: true,\n        },\n      },\n      {\n        webSocketTransport: \"sockjs\",\n      },\n      {\n        webSocketTransport: require.resolve(\"../client/clients/SockJSClient\"),\n      },\n      {\n        webSocketURL: \"ws://localhost:8080\",\n      },\n      {\n        webSocketURL: { hostname: \"localhost\" },\n      },\n      {\n        webSocketURL: { port: 8080 },\n      },\n      {\n        webSocketURL: { port: \"8080\" },\n      },\n      {\n        webSocketURL: { pathname: \"\" },\n      },\n      {\n        webSocketURL: { pathname: \"/my-path/\" },\n      },\n      {\n        webSocketURL: {\n          hostname: \"localhost\",\n          port: 8080,\n          pathname: \"/my-path/\",\n        },\n      },\n      {\n        webSocketURL: { username: \"username\", password: \"password\" },\n      },\n    ],\n    failure: [\n      \"whoops!\",\n      {\n        unknownOption: true,\n      },\n      {\n        logging: \"whoops!\",\n      },\n      {\n        logging: \"silent\",\n      },\n      {\n        progress: \"\",\n      },\n      {\n        reconnect: \"\",\n      },\n      {\n        overlay: \"\",\n      },\n      {\n        overlay: {\n          errors: \"\",\n        },\n      },\n      {\n        overlay: {\n          warnings: \"\",\n        },\n      },\n      {\n        overlay: {\n          arbitrary: \"\",\n        },\n      },\n      {\n        webSocketTransport: true,\n      },\n      {\n        webSocketURL: { hostname: true, pathname: \"\", port: 8080 },\n      },\n      {\n        webSocketURL: { pathname: true },\n      },\n      {\n        webSocketURL: { port: true },\n      },\n      {\n        webSocketURL: { hostname: \"\" },\n      },\n      {\n        webSocketURL: { port: \"\" },\n      },\n      {\n        webSocketURL: { username: 123, password: 976 },\n      },\n    ],\n  },\n  compress: {\n    success: [false, true],\n    failure: [\"\"],\n  },\n  devMiddleware: {\n    success: [{}],\n    failure: [\"\"],\n  },\n  allowedHosts: {\n    success: [\"auto\", \"all\", [\"foo\"], \"bar\"],\n    failure: [true, false, 123, [], [\"\"]],\n  },\n  headers: {\n    success: [{}, { foo: \"bar\" }, () => {}, [{ key: \"foo\", value: \"bar\" }]],\n    failure: [false, 1, [], [{ foo: \"bar\" }]],\n  },\n  historyApiFallback: {\n    success: [{}, true],\n    failure: [\"\"],\n  },\n  host: {\n    success: [\"localhost\", \"::\", \"::1\"],\n    failure: [false, \"\", null],\n  },\n  hot: {\n    success: [true, \"only\"],\n    failure: [\"\", \"foo\"],\n  },\n  ipc: {\n    success: [true, path.resolve(os.tmpdir(), \"webpack-dev-server.socket\")],\n    failure: [false, {}],\n  },\n  liveReload: {\n    success: [true, false],\n    failure: [\"invalid\"],\n  },\n  onListening: {\n    success: [() => {}],\n    failure: [\"\"],\n  },\n  open: {\n    success: [\n      true,\n      \"foo\",\n      [],\n      [\"foo\", \"bar\"],\n      [{ app: \"google-chrome\" }],\n      [{ app: \"google-chrome\" }, { app: \"firefox\" }],\n      [{ target: \"foo\", app: \"google-chrome\" }, { app: \"firefox\" }],\n      [{ target: [\"foo\", \"bar\"], app: \"google-chrome\" }, { app: \"firefox\" }],\n      { target: \"foo\" },\n      { target: [\"foo\", \"bar\"] },\n      { app: \"google-chrome\" },\n      { app: { name: \"google-chrome\", arguments: [\"--incognito\"] } },\n      { target: \"foo\", app: \"google-chrome\" },\n      {\n        target: [\"foo\", \"bar\"],\n        app: { name: \"google-chrome\", arguments: [\"--incognito\"] },\n      },\n      {},\n    ],\n    failure: [\"\", { foo: \"bar\" }, { target: 90 }, { app: true }],\n  },\n  port: {\n    success: [\"20000\", 20001, \"auto\", 0, 1, 65535],\n    failure: [false, null, \"\", -1, 65536],\n  },\n  proxy: {\n    success: [\n      [\n        {\n          context: [\"/auth\", \"/api\"],\n          target: \"http://localhost:3000\",\n        },\n      ],\n    ],\n    failure: [\n      () => {},\n      false,\n      {\n        \"/api\": \"http://localhost:3000\",\n      },\n    ],\n  },\n  server: {\n    success: [\n      \"http\",\n      \"https\",\n      \"spdy\",\n      \"custom-server.js\",\n      {\n        type: \"http\",\n      },\n      {\n        type: \"https\",\n      },\n      {\n        type: \"spdy\",\n      },\n      {\n        type: \"custom-server.js\",\n      },\n      {\n        type: \"https\",\n        options: {\n          ca: path.join(httpsCertificateDirectory, \"ca.pem\"),\n          key: path.join(httpsCertificateDirectory, \"server.key\"),\n          pfx: path.join(httpsCertificateDirectory, \"server.pfx\"),\n          cert: path.join(httpsCertificateDirectory, \"server.crt\"),\n          requestCert: true,\n          passphrase: \"webpack-dev-server\",\n        },\n      },\n      {\n        type: \"https\",\n        options: {\n          ca: readFileSync(\n            path.join(httpsCertificateDirectory, \"ca.pem\"),\n          ).toString(),\n          pfx: readFileSync(\n            path.join(httpsCertificateDirectory, \"server.pfx\"),\n          ).toString(),\n          key: readFileSync(\n            path.join(httpsCertificateDirectory, \"server.key\"),\n          ).toString(),\n          cert: readFileSync(\n            path.join(httpsCertificateDirectory, \"server.crt\"),\n          ).toString(),\n          passphrase: \"webpack-dev-server\",\n        },\n      },\n      {\n        type: \"https\",\n        options: {\n          ca: [\n            readFileSync(\n              path.join(httpsCertificateDirectory, \"ca.pem\"),\n            ).toString(),\n          ],\n          pfx: [\n            readFileSync(\n              path.join(httpsCertificateDirectory, \"server.pfx\"),\n            ).toString(),\n          ],\n          key: [\n            readFileSync(\n              path.join(httpsCertificateDirectory, \"server.key\"),\n            ).toString(),\n          ],\n          cert: [\n            readFileSync(\n              path.join(httpsCertificateDirectory, \"server.crt\"),\n            ).toString(),\n          ],\n          passphrase: \"webpack-dev-server\",\n        },\n      },\n      {\n        type: \"https\",\n        options: {\n          ca: readFileSync(path.join(httpsCertificateDirectory, \"ca.pem\")),\n          pfx: readFileSync(path.join(httpsCertificateDirectory, \"server.pfx\")),\n          key: readFileSync(path.join(httpsCertificateDirectory, \"server.key\")),\n          cert: readFileSync(\n            path.join(httpsCertificateDirectory, \"server.crt\"),\n          ),\n          passphrase: \"webpack-dev-server\",\n        },\n      },\n      {\n        type: \"https\",\n        options: {\n          ca: [readFileSync(path.join(httpsCertificateDirectory, \"ca.pem\"))],\n          pfx: [\n            readFileSync(path.join(httpsCertificateDirectory, \"server.pfx\")),\n          ],\n          key: [\n            readFileSync(path.join(httpsCertificateDirectory, \"server.key\")),\n          ],\n          cert: [\n            readFileSync(path.join(httpsCertificateDirectory, \"server.crt\")),\n          ],\n          passphrase: \"webpack-dev-server\",\n        },\n      },\n      {\n        type: \"https\",\n        options: {\n          ca: [path.join(httpsCertificateDirectory, \"ca.pem\")],\n          key: [path.join(httpsCertificateDirectory, \"server.key\")],\n          pfx: [path.join(httpsCertificateDirectory, \"server.pfx\")],\n          cert: [path.join(httpsCertificateDirectory, \"server.crt\")],\n          requestCert: true,\n          passphrase: \"webpack-dev-server\",\n        },\n      },\n      {\n        type: \"https\",\n        options: {\n          minVersion: \"TLSv1.1\",\n          ca: readFileSync(path.join(httpsCertificateDirectory, \"ca.pem\")),\n          pfx: readFileSync(path.join(httpsCertificateDirectory, \"server.pfx\")),\n          key: readFileSync(path.join(httpsCertificateDirectory, \"server.key\")),\n          cert: readFileSync(\n            path.join(httpsCertificateDirectory, \"server.crt\"),\n          ),\n          passphrase: \"webpack-dev-server\",\n        },\n      },\n      {\n        type: \"https\",\n        options: {\n          ca: readFileSync(path.join(httpsCertificateDirectory, \"ca.pem\")),\n          pfx: [\n            {\n              buf: readFileSync(\n                path.join(httpsCertificateDirectory, \"server.pfx\"),\n              ),\n            },\n          ],\n          key: [\n            {\n              pem: readFileSync(\n                path.join(httpsCertificateDirectory, \"server.key\"),\n              ),\n            },\n          ],\n          cert: readFileSync(\n            path.join(httpsCertificateDirectory, \"server.crt\"),\n          ),\n          passphrase: \"webpack-dev-server\",\n        },\n      },\n    ],\n    failure: [\n      {\n        type: \"https\",\n        additional: \"test\",\n      },\n      {\n        type: \"https\",\n        options: {\n          key: 10,\n        },\n      },\n      {\n        type: \"https\",\n        options: {\n          cert: true,\n        },\n      },\n      {\n        type: \"https\",\n        options: {\n          ca: true,\n        },\n      },\n      {\n        type: \"https\",\n        options: {\n          pfx: 10,\n        },\n      },\n      {\n        type: \"https\",\n        options: {\n          passphrase: false,\n        },\n      },\n      {\n        type: \"https\",\n        options: {\n          requestCert: \"false\",\n        },\n      },\n    ],\n  },\n  app: {\n    success: [\n      () => require(\"connect\")(),\n      async () =>\n        new Promise((resolve) => {\n          resolve(require(\"connect\")());\n        }),\n    ],\n    failure: [\"test\", false],\n  },\n  static: {\n    success: [\n      \"path\",\n      false,\n      {\n        directory: \"path\",\n        staticOptions: {},\n        publicPath: \"/\",\n        serveIndex: true,\n        watch: true,\n      },\n      {\n        directory: \"path\",\n        staticOptions: {},\n        publicPath: [\"/public1/\", \"/public2/\"],\n        serveIndex: {},\n        watch: {},\n      },\n      [\n        \"path1\",\n        {\n          directory: \"path2\",\n          staticOptions: {},\n          publicPath: \"/\",\n          serveIndex: true,\n          watch: true,\n        },\n      ],\n    ],\n    failure: [\n      0,\n      null,\n      \"\",\n      {\n        publicPath: false,\n      },\n      {\n        serveIndex: \"true\",\n      },\n      {\n        directory: false,\n      },\n      {\n        watch: 10,\n      },\n    ],\n  },\n  setupMiddlewares: {\n    success: [() => {}],\n    failure: [false, 10, \"true\"],\n  },\n  webSocketServer: {\n    success: [\n      false,\n      \"ws\",\n      \"sockjs\",\n      {\n        type: \"ws\",\n        options: {\n          path: \"/ws\",\n        },\n      },\n      {\n        options: {\n          host: \"127.0.0.1\",\n          port: 8090,\n          path: \"/ws\",\n        },\n      },\n      {\n        type: \"ws\",\n      },\n    ],\n    failure: [\n      null,\n      true,\n      {\n        type: false,\n      },\n      {\n        notAnOption: true,\n      },\n      {\n        type: true,\n      },\n    ],\n  },\n  watchFiles: {\n    success: [\n      \"dir\",\n      [\"one-dir\", \"two-dir\"],\n      { paths: [\"dir\"] },\n      { paths: [\"dir\"], options: { usePolling: true } },\n      [{ paths: [\"one-dir\"] }, \"two-dir\"],\n    ],\n    failure: [\n      false,\n      123,\n      {\n        paths: false,\n      },\n      {\n        options: false,\n      },\n    ],\n  },\n};\n\ndescribe(\"options\", () => {\n  let consoleMock;\n\n  beforeAll(() => {\n    consoleMock = jest.spyOn(console, \"warn\").mockImplementation();\n  });\n\n  afterAll(() => {\n    consoleMock.mockRestore();\n  });\n\n  describe(\"validate\", () => {\n    function stringifyValue(value) {\n      if (\n        Array.isArray(value) ||\n        (value && typeof value === \"object\" && value.constructor === Object)\n      ) {\n        return JSON.stringify(value, (_key, replacedValue) => {\n          if (\n            replacedValue &&\n            replacedValue.type &&\n            replacedValue.type === \"Buffer\"\n          ) {\n            return \"<Buffer>\";\n          }\n\n          if (typeof replacedValue === \"string\") {\n            replacedValue = replacedValue\n              .replaceAll(\"\\\\\", \"/\")\n              .replaceAll(\n                new RegExp(process.cwd().replaceAll(\"\\\\\", \"/\"), \"g\"),\n                \"<cwd>\",\n              );\n          }\n\n          return replacedValue;\n        });\n      }\n\n      return value;\n    }\n\n    function createTestCase(type, key, value) {\n      it(`should ${\n        type === \"success\" ? \"successfully validate\" : \"throw an error on\"\n      } the \"${key}\" option with '${stringifyValue(\n        value,\n      )}' value`, async () => {\n        const compiler = webpack(config);\n        let thrownError;\n\n        try {\n          // eslint-disable-next-line no-new\n          new Server({ [key]: value }, compiler);\n        } catch (error) {\n          thrownError = error;\n        }\n\n        if (type === \"success\") {\n          expect(thrownError).toBeUndefined();\n        } else {\n          expect(thrownError).toBeDefined();\n          expect(thrownError.toString()).toMatchSnapshot();\n        }\n      });\n    }\n\n    const memfs = createFsFromVolume(new Volume());\n\n    // We need to patch memfs\n    // https://github.com/webpack/webpack-dev-middleware#fs\n    memfs.join = path.join;\n\n    for (const [key, values] of Object.entries(tests)) {\n      for (const type of Object.keys(values)) {\n        for (const value of values[type]) {\n          createTestCase(type, key, value);\n        }\n      }\n    }\n  });\n});\n"
  },
  {
    "path": "tsconfig.client.json",
    "content": "{\n  \"compilerOptions\": {\n    \"target\": \"esnext\",\n    \"lib\": [\"es5\", \"dom\", \"webworker\", \"es2022.error\"],\n    \"module\": \"nodenext\",\n    \"moduleResolution\": \"nodenext\",\n    \"allowJs\": true,\n    \"checkJs\": true,\n    \"noEmit\": true,\n    \"strict\": true,\n    \"types\": [\"@types/trusted-types\", \"webpack/module\"],\n    \"skipDefaultLibCheck\": true,\n    \"esModuleInterop\": true\n  },\n  \"include\": [\"./client-src/**/*\"],\n  \"exclude\": [\"./client-src/webpack.config.js\"]\n}\n"
  },
  {
    "path": "tsconfig.json",
    "content": "{\n  \"compilerOptions\": {\n    \"target\": \"ES2017\",\n    \"module\": \"commonjs\",\n    \"lib\": [\"es2017\", \"dom\"],\n    \"allowJs\": true,\n    \"checkJs\": true,\n    \"strict\": true,\n    \"types\": [\"node\"],\n    \"resolveJsonModule\": true,\n    \"allowSyntheticDefaultImports\": true\n  },\n  \"include\": [\"./bin/**/*\", \"./lib/**/*\"]\n}\n"
  },
  {
    "path": "types/bin/cli-flags.d.ts",
    "content": "declare const _exports: {\n  \"allowed-hosts\": {\n    configs: (\n      | {\n          type: string;\n          multiple: boolean;\n          description: string;\n          path: string;\n          values?: undefined;\n        }\n      | {\n          description: string;\n          multiple: boolean;\n          path: string;\n          type: string;\n          values: string[];\n        }\n    )[];\n    description: string;\n    multiple: boolean;\n    simpleType: string;\n  };\n  \"allowed-hosts-reset\": {\n    configs: {\n      type: string;\n      multiple: boolean;\n      description: string;\n      path: string;\n    }[];\n    description: string;\n    simpleType: string;\n    multiple: boolean;\n  };\n  bonjour: {\n    configs: {\n      type: string;\n      multiple: boolean;\n      description: string;\n      negatedDescription: string;\n      path: string;\n    }[];\n    description: string;\n    simpleType: string;\n    multiple: boolean;\n  };\n  client: {\n    configs: {\n      description: string;\n      negatedDescription: string;\n      multiple: boolean;\n      path: string;\n      type: string;\n      values: boolean[];\n    }[];\n    description: string;\n    multiple: boolean;\n    simpleType: string;\n  };\n  \"client-logging\": {\n    configs: {\n      type: string;\n      values: string[];\n      multiple: boolean;\n      description: string;\n      path: string;\n    }[];\n    description: string;\n    simpleType: string;\n    multiple: boolean;\n  };\n  \"client-overlay\": {\n    configs: {\n      type: string;\n      multiple: boolean;\n      description: string;\n      negatedDescription: string;\n      path: string;\n    }[];\n    description: string;\n    simpleType: string;\n    multiple: boolean;\n  };\n  \"client-overlay-errors\": {\n    configs: {\n      type: string;\n      multiple: boolean;\n      description: string;\n      negatedDescription: string;\n      path: string;\n    }[];\n    description: string;\n    simpleType: string;\n    multiple: boolean;\n  };\n  \"client-overlay-trusted-types-policy-name\": {\n    configs: {\n      description: string;\n      multiple: boolean;\n      path: string;\n      type: string;\n    }[];\n    description: string;\n    multiple: boolean;\n    simpleType: string;\n  };\n  \"client-overlay-warnings\": {\n    configs: {\n      type: string;\n      multiple: boolean;\n      description: string;\n      negatedDescription: string;\n      path: string;\n    }[];\n    description: string;\n    simpleType: string;\n    multiple: boolean;\n  };\n  \"client-overlay-runtime-errors\": {\n    configs: {\n      type: string;\n      multiple: boolean;\n      description: string;\n      negatedDescription: string;\n      path: string;\n    }[];\n    description: string;\n    simpleType: string;\n    multiple: boolean;\n  };\n  \"client-progress\": {\n    configs: {\n      type: string;\n      multiple: boolean;\n      description: string;\n      negatedDescription: string;\n      path: string;\n    }[];\n    description: string;\n    simpleType: string;\n    multiple: boolean;\n  };\n  \"client-reconnect\": {\n    configs: (\n      | {\n          type: string;\n          multiple: boolean;\n          description: string;\n          negatedDescription: string;\n          path: string;\n        }\n      | {\n          type: string;\n          multiple: boolean;\n          description: string;\n          path: string;\n          negatedDescription?: undefined;\n        }\n    )[];\n    description: string;\n    simpleType: string;\n    multiple: boolean;\n  };\n  \"client-web-socket-transport\": {\n    configs: (\n      | {\n          type: string;\n          values: string[];\n          multiple: boolean;\n          description: string;\n          path: string;\n        }\n      | {\n          type: string;\n          multiple: boolean;\n          description: string;\n          path: string;\n          values?: undefined;\n        }\n    )[];\n    description: string;\n    simpleType: string;\n    multiple: boolean;\n  };\n  \"client-web-socket-url\": {\n    configs: {\n      type: string;\n      multiple: boolean;\n      description: string;\n      path: string;\n    }[];\n    description: string;\n    simpleType: string;\n    multiple: boolean;\n  };\n  \"client-web-socket-url-hostname\": {\n    configs: {\n      type: string;\n      multiple: boolean;\n      description: string;\n      path: string;\n    }[];\n    description: string;\n    simpleType: string;\n    multiple: boolean;\n  };\n  \"client-web-socket-url-password\": {\n    configs: {\n      type: string;\n      multiple: boolean;\n      description: string;\n      path: string;\n    }[];\n    description: string;\n    simpleType: string;\n    multiple: boolean;\n  };\n  \"client-web-socket-url-pathname\": {\n    configs: {\n      type: string;\n      multiple: boolean;\n      description: string;\n      path: string;\n    }[];\n    description: string;\n    simpleType: string;\n    multiple: boolean;\n  };\n  \"client-web-socket-url-port\": {\n    configs: {\n      type: string;\n      multiple: boolean;\n      description: string;\n      path: string;\n    }[];\n    description: string;\n    simpleType: string;\n    multiple: boolean;\n  };\n  \"client-web-socket-url-protocol\": {\n    configs: (\n      | {\n          description: string;\n          multiple: boolean;\n          path: string;\n          type: string;\n          values: string[];\n        }\n      | {\n          description: string;\n          multiple: boolean;\n          path: string;\n          type: string;\n          values?: undefined;\n        }\n    )[];\n    description: string;\n    multiple: boolean;\n    simpleType: string;\n  };\n  \"client-web-socket-url-username\": {\n    configs: {\n      type: string;\n      multiple: boolean;\n      description: string;\n      path: string;\n    }[];\n    description: string;\n    simpleType: string;\n    multiple: boolean;\n  };\n  compress: {\n    configs: {\n      type: string;\n      multiple: boolean;\n      description: string;\n      negatedDescription: string;\n      path: string;\n    }[];\n    description: string;\n    simpleType: string;\n    multiple: boolean;\n  };\n  \"history-api-fallback\": {\n    configs: {\n      type: string;\n      multiple: boolean;\n      description: string;\n      negatedDescription: string;\n      path: string;\n    }[];\n    description: string;\n    simpleType: string;\n    multiple: boolean;\n  };\n  host: {\n    configs: (\n      | {\n          description: string;\n          multiple: boolean;\n          path: string;\n          type: string;\n          values: string[];\n        }\n      | {\n          description: string;\n          multiple: boolean;\n          path: string;\n          type: string;\n          values?: undefined;\n        }\n    )[];\n    description: string;\n    simpleType: string;\n    multiple: boolean;\n  };\n  hot: {\n    configs: (\n      | {\n          type: string;\n          multiple: boolean;\n          description: string;\n          negatedDescription: string;\n          path: string;\n          values?: undefined;\n        }\n      | {\n          type: string;\n          values: string[];\n          multiple: boolean;\n          description: string;\n          path: string;\n          negatedDescription?: undefined;\n        }\n    )[];\n    description: string;\n    simpleType: string;\n    multiple: boolean;\n  };\n  http2: {\n    configs: {\n      type: string;\n      multiple: boolean;\n      description: string;\n      negatedDescription: string;\n      path: string;\n    }[];\n    description: string;\n    simpleType: string;\n    multiple: boolean;\n  };\n  https: {\n    configs: {\n      type: string;\n      multiple: boolean;\n      description: string;\n      negatedDescription: string;\n      path: string;\n    }[];\n    description: string;\n    simpleType: string;\n    multiple: boolean;\n  };\n  \"https-ca\": {\n    configs: {\n      type: string;\n      multiple: boolean;\n      description: string;\n      path: string;\n    }[];\n    description: string;\n    simpleType: string;\n    multiple: boolean;\n  };\n  \"https-ca-reset\": {\n    configs: {\n      description: string;\n      multiple: boolean;\n      path: string;\n      type: string;\n    }[];\n    description: string;\n    multiple: boolean;\n    simpleType: string;\n  };\n  \"https-cacert\": {\n    configs: {\n      type: string;\n      multiple: boolean;\n      description: string;\n      path: string;\n    }[];\n    description: string;\n    simpleType: string;\n    multiple: boolean;\n  };\n  \"https-cacert-reset\": {\n    configs: {\n      description: string;\n      multiple: boolean;\n      path: string;\n      type: string;\n    }[];\n    description: string;\n    multiple: boolean;\n    simpleType: string;\n  };\n  \"https-cert\": {\n    configs: {\n      type: string;\n      multiple: boolean;\n      description: string;\n      path: string;\n    }[];\n    description: string;\n    simpleType: string;\n    multiple: boolean;\n  };\n  \"https-cert-reset\": {\n    configs: {\n      description: string;\n      multiple: boolean;\n      path: string;\n      type: string;\n    }[];\n    description: string;\n    multiple: boolean;\n    simpleType: string;\n  };\n  \"https-crl\": {\n    configs: {\n      description: string;\n      multiple: boolean;\n      path: string;\n      type: string;\n    }[];\n    description: string;\n    multiple: boolean;\n    simpleType: string;\n  };\n  \"https-crl-reset\": {\n    configs: {\n      description: string;\n      multiple: boolean;\n      path: string;\n      type: string;\n    }[];\n    description: string;\n    multiple: boolean;\n    simpleType: string;\n  };\n  \"https-key\": {\n    configs: {\n      type: string;\n      multiple: boolean;\n      description: string;\n      path: string;\n    }[];\n    description: string;\n    simpleType: string;\n    multiple: boolean;\n  };\n  \"https-key-reset\": {\n    configs: {\n      description: string;\n      multiple: boolean;\n      path: string;\n      type: string;\n    }[];\n    description: string;\n    multiple: boolean;\n    simpleType: string;\n  };\n  \"https-passphrase\": {\n    configs: {\n      type: string;\n      multiple: boolean;\n      description: string;\n      path: string;\n    }[];\n    description: string;\n    simpleType: string;\n    multiple: boolean;\n  };\n  \"https-pfx\": {\n    configs: {\n      type: string;\n      multiple: boolean;\n      description: string;\n      path: string;\n    }[];\n    description: string;\n    simpleType: string;\n    multiple: boolean;\n  };\n  \"https-pfx-reset\": {\n    configs: {\n      description: string;\n      multiple: boolean;\n      path: string;\n      type: string;\n    }[];\n    description: string;\n    multiple: boolean;\n    simpleType: string;\n  };\n  \"https-request-cert\": {\n    configs: {\n      type: string;\n      multiple: boolean;\n      description: string;\n      negatedDescription: string;\n      path: string;\n    }[];\n    description: string;\n    simpleType: string;\n    multiple: boolean;\n  };\n  ipc: {\n    configs: (\n      | {\n          type: string;\n          multiple: boolean;\n          description: string;\n          path: string;\n          values?: undefined;\n        }\n      | {\n          type: string;\n          values: boolean[];\n          multiple: boolean;\n          description: string;\n          path: string;\n        }\n    )[];\n    description: string;\n    simpleType: string;\n    multiple: boolean;\n  };\n  \"live-reload\": {\n    configs: {\n      type: string;\n      multiple: boolean;\n      description: string;\n      negatedDescription: string;\n      path: string;\n    }[];\n    description: string;\n    simpleType: string;\n    multiple: boolean;\n  };\n  \"magic-html\": {\n    configs: {\n      type: string;\n      multiple: boolean;\n      description: string;\n      negatedDescription: string;\n      path: string;\n    }[];\n    description: string;\n    simpleType: string;\n    multiple: boolean;\n  };\n  open: {\n    configs: (\n      | {\n          type: string;\n          multiple: boolean;\n          description: string;\n          path: string;\n          negatedDescription?: undefined;\n        }\n      | {\n          type: string;\n          multiple: boolean;\n          description: string;\n          negatedDescription: string;\n          path: string;\n        }\n    )[];\n    description: string;\n    simpleType: string;\n    multiple: boolean;\n  };\n  \"open-app\": {\n    configs: {\n      type: string;\n      multiple: boolean;\n      description: string;\n      path: string;\n    }[];\n    description: string;\n    simpleType: string;\n    multiple: boolean;\n  };\n  \"open-app-name\": {\n    configs: {\n      type: string;\n      multiple: boolean;\n      description: string;\n      path: string;\n    }[];\n    description: string;\n    simpleType: string;\n    multiple: boolean;\n  };\n  \"open-app-name-reset\": {\n    configs: {\n      type: string;\n      multiple: boolean;\n      description: string;\n      path: string;\n    }[];\n    description: string;\n    simpleType: string;\n    multiple: boolean;\n  };\n  \"open-reset\": {\n    configs: {\n      type: string;\n      multiple: boolean;\n      description: string;\n      path: string;\n    }[];\n    description: string;\n    simpleType: string;\n    multiple: boolean;\n  };\n  \"open-target\": {\n    configs: {\n      type: string;\n      multiple: boolean;\n      description: string;\n      path: string;\n    }[];\n    description: string;\n    simpleType: string;\n    multiple: boolean;\n  };\n  \"open-target-reset\": {\n    configs: {\n      type: string;\n      multiple: boolean;\n      description: string;\n      path: string;\n    }[];\n    description: string;\n    simpleType: string;\n    multiple: boolean;\n  };\n  port: {\n    configs: (\n      | {\n          type: string;\n          multiple: boolean;\n          description: string;\n          path: string;\n          values?: undefined;\n        }\n      | {\n          type: string;\n          values: string[];\n          multiple: boolean;\n          description: string;\n          path: string;\n        }\n    )[];\n    description: string;\n    simpleType: string;\n    multiple: boolean;\n  };\n  \"server-options-ca\": {\n    configs: {\n      description: string;\n      multiple: boolean;\n      path: string;\n      type: string;\n    }[];\n    description: string;\n    multiple: boolean;\n    simpleType: string;\n  };\n  \"server-options-ca-reset\": {\n    configs: {\n      description: string;\n      multiple: boolean;\n      path: string;\n      type: string;\n    }[];\n    description: string;\n    multiple: boolean;\n    simpleType: string;\n  };\n  \"server-options-cacert\": {\n    configs: {\n      description: string;\n      multiple: boolean;\n      path: string;\n      type: string;\n    }[];\n    description: string;\n    multiple: boolean;\n    simpleType: string;\n  };\n  \"server-options-cacert-reset\": {\n    configs: {\n      description: string;\n      multiple: boolean;\n      path: string;\n      type: string;\n    }[];\n    description: string;\n    multiple: boolean;\n    simpleType: string;\n  };\n  \"server-options-cert\": {\n    configs: {\n      description: string;\n      multiple: boolean;\n      path: string;\n      type: string;\n    }[];\n    description: string;\n    multiple: boolean;\n    simpleType: string;\n  };\n  \"server-options-cert-reset\": {\n    configs: {\n      description: string;\n      multiple: boolean;\n      path: string;\n      type: string;\n    }[];\n    description: string;\n    multiple: boolean;\n    simpleType: string;\n  };\n  \"server-options-crl\": {\n    configs: {\n      description: string;\n      multiple: boolean;\n      path: string;\n      type: string;\n    }[];\n    description: string;\n    multiple: boolean;\n    simpleType: string;\n  };\n  \"server-options-crl-reset\": {\n    configs: {\n      description: string;\n      multiple: boolean;\n      path: string;\n      type: string;\n    }[];\n    description: string;\n    multiple: boolean;\n    simpleType: string;\n  };\n  \"server-options-key\": {\n    configs: {\n      description: string;\n      multiple: boolean;\n      path: string;\n      type: string;\n    }[];\n    description: string;\n    multiple: boolean;\n    simpleType: string;\n  };\n  \"server-options-key-reset\": {\n    configs: {\n      description: string;\n      multiple: boolean;\n      path: string;\n      type: string;\n    }[];\n    description: string;\n    multiple: boolean;\n    simpleType: string;\n  };\n  \"server-options-passphrase\": {\n    configs: {\n      description: string;\n      multiple: boolean;\n      path: string;\n      type: string;\n    }[];\n    description: string;\n    multiple: boolean;\n    simpleType: string;\n  };\n  \"server-options-pfx\": {\n    configs: {\n      description: string;\n      multiple: boolean;\n      path: string;\n      type: string;\n    }[];\n    description: string;\n    multiple: boolean;\n    simpleType: string;\n  };\n  \"server-options-pfx-reset\": {\n    configs: {\n      description: string;\n      multiple: boolean;\n      path: string;\n      type: string;\n    }[];\n    description: string;\n    multiple: boolean;\n    simpleType: string;\n  };\n  \"server-options-request-cert\": {\n    configs: {\n      description: string;\n      negatedDescription: string;\n      multiple: boolean;\n      path: string;\n      type: string;\n    }[];\n    description: string;\n    multiple: boolean;\n    simpleType: string;\n  };\n  \"server-type\": {\n    configs: {\n      description: string;\n      multiple: boolean;\n      path: string;\n      type: string;\n      values: string[];\n    }[];\n    description: string;\n    multiple: boolean;\n    simpleType: string;\n  };\n  static: {\n    configs: (\n      | {\n          type: string;\n          multiple: boolean;\n          description: string;\n          path: string;\n          negatedDescription?: undefined;\n        }\n      | {\n          type: string;\n          multiple: boolean;\n          description: string;\n          negatedDescription: string;\n          path: string;\n        }\n    )[];\n    description: string;\n    simpleType: string;\n    multiple: boolean;\n  };\n  \"static-directory\": {\n    configs: {\n      type: string;\n      multiple: boolean;\n      description: string;\n      path: string;\n    }[];\n    description: string;\n    simpleType: string;\n    multiple: boolean;\n  };\n  \"static-public-path\": {\n    configs: {\n      type: string;\n      multiple: boolean;\n      description: string;\n      path: string;\n    }[];\n    description: string;\n    simpleType: string;\n    multiple: boolean;\n  };\n  \"static-public-path-reset\": {\n    configs: {\n      type: string;\n      multiple: boolean;\n      description: string;\n      path: string;\n    }[];\n    description: string;\n    simpleType: string;\n    multiple: boolean;\n  };\n  \"static-reset\": {\n    configs: {\n      type: string;\n      multiple: boolean;\n      description: string;\n      path: string;\n    }[];\n    description: string;\n    simpleType: string;\n    multiple: boolean;\n  };\n  \"static-serve-index\": {\n    configs: {\n      type: string;\n      multiple: boolean;\n      description: string;\n      negatedDescription: string;\n      path: string;\n    }[];\n    description: string;\n    simpleType: string;\n    multiple: boolean;\n  };\n  \"static-watch\": {\n    configs: {\n      type: string;\n      multiple: boolean;\n      description: string;\n      negatedDescription: string;\n      path: string;\n    }[];\n    description: string;\n    simpleType: string;\n    multiple: boolean;\n  };\n  \"watch-files\": {\n    configs: {\n      type: string;\n      multiple: boolean;\n      description: string;\n      path: string;\n    }[];\n    description: string;\n    simpleType: string;\n    multiple: boolean;\n  };\n  \"watch-files-reset\": {\n    configs: {\n      type: string;\n      multiple: boolean;\n      description: string;\n      path: string;\n    }[];\n    description: string;\n    simpleType: string;\n    multiple: boolean;\n  };\n  \"web-socket-server\": {\n    configs: (\n      | {\n          description: string;\n          negatedDescription: string;\n          multiple: boolean;\n          path: string;\n          type: string;\n          values: boolean[];\n        }\n      | {\n          description: string;\n          multiple: boolean;\n          path: string;\n          type: string;\n          values: string[];\n          negatedDescription?: undefined;\n        }\n      | {\n          description: string;\n          multiple: boolean;\n          path: string;\n          type: string;\n          negatedDescription?: undefined;\n          values?: undefined;\n        }\n    )[];\n    description: string;\n    simpleType: string;\n    multiple: boolean;\n  };\n  \"web-socket-server-type\": {\n    configs: (\n      | {\n          description: string;\n          multiple: boolean;\n          path: string;\n          type: string;\n          values: string[];\n        }\n      | {\n          description: string;\n          multiple: boolean;\n          path: string;\n          type: string;\n          values?: undefined;\n        }\n    )[];\n    description: string;\n    simpleType: string;\n    multiple: boolean;\n  };\n};\nexport = _exports;\n"
  },
  {
    "path": "types/bin/webpack-dev-server.d.ts",
    "content": "#!/usr/bin/env node\nexport type CliOption = {\n  /**\n   * display name\n   */\n  name: string;\n  /**\n   * npm package name\n   */\n  package: string;\n  /**\n   * name of the executable file\n   */\n  binName: string;\n  /**\n   * currently installed?\n   */\n  installed: boolean;\n  /**\n   * homepage\n   */\n  url: string;\n  /**\n   * preprocessor\n   */\n  preprocess: () => void;\n};\n"
  },
  {
    "path": "types/lib/Server.d.ts",
    "content": "export = Server;\n/**\n * @typedef {object} BasicApplication\n * @property {typeof useFn} use\n */\n/**\n * @template {BasicApplication} [A=ExpressApplication]\n * @template {BasicServer} [S=HTTPServer]\n */\ndeclare class Server<\n  A extends BasicApplication = import(\"express\").Application,\n  S extends BasicServer = import(\"http\").Server<\n    typeof import(\"http\").IncomingMessage,\n    typeof import(\"http\").ServerResponse\n  >,\n> {\n  static get schema(): {\n    title: string;\n    type: string;\n    definitions: {\n      App: {\n        instanceof: string;\n        description: string;\n        link: string;\n      };\n      AllowedHosts: {\n        anyOf: (\n          | {\n              type: string;\n              minItems: number;\n              items: {\n                $ref: string;\n              };\n              enum?: undefined;\n              $ref?: undefined;\n            }\n          | {\n              enum: string[];\n              type?: undefined;\n              minItems?: undefined;\n              items?: undefined;\n              $ref?: undefined;\n            }\n          | {\n              $ref: string;\n              type?: undefined;\n              minItems?: undefined;\n              items?: undefined;\n              enum?: undefined;\n            }\n        )[];\n        description: string;\n        link: string;\n      };\n      AllowedHostsItem: {\n        type: string;\n        minLength: number;\n      };\n      Bonjour: {\n        anyOf: (\n          | {\n              type: string;\n              cli: {\n                negatedDescription: string;\n              };\n              description?: undefined;\n              link?: undefined;\n            }\n          | {\n              type: string;\n              description: string;\n              link: string;\n              cli?: undefined;\n            }\n        )[];\n        description: string;\n        link: string;\n      };\n      Client: {\n        description: string;\n        link: string;\n        anyOf: (\n          | {\n              enum: boolean[];\n              cli: {\n                negatedDescription: string;\n              };\n              type?: undefined;\n              additionalProperties?: undefined;\n              properties?: undefined;\n            }\n          | {\n              type: string;\n              additionalProperties: boolean;\n              properties: {\n                logging: {\n                  $ref: string;\n                };\n                overlay: {\n                  $ref: string;\n                };\n                progress: {\n                  $ref: string;\n                };\n                reconnect: {\n                  $ref: string;\n                };\n                webSocketTransport: {\n                  $ref: string;\n                };\n                webSocketURL: {\n                  $ref: string;\n                };\n              };\n              enum?: undefined;\n              cli?: undefined;\n            }\n        )[];\n      };\n      ClientLogging: {\n        enum: string[];\n        description: string;\n        link: string;\n      };\n      ClientOverlay: {\n        anyOf: (\n          | {\n              description: string;\n              link: string;\n              type: string;\n              cli: {\n                negatedDescription: string;\n              };\n              additionalProperties?: undefined;\n              properties?: undefined;\n            }\n          | {\n              type: string;\n              additionalProperties: boolean;\n              properties: {\n                errors: {\n                  anyOf: (\n                    | {\n                        description: string;\n                        type: string;\n                        cli: {\n                          negatedDescription: string;\n                        };\n                        instanceof?: undefined;\n                      }\n                    | {\n                        instanceof: string;\n                        description: string;\n                        type?: undefined;\n                        cli?: undefined;\n                      }\n                  )[];\n                };\n                warnings: {\n                  anyOf: (\n                    | {\n                        description: string;\n                        type: string;\n                        cli: {\n                          negatedDescription: string;\n                        };\n                        instanceof?: undefined;\n                      }\n                    | {\n                        instanceof: string;\n                        description: string;\n                        type?: undefined;\n                        cli?: undefined;\n                      }\n                  )[];\n                };\n                runtimeErrors: {\n                  anyOf: (\n                    | {\n                        description: string;\n                        type: string;\n                        cli: {\n                          negatedDescription: string;\n                        };\n                        instanceof?: undefined;\n                      }\n                    | {\n                        instanceof: string;\n                        description: string;\n                        type?: undefined;\n                        cli?: undefined;\n                      }\n                  )[];\n                };\n                trustedTypesPolicyName: {\n                  description: string;\n                  type: string;\n                };\n              };\n              description?: undefined;\n              link?: undefined;\n              cli?: undefined;\n            }\n        )[];\n      };\n      ClientProgress: {\n        description: string;\n        link: string;\n        type: string[];\n        enum: (string | boolean)[];\n        cli: {\n          negatedDescription: string;\n        };\n      };\n      ClientReconnect: {\n        description: string;\n        link: string;\n        anyOf: (\n          | {\n              type: string;\n              cli: {\n                negatedDescription: string;\n              };\n              minimum?: undefined;\n            }\n          | {\n              type: string;\n              minimum: number;\n              cli?: undefined;\n            }\n        )[];\n      };\n      ClientWebSocketTransport: {\n        anyOf: {\n          $ref: string;\n        }[];\n        description: string;\n        link: string;\n      };\n      ClientWebSocketTransportEnum: {\n        enum: string[];\n      };\n      ClientWebSocketTransportString: {\n        type: string;\n        minLength: number;\n      };\n      ClientWebSocketURL: {\n        description: string;\n        link: string;\n        anyOf: (\n          | {\n              type: string;\n              minLength: number;\n              additionalProperties?: undefined;\n              properties?: undefined;\n            }\n          | {\n              type: string;\n              additionalProperties: boolean;\n              properties: {\n                hostname: {\n                  description: string;\n                  type: string;\n                  minLength: number;\n                };\n                pathname: {\n                  description: string;\n                  type: string;\n                };\n                password: {\n                  description: string;\n                  type: string;\n                };\n                port: {\n                  description: string;\n                  anyOf: (\n                    | {\n                        type: string;\n                        minLength?: undefined;\n                      }\n                    | {\n                        type: string;\n                        minLength: number;\n                      }\n                  )[];\n                };\n                protocol: {\n                  description: string;\n                  anyOf: (\n                    | {\n                        enum: string[];\n                        type?: undefined;\n                        minLength?: undefined;\n                      }\n                    | {\n                        type: string;\n                        minLength: number;\n                        enum?: undefined;\n                      }\n                  )[];\n                };\n                username: {\n                  description: string;\n                  type: string;\n                };\n              };\n              minLength?: undefined;\n            }\n        )[];\n      };\n      Compress: {\n        type: string;\n        description: string;\n        link: string;\n        cli: {\n          negatedDescription: string;\n        };\n      };\n      DevMiddleware: {\n        description: string;\n        link: string;\n        type: string;\n        additionalProperties: boolean;\n      };\n      HeaderObject: {\n        type: string;\n        additionalProperties: boolean;\n        properties: {\n          key: {\n            description: string;\n            type: string;\n          };\n          value: {\n            description: string;\n            type: string;\n          };\n        };\n        cli: {\n          exclude: boolean;\n        };\n      };\n      Headers: {\n        anyOf: (\n          | {\n              type: string;\n              items: {\n                $ref: string;\n              };\n              minItems: number;\n              instanceof?: undefined;\n            }\n          | {\n              type: string;\n              items?: undefined;\n              minItems?: undefined;\n              instanceof?: undefined;\n            }\n          | {\n              instanceof: string;\n              type?: undefined;\n              items?: undefined;\n              minItems?: undefined;\n            }\n        )[];\n        description: string;\n        link: string;\n      };\n      HistoryApiFallback: {\n        anyOf: (\n          | {\n              type: string;\n              cli: {\n                negatedDescription: string;\n              };\n              description?: undefined;\n              link?: undefined;\n            }\n          | {\n              type: string;\n              description: string;\n              link: string;\n              cli?: undefined;\n            }\n        )[];\n        description: string;\n        link: string;\n      };\n      Host: {\n        description: string;\n        link: string;\n        anyOf: (\n          | {\n              enum: string[];\n              type?: undefined;\n              minLength?: undefined;\n            }\n          | {\n              type: string;\n              minLength: number;\n              enum?: undefined;\n            }\n        )[];\n      };\n      Hot: {\n        anyOf: (\n          | {\n              type: string;\n              cli: {\n                negatedDescription: string;\n              };\n              enum?: undefined;\n            }\n          | {\n              enum: string[];\n              type?: undefined;\n              cli?: undefined;\n            }\n        )[];\n        description: string;\n        link: string;\n      };\n      IPC: {\n        anyOf: (\n          | {\n              type: string;\n              minLength: number;\n              enum?: undefined;\n            }\n          | {\n              type: string;\n              enum: boolean[];\n              minLength?: undefined;\n            }\n        )[];\n        description: string;\n        link: string;\n      };\n      LiveReload: {\n        type: string;\n        description: string;\n        cli: {\n          negatedDescription: string;\n        };\n        link: string;\n      };\n      OnListening: {\n        instanceof: string;\n        description: string;\n        link: string;\n      };\n      Open: {\n        anyOf: (\n          | {\n              type: string;\n              items: {\n                anyOf: {\n                  $ref: string;\n                }[];\n              };\n              $ref?: undefined;\n            }\n          | {\n              $ref: string;\n              type?: undefined;\n              items?: undefined;\n            }\n        )[];\n        description: string;\n        link: string;\n      };\n      OpenBoolean: {\n        type: string;\n        cli: {\n          negatedDescription: string;\n        };\n      };\n      OpenObject: {\n        type: string;\n        additionalProperties: boolean;\n        properties: {\n          target: {\n            anyOf: (\n              | {\n                  type: string;\n                  items: {\n                    type: string;\n                  };\n                }\n              | {\n                  type: string;\n                  items?: undefined;\n                }\n            )[];\n            description: string;\n          };\n          app: {\n            anyOf: (\n              | {\n                  type: string;\n                  additionalProperties: boolean;\n                  properties: {\n                    name: {\n                      anyOf: (\n                        | {\n                            type: string;\n                            items: {\n                              type: string;\n                              minLength: number;\n                            };\n                            minItems: number;\n                            minLength?: undefined;\n                          }\n                        | {\n                            type: string;\n                            minLength: number;\n                            items?: undefined;\n                            minItems?: undefined;\n                          }\n                      )[];\n                    };\n                    arguments: {\n                      items: {\n                        type: string;\n                        minLength: number;\n                      };\n                    };\n                  };\n                  minLength?: undefined;\n                  description?: undefined;\n                  cli?: undefined;\n                }\n              | {\n                  type: string;\n                  minLength: number;\n                  description: string;\n                  cli: {\n                    exclude: boolean;\n                  };\n                  additionalProperties?: undefined;\n                  properties?: undefined;\n                }\n            )[];\n            description: string;\n          };\n        };\n      };\n      OpenString: {\n        type: string;\n        minLength: number;\n      };\n      Port: {\n        anyOf: (\n          | {\n              type: string;\n              minimum: number;\n              maximum: number;\n              minLength?: undefined;\n              enum?: undefined;\n            }\n          | {\n              type: string;\n              minLength: number;\n              minimum?: undefined;\n              maximum?: undefined;\n              enum?: undefined;\n            }\n          | {\n              enum: string[];\n              type?: undefined;\n              minimum?: undefined;\n              maximum?: undefined;\n              minLength?: undefined;\n            }\n        )[];\n        description: string;\n        link: string;\n      };\n      Proxy: {\n        type: string;\n        items: {\n          anyOf: (\n            | {\n                type: string;\n                instanceof?: undefined;\n              }\n            | {\n                instanceof: string;\n                type?: undefined;\n              }\n          )[];\n        };\n        description: string;\n        link: string;\n      };\n      Server: {\n        anyOf: {\n          $ref: string;\n        }[];\n        link: string;\n        description: string;\n      };\n      ServerType: {\n        enum: string[];\n      };\n      ServerFn: {\n        instanceof: string;\n      };\n      ServerEnum: {\n        enum: string[];\n        cli: {\n          exclude: boolean;\n        };\n      };\n      ServerString: {\n        type: string;\n        minLength: number;\n        cli: {\n          exclude: boolean;\n        };\n      };\n      ServerObject: {\n        type: string;\n        properties: {\n          type: {\n            anyOf: {\n              $ref: string;\n            }[];\n          };\n          options: {\n            $ref: string;\n          };\n        };\n        additionalProperties: boolean;\n      };\n      ServerOptions: {\n        type: string;\n        additionalProperties: boolean;\n        properties: {\n          passphrase: {\n            type: string;\n            description: string;\n          };\n          requestCert: {\n            type: string;\n            description: string;\n            cli: {\n              negatedDescription: string;\n            };\n          };\n          ca: {\n            anyOf: (\n              | {\n                  type: string;\n                  items: {\n                    anyOf: (\n                      | {\n                          type: string;\n                          instanceof?: undefined;\n                        }\n                      | {\n                          instanceof: string;\n                          type?: undefined;\n                        }\n                    )[];\n                  };\n                  instanceof?: undefined;\n                }\n              | {\n                  type: string;\n                  items?: undefined;\n                  instanceof?: undefined;\n                }\n              | {\n                  instanceof: string;\n                  type?: undefined;\n                  items?: undefined;\n                }\n            )[];\n            description: string;\n          };\n          cert: {\n            anyOf: (\n              | {\n                  type: string;\n                  items: {\n                    anyOf: (\n                      | {\n                          type: string;\n                          instanceof?: undefined;\n                        }\n                      | {\n                          instanceof: string;\n                          type?: undefined;\n                        }\n                    )[];\n                  };\n                  instanceof?: undefined;\n                }\n              | {\n                  type: string;\n                  items?: undefined;\n                  instanceof?: undefined;\n                }\n              | {\n                  instanceof: string;\n                  type?: undefined;\n                  items?: undefined;\n                }\n            )[];\n            description: string;\n          };\n          crl: {\n            anyOf: (\n              | {\n                  type: string;\n                  items: {\n                    anyOf: (\n                      | {\n                          type: string;\n                          instanceof?: undefined;\n                        }\n                      | {\n                          instanceof: string;\n                          type?: undefined;\n                        }\n                    )[];\n                  };\n                  instanceof?: undefined;\n                }\n              | {\n                  type: string;\n                  items?: undefined;\n                  instanceof?: undefined;\n                }\n              | {\n                  instanceof: string;\n                  type?: undefined;\n                  items?: undefined;\n                }\n            )[];\n            description: string;\n          };\n          key: {\n            anyOf: (\n              | {\n                  type: string;\n                  items: {\n                    anyOf: (\n                      | {\n                          type: string;\n                          instanceof?: undefined;\n                          additionalProperties?: undefined;\n                        }\n                      | {\n                          instanceof: string;\n                          type?: undefined;\n                          additionalProperties?: undefined;\n                        }\n                      | {\n                          type: string;\n                          additionalProperties: boolean;\n                          instanceof?: undefined;\n                        }\n                    )[];\n                  };\n                  instanceof?: undefined;\n                }\n              | {\n                  type: string;\n                  items?: undefined;\n                  instanceof?: undefined;\n                }\n              | {\n                  instanceof: string;\n                  type?: undefined;\n                  items?: undefined;\n                }\n            )[];\n            description: string;\n          };\n          pfx: {\n            anyOf: (\n              | {\n                  type: string;\n                  items: {\n                    anyOf: (\n                      | {\n                          type: string;\n                          instanceof?: undefined;\n                          additionalProperties?: undefined;\n                        }\n                      | {\n                          instanceof: string;\n                          type?: undefined;\n                          additionalProperties?: undefined;\n                        }\n                      | {\n                          type: string;\n                          additionalProperties: boolean;\n                          instanceof?: undefined;\n                        }\n                    )[];\n                  };\n                  instanceof?: undefined;\n                }\n              | {\n                  type: string;\n                  items?: undefined;\n                  instanceof?: undefined;\n                }\n              | {\n                  instanceof: string;\n                  type?: undefined;\n                  items?: undefined;\n                }\n            )[];\n            description: string;\n          };\n        };\n      };\n      SetupExitSignals: {\n        type: string;\n        description: string;\n        link: string;\n        cli: {\n          exclude: boolean;\n        };\n      };\n      SetupMiddlewares: {\n        instanceof: string;\n        description: string;\n        link: string;\n      };\n      Static: {\n        anyOf: (\n          | {\n              type: string;\n              items: {\n                anyOf: {\n                  $ref: string;\n                }[];\n              };\n              cli?: undefined;\n              $ref?: undefined;\n            }\n          | {\n              type: string;\n              cli: {\n                negatedDescription: string;\n              };\n              items?: undefined;\n              $ref?: undefined;\n            }\n          | {\n              $ref: string;\n              type?: undefined;\n              items?: undefined;\n              cli?: undefined;\n            }\n        )[];\n        description: string;\n        link: string;\n      };\n      StaticObject: {\n        type: string;\n        additionalProperties: boolean;\n        properties: {\n          directory: {\n            type: string;\n            minLength: number;\n            description: string;\n            link: string;\n          };\n          staticOptions: {\n            type: string;\n            link: string;\n            additionalProperties: boolean;\n          };\n          publicPath: {\n            anyOf: (\n              | {\n                  type: string;\n                  items: {\n                    type: string;\n                  };\n                  minItems: number;\n                }\n              | {\n                  type: string;\n                  items?: undefined;\n                  minItems?: undefined;\n                }\n            )[];\n            description: string;\n            link: string;\n          };\n          serveIndex: {\n            anyOf: (\n              | {\n                  type: string;\n                  cli: {\n                    negatedDescription: string;\n                  };\n                  additionalProperties?: undefined;\n                }\n              | {\n                  type: string;\n                  additionalProperties: boolean;\n                  cli?: undefined;\n                }\n            )[];\n            description: string;\n            link: string;\n          };\n          watch: {\n            anyOf: (\n              | {\n                  type: string;\n                  cli: {\n                    negatedDescription: string;\n                  };\n                  description?: undefined;\n                  link?: undefined;\n                }\n              | {\n                  type: string;\n                  description: string;\n                  link: string;\n                  cli?: undefined;\n                }\n            )[];\n            description: string;\n            link: string;\n          };\n        };\n      };\n      StaticString: {\n        type: string;\n        minLength: number;\n      };\n      WatchFiles: {\n        anyOf: (\n          | {\n              type: string;\n              items: {\n                anyOf: {\n                  $ref: string;\n                }[];\n              };\n              $ref?: undefined;\n            }\n          | {\n              $ref: string;\n              type?: undefined;\n              items?: undefined;\n            }\n        )[];\n        description: string;\n        link: string;\n      };\n      WatchFilesObject: {\n        cli: {\n          exclude: boolean;\n        };\n        type: string;\n        properties: {\n          paths: {\n            anyOf: (\n              | {\n                  type: string;\n                  items: {\n                    type: string;\n                    minLength: number;\n                  };\n                  minLength?: undefined;\n                }\n              | {\n                  type: string;\n                  minLength: number;\n                  items?: undefined;\n                }\n            )[];\n            description: string;\n          };\n          options: {\n            type: string;\n            description: string;\n            link: string;\n            additionalProperties: boolean;\n          };\n        };\n        additionalProperties: boolean;\n      };\n      WatchFilesString: {\n        type: string;\n        minLength: number;\n      };\n      WebSocketServer: {\n        anyOf: {\n          $ref: string;\n        }[];\n        description: string;\n        link: string;\n      };\n      WebSocketServerType: {\n        enum: string[];\n      };\n      WebSocketServerEnum: {\n        anyOf: (\n          | {\n              enum: boolean[];\n              cli: {\n                negatedDescription: string;\n                exclude?: undefined;\n              };\n            }\n          | {\n              enum: string[];\n              cli: {\n                exclude: boolean;\n                negatedDescription?: undefined;\n              };\n            }\n        )[];\n      };\n      WebSocketServerFunction: {\n        instanceof: string;\n      };\n      WebSocketServerObject: {\n        type: string;\n        properties: {\n          type: {\n            anyOf: {\n              $ref: string;\n            }[];\n          };\n          options: {\n            type: string;\n            additionalProperties: boolean;\n            cli: {\n              exclude: boolean;\n            };\n          };\n        };\n        additionalProperties: boolean;\n      };\n      WebSocketServerString: {\n        type: string;\n        minLength: number;\n        cli: {\n          exclude: boolean;\n        };\n      };\n    };\n    additionalProperties: boolean;\n    properties: {\n      allowedHosts: {\n        $ref: string;\n      };\n      bonjour: {\n        $ref: string;\n      };\n      client: {\n        $ref: string;\n      };\n      compress: {\n        $ref: string;\n      };\n      devMiddleware: {\n        $ref: string;\n      };\n      headers: {\n        $ref: string;\n      };\n      historyApiFallback: {\n        $ref: string;\n      };\n      host: {\n        $ref: string;\n      };\n      hot: {\n        $ref: string;\n      };\n      ipc: {\n        $ref: string;\n      };\n      liveReload: {\n        $ref: string;\n      };\n      onListening: {\n        $ref: string;\n      };\n      open: {\n        $ref: string;\n      };\n      port: {\n        $ref: string;\n      };\n      proxy: {\n        $ref: string;\n      };\n      server: {\n        $ref: string;\n      };\n      app: {\n        $ref: string;\n      };\n      setupExitSignals: {\n        $ref: string;\n      };\n      setupMiddlewares: {\n        $ref: string;\n      };\n      static: {\n        $ref: string;\n      };\n      watchFiles: {\n        $ref: string;\n      };\n      webSocketServer: {\n        $ref: string;\n      };\n    };\n  };\n  /**\n   * @private\n   * @returns {StatsOptions} default stats options\n   */\n  private static get DEFAULT_STATS();\n  /**\n   * @param {string} URL url\n   * @returns {boolean} true when URL is absolute, otherwise false\n   */\n  static isAbsoluteURL(URL: string): boolean;\n  /**\n   * @param {string} gatewayOrFamily gateway or family\n   * @param {boolean=} isInternal ip should be internal\n   * @returns {string | undefined} resolved IP\n   */\n  static findIp(\n    gatewayOrFamily: string,\n    isInternal?: boolean | undefined,\n  ): string | undefined;\n  /**\n   * @param {\"v4\" | \"v6\"} family family\n   * @returns {Promise<string | undefined>} internal API\n   */\n  static internalIP(family: \"v4\" | \"v6\"): Promise<string | undefined>;\n  /**\n   * @param {\"v4\" | \"v6\"} family family\n   * @returns {string | undefined} internal IP\n   */\n  static internalIPSync(family: \"v4\" | \"v6\"): string | undefined;\n  /**\n   * @param {Host} hostname hostname\n   * @returns {Promise<string>} resolved hostname\n   */\n  static getHostname(hostname: Host): Promise<string>;\n  /**\n   * @param {Port} port port\n   * @param {string} host host\n   * @returns {Promise<number | string>} free port\n   */\n  static getFreePort(port: Port, host: string): Promise<number | string>;\n  /**\n   * @returns {string} path to cache dir\n   */\n  static findCacheDir(): string;\n  /**\n   * @private\n   * @param {Compiler} compiler compiler\n   * @returns {boolean} true when target is `web`, otherwise false\n   */\n  private static isWebTarget;\n  /**\n   * @param {Configuration<A, S>} options options\n   * @param {Compiler | MultiCompiler} compiler compiler\n   */\n  constructor(options: Configuration<A, S>, compiler: Compiler | MultiCompiler);\n  compiler: import(\"webpack\").Compiler | import(\"webpack\").MultiCompiler;\n  /**\n   * @type {ReturnType<Compiler[\"getInfrastructureLogger\"]>}\n   */\n  logger: ReturnType<Compiler[\"getInfrastructureLogger\"]>;\n  options: Configuration<A, S>;\n  /**\n   * @type {FSWatcher[]}\n   */\n  staticWatchers: FSWatcher[];\n  /**\n   * @private\n   * @type {{ name: string | symbol, listener: (...args: EXPECTED_ANY[]) => void}[] }}\n   */\n  private listeners;\n  /**\n   * @private\n   * @type {RequestHandler[]}\n   */\n  private webSocketProxies;\n  /**\n   * @type {Socket[]}\n   */\n  sockets: Socket[];\n  /**\n   * @private\n   * @type {string | undefined}\n   */\n  private currentHash;\n  /**\n   * @private\n   * @param {Compiler} compiler compiler\n   */\n  private addAdditionalEntries;\n  /**\n   * @private\n   * @returns {Compiler[\"options\"]} compiler options\n   */\n  private getCompilerOptions;\n  /**\n   * @private\n   * @returns {Promise<void>}\n   */\n  private normalizeOptions;\n  /**\n   * @private\n   * @returns {string} client transport\n   */\n  private getClientTransport;\n  /**\n   * @template T\n   * @private\n   * @returns {T} server transport\n   */\n  private getServerTransport;\n  /**\n   * @returns {string}\n   */\n  getClientEntry(): string;\n  /**\n   * @returns {string | void} client hot entry\n   */\n  getClientHotEntry(): string | void;\n  /**\n   * @private\n   * @returns {void}\n   */\n  private setupProgressPlugin;\n  /**\n   * @private\n   * @returns {Promise<void>}\n   */\n  private initialize;\n  /**\n   * @private\n   * @returns {Promise<void>}\n   */\n  private setupApp;\n  /** @type {A | undefined} */\n  app: A | undefined;\n  /**\n   * @private\n   * @param {Stats | MultiStats} statsObj stats\n   * @returns {StatsCompilation} stats of compilation\n   */\n  private getStats;\n  /**\n   * @private\n   * @returns {void}\n   */\n  private setupHooks;\n  /**\n   * @private\n   * @type {Stats | MultiStats}\n   */\n  private stats;\n  /**\n   * @private\n   * @returns {void}\n   */\n  private setupWatchStaticFiles;\n  /**\n   * @private\n   * @returns {void}\n   */\n  private setupWatchFiles;\n  /**\n   * @private\n   * @returns {void}\n   */\n  private setupMiddlewares;\n  /** @type {import(\"webpack-dev-middleware\").API<Request, Response>} */\n  middleware:\n    | import(\"webpack-dev-middleware\").API<\n        import(\"express\").Request<\n          import(\"express-serve-static-core\").ParamsDictionary,\n          any,\n          any,\n          qs.ParsedQs,\n          Record<string, any>\n        >,\n        import(\"express\").Response<any, Record<string, any>>\n      >\n    | undefined;\n  /**\n   * @private\n   * @returns {Promise<void>}\n   */\n  private createServer;\n  /** @type {S | undefined} */\n  server: S | undefined;\n  isTlsServer: boolean | undefined;\n  /**\n   * @private\n   * @returns {void}\n   */\n  private createWebSocketServer;\n  /** @type {WebSocketServerImplementation | undefined | null} */\n  webSocketServer: WebSocketServerImplementation | undefined | null;\n  /**\n   * @private\n   * @param {string} defaultOpenTarget default open target\n   * @returns {Promise<void>}\n   */\n  private openBrowser;\n  /**\n   * @private\n   * @returns {void}\n   */\n  private runBonjour;\n  /**\n   * @private\n   * @type {Bonjour | undefined}\n   */\n  private bonjour;\n  /**\n   * @private\n   * @param {() => void} callback callback\n   * @returns {void}\n   */\n  private stopBonjour;\n  /**\n   * @private\n   * @returns {Promise<void>}\n   */\n  private logStatus;\n  /**\n   * @private\n   * @param {Request} req request\n   * @param {Response} res response\n   * @param {NextFunction} next next function\n   */\n  private setHeaders;\n  /**\n   * @private\n   * @param {string} value value\n   * @returns {boolean} true when host allowed, otherwise false\n   */\n  private isHostAllowed;\n  /**\n   * @private\n   * @param {{ [key: string]: string | undefined }} headers headers\n   * @param {string} headerToCheck header to check\n   * @param {boolean} validateHost need to validate host\n   * @returns {boolean} true when host is valid, otherwise false\n   */\n  private isValidHost;\n  /**\n   * @private\n   * @param {{ [key: string]: string | undefined }} headers headers\n   * @returns {boolean} true when is same origin, otherwise false\n   */\n  private isSameOrigin;\n  /**\n   * @param {ClientConnection[]} clients clients\n   * @param {string} type type\n   * @param {EXPECTED_ANY=} data data\n   * @param {EXPECTED_ANY=} params params\n   */\n  sendMessage(\n    clients: ClientConnection[],\n    type: string,\n    data?: EXPECTED_ANY | undefined,\n    params?: EXPECTED_ANY | undefined,\n  ): void;\n  /**\n   * @private\n   * @param {ClientConnection[]} clients clients\n   * @param {StatsCompilation} stats stats\n   * @param {boolean=} force force\n   */\n  private sendStats;\n  /**\n   * @param {string | string[]} watchPath watch path\n   * @param {WatchOptions=} watchOptions watch options\n   */\n  watchFiles(\n    watchPath: string | string[],\n    watchOptions?: WatchOptions | undefined,\n  ): void;\n  /**\n   * @param {import(\"webpack-dev-middleware\").Callback=} callback callback\n   */\n  invalidate(\n    callback?: import(\"webpack-dev-middleware\").Callback | undefined,\n  ): void;\n  /**\n   * @returns {Promise<void>}\n   */\n  start(): Promise<void>;\n  /**\n   * @param {((err?: Error) => void)=} callback callback\n   */\n  startCallback(callback?: ((err?: Error) => void) | undefined): void;\n  /**\n   * @returns {Promise<void>}\n   */\n  stop(): Promise<void>;\n  /**\n   * @param {((err?: Error) => void)=} callback callback\n   */\n  stopCallback(callback?: ((err?: Error) => void) | undefined): void;\n}\ndeclare namespace Server {\n  export {\n    Schema,\n    Compiler,\n    MultiCompiler,\n    WebpackConfiguration,\n    StatsOptions,\n    StatsCompilation,\n    Stats,\n    MultiStats,\n    NetworkInterfaceInfo,\n    WatchOptions,\n    FSWatcher,\n    ConnectHistoryApiFallbackOptions,\n    Bonjour,\n    BonjourOptions,\n    RequestHandler,\n    HttpProxyMiddlewareOptions,\n    HttpProxyMiddlewareOptionsFilter,\n    ServeIndexOptions,\n    ServeStaticOptions,\n    IPv4,\n    IPv6,\n    Socket,\n    HTTPServer,\n    IncomingMessage,\n    ServerResponse,\n    OpenOptions,\n    ExpressApplication,\n    ExpressRequestHandler,\n    ExpressErrorRequestHandler,\n    ExpressRequest,\n    ExpressResponse,\n    EXPECTED_ANY,\n    NextFunction,\n    SimpleHandleFunction,\n    NextHandleFunction,\n    ErrorHandleFunction,\n    HandleFunction,\n    ServerOptions,\n    Request,\n    Response,\n    DevMiddlewareOptions,\n    DevMiddlewareContext,\n    Host,\n    Port,\n    WatchFiles,\n    Static,\n    NormalizedStatic,\n    ServerType,\n    ServerConfiguration,\n    WebSocketServerConfiguration,\n    ClientConnection,\n    WebSocketServer,\n    WebSocketServerImplementation,\n    ByPass,\n    ProxyConfigArrayItem,\n    ProxyConfigArray,\n    OpenApp,\n    Open,\n    NormalizedOpen,\n    WebSocketURL,\n    OverlayMessageOptions,\n    ClientConfiguration,\n    Headers,\n    MiddlewareHandler,\n    MiddlewareObject,\n    Middleware,\n    BasicServer,\n    Configuration,\n    FunctionReturning,\n    BasicApplication,\n  };\n}\ntype Schema = import(\"schema-utils/declarations/validate\").Schema;\ntype Compiler = import(\"webpack\").Compiler;\ntype MultiCompiler = import(\"webpack\").MultiCompiler;\ntype WebpackConfiguration = import(\"webpack\").Configuration;\ntype StatsOptions = import(\"webpack\").StatsOptions;\ntype StatsCompilation = import(\"webpack\").StatsCompilation;\ntype Stats = import(\"webpack\").Stats;\ntype MultiStats = import(\"webpack\").MultiStats;\ntype NetworkInterfaceInfo = import(\"os\").NetworkInterfaceInfo;\ntype WatchOptions = import(\"chokidar\").WatchOptions;\ntype FSWatcher = import(\"chokidar\").FSWatcher;\ntype ConnectHistoryApiFallbackOptions =\n  import(\"connect-history-api-fallback\").Options;\ntype Bonjour = import(\"bonjour-service\").Bonjour;\ntype BonjourOptions = import(\"bonjour-service\").Service;\ntype RequestHandler = import(\"http-proxy-middleware\").RequestHandler;\ntype HttpProxyMiddlewareOptions = import(\"http-proxy-middleware\").Options;\ntype HttpProxyMiddlewareOptionsFilter = import(\"http-proxy-middleware\").Filter;\ntype ServeIndexOptions = import(\"serve-index\").Options;\ntype ServeStaticOptions = import(\"serve-static\").ServeStaticOptions;\ntype IPv4 = import(\"ipaddr.js\").IPv4;\ntype IPv6 = import(\"ipaddr.js\").IPv6;\ntype Socket = import(\"net\").Socket;\ntype HTTPServer = import(\"http\").Server;\ntype IncomingMessage = import(\"http\").IncomingMessage;\ntype ServerResponse = import(\"http\").ServerResponse;\ntype OpenOptions = import(\"open\").Options;\ntype ExpressApplication = import(\"express\").Application;\ntype ExpressRequestHandler = import(\"express\").RequestHandler;\ntype ExpressErrorRequestHandler = import(\"express\").ErrorRequestHandler;\ntype ExpressRequest = import(\"express\").Request;\ntype ExpressResponse = import(\"express\").Response;\ntype EXPECTED_ANY = any;\ntype NextFunction = (err?: EXPECTED_ANY) => void;\ntype SimpleHandleFunction = (req: IncomingMessage, res: ServerResponse) => void;\ntype NextHandleFunction = (\n  req: IncomingMessage,\n  res: ServerResponse,\n  next: NextFunction,\n) => void;\ntype ErrorHandleFunction = (\n  err: EXPECTED_ANY,\n  req: IncomingMessage,\n  res: ServerResponse,\n  next: NextFunction,\n) => void;\ntype HandleFunction =\n  | SimpleHandleFunction\n  | NextHandleFunction\n  | ErrorHandleFunction;\ntype ServerOptions = import(\"https\").ServerOptions & {\n  spdy?: {\n    plain?: boolean | undefined;\n    ssl?: boolean | undefined;\n    \"x-forwarded-for\"?: string | undefined;\n    protocol?: string | undefined;\n    protocols?: string[] | undefined;\n  };\n};\ntype Request<T extends BasicApplication = import(\"express\").Application> =\n  T extends ExpressApplication ? ExpressRequest : IncomingMessage;\ntype Response<T extends BasicApplication = import(\"express\").Application> =\n  T extends ExpressApplication ? ExpressResponse : ServerResponse;\ntype DevMiddlewareOptions<\n  T extends Request,\n  U extends Response,\n> = import(\"webpack-dev-middleware\").Options<T, U>;\ntype DevMiddlewareContext<\n  T extends Request,\n  U extends Response,\n> = import(\"webpack-dev-middleware\").Context<T, U>;\ntype Host = \"local-ip\" | \"local-ipv4\" | \"local-ipv6\" | string;\ntype Port = number | string | \"auto\";\ntype WatchFiles = {\n  /**\n   * paths\n   */\n  paths: string | string[];\n  /**\n   * options\n   */\n  options?:\n    | (WatchOptions & {\n        aggregateTimeout?: number;\n        ignored?: WatchOptions[\"ignored\"];\n        poll?: number | boolean;\n      })\n    | undefined;\n};\ntype Static = {\n  /**\n   * directory\n   */\n  directory?: string | undefined;\n  /**\n   * public path\n   */\n  publicPath?: (string | string[]) | undefined;\n  /**\n   * serve index\n   */\n  serveIndex?: (boolean | ServeIndexOptions) | undefined;\n  /**\n   * static options\n   */\n  staticOptions?: ServeStaticOptions | undefined;\n  /**\n   * watch and watch options\n   */\n  watch?:\n    | (\n        | boolean\n        | (WatchOptions & {\n            aggregateTimeout?: number;\n            ignored?: WatchOptions[\"ignored\"];\n            poll?: number | boolean;\n          })\n      )\n    | undefined;\n};\ntype NormalizedStatic = {\n  directory: string;\n  publicPath: string[];\n  serveIndex: false | ServeIndexOptions;\n  staticOptions: ServeStaticOptions;\n  watch: false | WatchOptions;\n};\ntype ServerType<\n  A extends BasicApplication = import(\"express\").Application,\n  S extends BasicServer = import(\"http\").Server<\n    typeof import(\"http\").IncomingMessage,\n    typeof import(\"http\").ServerResponse\n  >,\n> =\n  | \"http\"\n  | \"https\"\n  | \"spdy\"\n  | \"http2\"\n  | string\n  | ((serverOptions: ServerOptions, application: A) => S);\ntype ServerConfiguration<\n  A extends BasicApplication = import(\"express\").Application,\n  S extends BasicServer = import(\"http\").Server<\n    typeof import(\"http\").IncomingMessage,\n    typeof import(\"http\").ServerResponse\n  >,\n> = {\n  /**\n   * type\n   */\n  type?: ServerType<A, S> | undefined;\n  /**\n   * options\n   */\n  options?: ServerOptions | undefined;\n};\ntype WebSocketServerConfiguration = {\n  /**\n   * type\n   */\n  type?:\n    | (\"sockjs\" | \"ws\" | string | (() => WebSocketServerConfiguration))\n    | undefined;\n  /**\n   * options\n   */\n  options?: Record<string, EXPECTED_ANY> | undefined;\n};\ntype ClientConnection = (\n  | import(\"ws\").WebSocket\n  | (import(\"sockjs\").Connection & {\n      send: import(\"ws\").WebSocket[\"send\"];\n      terminate: import(\"ws\").WebSocket[\"terminate\"];\n      ping: import(\"ws\").WebSocket[\"ping\"];\n    })\n) & {\n  isAlive?: boolean;\n};\ntype WebSocketServer =\n  | import(\"ws\").WebSocketServer\n  | (import(\"sockjs\").Server & {\n      close: import(\"ws\").WebSocketServer[\"close\"];\n    });\ntype WebSocketServerImplementation = {\n  implementation: WebSocketServer;\n  clients: ClientConnection[];\n};\ntype ByPass = (\n  req: Request,\n  res: Response,\n  proxyConfig: ProxyConfigArrayItem,\n) => any;\ntype ProxyConfigArrayItem = {\n  path?: HttpProxyMiddlewareOptionsFilter | undefined;\n  context?: HttpProxyMiddlewareOptionsFilter | undefined;\n} & {\n  bypass?: ByPass;\n} & HttpProxyMiddlewareOptions;\ntype ProxyConfigArray = (\n  | ProxyConfigArrayItem\n  | ((\n      req?: Request | undefined,\n      res?: Response | undefined,\n      next?: NextFunction | undefined,\n    ) => ProxyConfigArrayItem)\n)[];\ntype OpenApp = {\n  name?: string | undefined;\n  arguments?: string[] | undefined;\n};\ntype Open = {\n  app?: (string | string[] | OpenApp) | undefined;\n  /**\n   * target\n   */\n  target?: (string | string[]) | undefined;\n};\ntype NormalizedOpen = {\n  target: string;\n  options: import(\"open\").Options;\n};\ntype WebSocketURL = {\n  /**\n   * hostname\n   */\n  hostname?: string | undefined;\n  /**\n   * password\n   */\n  password?: string | undefined;\n  /**\n   * pathname\n   */\n  pathname?: string | undefined;\n  /**\n   * port\n   */\n  port?: (number | string) | undefined;\n  /**\n   * protocol\n   */\n  protocol?: string | undefined;\n  /**\n   * username\n   */\n  username?: string | undefined;\n};\ntype OverlayMessageOptions = boolean | ((error: Error) => void);\ntype ClientConfiguration = {\n  /**\n   * logging\n   */\n  logging?:\n    | (\"log\" | \"info\" | \"warn\" | \"error\" | \"none\" | \"verbose\")\n    | undefined;\n  /**\n   * overlay\n   */\n  overlay?:\n    | (\n        | boolean\n        | {\n            warnings?: OverlayMessageOptions;\n            errors?: OverlayMessageOptions;\n            runtimeErrors?: OverlayMessageOptions;\n          }\n      )\n    | undefined;\n  /**\n   * progress\n   */\n  progress?: boolean | undefined;\n  /**\n   * reconnect\n   */\n  reconnect?: (boolean | number) | undefined;\n  /**\n   * web socket transport\n   */\n  webSocketTransport?: (\"ws\" | \"sockjs\" | string) | undefined;\n  /**\n   * web socket URL\n   */\n  webSocketURL?: (string | WebSocketURL) | undefined;\n};\ntype Headers =\n  | Array<{\n      key: string;\n      value: string;\n    }>\n  | Record<string, string | string[]>;\ntype MiddlewareHandler<\n  T extends BasicApplication = import(\"express\").Application,\n> = T extends ExpressApplication\n  ? ExpressRequestHandler | ExpressErrorRequestHandler\n  : HandleFunction;\ntype MiddlewareObject = {\n  name?: string;\n  path?: string;\n  middleware: MiddlewareHandler;\n};\ntype Middleware = MiddlewareObject | MiddlewareHandler;\ntype BasicServer = import(\"net\").Server | import(\"tls\").Server;\ntype Configuration<\n  A extends BasicApplication = import(\"express\").Application,\n  S extends BasicServer = import(\"http\").Server<\n    typeof import(\"http\").IncomingMessage,\n    typeof import(\"http\").ServerResponse\n  >,\n> = {\n  ipc?: (boolean | string) | undefined;\n  host?: Host | undefined;\n  port?: Port | undefined;\n  hot?: (boolean | \"only\") | undefined;\n  liveReload?: boolean | undefined;\n  devMiddleware?: DevMiddlewareOptions<Request, Response> | undefined;\n  compress?: boolean | undefined;\n  allowedHosts?: (\"auto\" | \"all\" | string | string[]) | undefined;\n  historyApiFallback?: (boolean | ConnectHistoryApiFallbackOptions) | undefined;\n  bonjour?: (boolean | Record<string, never> | BonjourOptions) | undefined;\n  watchFiles?:\n    | (string | string[] | WatchFiles | Array<string | WatchFiles>)\n    | undefined;\n  static?: (boolean | string | Static | Array<string | Static>) | undefined;\n  server?: (ServerType<A, S> | ServerConfiguration<A, S>) | undefined;\n  app?: (() => Promise<A>) | undefined;\n  webSocketServer?:\n    | (boolean | \"sockjs\" | \"ws\" | string | WebSocketServerConfiguration)\n    | undefined;\n  proxy?: ProxyConfigArray | undefined;\n  open?: (boolean | string | Open | Array<string | Open>) | undefined;\n  setupExitSignals?: boolean | undefined;\n  client?: (boolean | ClientConfiguration) | undefined;\n  headers?:\n    | (\n        | Headers\n        | ((\n            req: Request,\n            res: Response,\n            context: DevMiddlewareContext<Request, Response> | undefined,\n          ) => Headers)\n      )\n    | undefined;\n  onListening?: ((devServer: Server<A, S>) => void) | undefined;\n  setupMiddlewares?:\n    | ((middlewares: Middleware[], devServer: Server<A, S>) => Middleware[])\n    | undefined;\n};\ntype FunctionReturning<T> = () => T;\ntype BasicApplication = {\n  use: typeof useFn;\n};\n/**\n * @overload\n * @param {NextHandleFunction} fn function\n * @returns {BasicApplication} application\n */\ndeclare function useFn(fn: NextHandleFunction): BasicApplication;\n/**\n * @overload\n * @param {HandleFunction} fn function\n * @returns {BasicApplication} application\n */\ndeclare function useFn(fn: HandleFunction): BasicApplication;\n/**\n * @overload\n * @param {string} route route\n * @param {NextHandleFunction} fn function\n * @returns {BasicApplication} application\n */\ndeclare function useFn(route: string, fn: NextHandleFunction): BasicApplication;\n\n// DO NOT REMOVE THIS!\ntype DevServerConfiguration = Configuration;\ndeclare module \"webpack\" {\n  interface Configuration {\n    /**\n     * Can be used to configure the behaviour of webpack-dev-server when\n     * the webpack config is passed to webpack-dev-server CLI.\n     */\n    devServer?: DevServerConfiguration | undefined;\n  }\n}\n"
  },
  {
    "path": "types/lib/getPort.d.ts",
    "content": "export = getPorts;\n/**\n * @param {number} basePort base port\n * @param {string=} host host\n * @returns {Promise<number>} resolved port\n */\ndeclare function getPorts(\n  basePort: number,\n  host?: string | undefined,\n): Promise<number>;\n"
  },
  {
    "path": "types/lib/servers/BaseServer.d.ts",
    "content": "export = BaseServer;\ndeclare class BaseServer {\n  /**\n   * @param {import(\"../Server\")} server server\n   */\n  constructor(server: import(\"../Server\"));\n  /** @type {import(\"../Server\")} */\n  server: import(\"../Server\");\n  /** @type {ClientConnection[]} */\n  clients: ClientConnection[];\n}\ndeclare namespace BaseServer {\n  export { ClientConnection };\n}\ntype ClientConnection = import(\"../Server\").ClientConnection;\n"
  },
  {
    "path": "types/lib/servers/SockJSServer.d.ts",
    "content": "export = SockJSServer;\ndeclare class SockJSServer extends BaseServer {\n  implementation: sockjs.Server;\n}\ndeclare namespace SockJSServer {\n  export { WebSocketServerConfiguration, ClientConnection };\n}\nimport BaseServer = require(\"./BaseServer\");\nimport sockjs = require(\"sockjs\");\ntype WebSocketServerConfiguration =\n  import(\"../Server\").WebSocketServerConfiguration;\ntype ClientConnection = import(\"../Server\").ClientConnection;\n"
  },
  {
    "path": "types/lib/servers/WebsocketServer.d.ts",
    "content": "export = WebsocketServer;\ndeclare class WebsocketServer extends BaseServer {\n  static heartbeatInterval: number;\n  implementation: WebSocket.Server<\n    typeof WebSocket,\n    typeof import(\"http\").IncomingMessage\n  >;\n}\ndeclare namespace WebsocketServer {\n  export { WebSocketServerConfiguration, ClientConnection };\n}\nimport BaseServer = require(\"./BaseServer\");\nimport WebSocket = require(\"ws\");\ntype WebSocketServerConfiguration =\n  import(\"../Server\").WebSocketServerConfiguration;\ntype ClientConnection = import(\"../Server\").ClientConnection;\n"
  }
]