@cypress/webpack-dev-server 6.2.1 → 6.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2,9 +2,9 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.CypressCTWebpackPlugin = void 0;
4
4
  const tslib_1 = require("tslib");
5
- const lodash_1 = tslib_1.__importDefault(require("lodash"));
6
5
  const fs_extra_1 = tslib_1.__importDefault(require("fs-extra"));
7
6
  const path_1 = tslib_1.__importDefault(require("path"));
7
+ const node_util_1 = require("node:util");
8
8
  /**
9
9
  * A webpack 5 compatible Cypress Component Testing Plugin
10
10
  *
@@ -73,7 +73,7 @@ class CypressCTWebpackPlugin {
73
73
  * See https://github.com/cypress-io/cypress/issues/24398
74
74
  */
75
75
  onSpecsChange = async ({ specs, options }) => {
76
- if (!this.compilation || lodash_1.default.isEqual(specs, this.files)) {
76
+ if (!this.compilation || (0, node_util_1.isDeepStrictEqual)(specs, this.files)) {
77
77
  return;
78
78
  }
79
79
  this.files = specs;
@@ -159,19 +159,24 @@ const exists = async (file) => {
159
159
  /**
160
160
  * Next allows the `pages` directory to be located at either
161
161
  * `${projectRoot}/pages` or `${projectRoot}/src/pages`.
162
- * If neither is found, return projectRoot
162
+ * App Router-only projects have neither, so return `${projectRoot}/pages/` even
163
+ * though it doesn't exist. Next treats every file under `pagesDir` as a page and
164
+ * rejects `export *` in pages, so the project root would break dependencies such
165
+ * as `@mui/material`. Next's Babel loader also needs a path here when the project
166
+ * has a Babel config, so `undefined` won't do. The trailing separator keeps Next's
167
+ * `filename.startsWith(pagesDir)` check from matching siblings like `pages-legacy/`.
163
168
  */
164
169
  async function findPagesDir(projectRoot) {
165
170
  // prioritize ./pages over ./src/pages
166
- let pagesDir = path.join(projectRoot, 'pages');
171
+ const pagesDir = path.join(projectRoot, 'pages');
167
172
  if (await exists(pagesDir)) {
168
173
  return pagesDir;
169
174
  }
170
- pagesDir = path.join(projectRoot, 'src', 'pages');
171
- if (await exists(pagesDir)) {
172
- return pagesDir;
175
+ const srcPagesDir = path.join(projectRoot, 'src', 'pages');
176
+ if (await exists(srcPagesDir)) {
177
+ return srcPagesDir;
173
178
  }
174
- return projectRoot;
179
+ return `${pagesDir}${path.sep}`;
175
180
  }
176
181
  // 'next/dist/trace/trace' has been the trace location since Next.js 12.0
177
182
  function getRunWebpackSpan(devServerConfig) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cypress/webpack-dev-server",
3
- "version": "6.2.1",
3
+ "version": "6.2.2",
4
4
  "description": "Launches Webpack Dev Server for Component Testing",
5
5
  "homepage": "https://github.com/cypress-io/cypress/tree/develop/npm/webpack-dev-server#readme",
6
6
  "bugs": "https://github.com/cypress-io/cypress/issues/new?template=1-bug-report.md",
@@ -19,7 +19,7 @@
19
19
  "check-ts": "tsc --noEmit && tsc --project cypress/tsconfig.json",
20
20
  "clean": "rimraf dist",
21
21
  "cypress:open": "yarn cypress:run-cypress-in-cypress gulp open --project . --expose INTERNAL_E2E_TESTING_SELF_PARENT_PROJECT=true",
22
- "cypress:run": "yarn cypress:run-cypress-in-cypress node ../../scripts/cypress run --project . --browser chrome --expose INTERNAL_E2E_TESTING_SELF_PARENT_PROJECT=true",
22
+ "cypress:run": "yarn cypress:run-cypress-in-cypress node ../../scripts/cypress.mts run --project . --browser chrome --expose INTERNAL_E2E_TESTING_SELF_PARENT_PROJECT=true",
23
23
  "cypress:run-cypress-in-cypress": "cross-env CYPRESS_INTERNAL_E2E_TESTING_SELF_PARENT_PROJECT=1 HTTP_PROXY_TARGET_FOR_ORIGIN_REQUESTS=http://localhost:4455 CYPRESS_REMOTE_DEBUGGING_PORT=6666 TZ=America/New_York",
24
24
  "dev": "tsc --watch",
25
25
  "lint": "eslint",
@@ -45,6 +45,7 @@
45
45
  "devDependencies": {
46
46
  "@angular-devkit/core": "^21.2.7",
47
47
  "@packages/eslint-config": "0.0.0-development",
48
+ "@packages/vitest-setup": "0.0.0-development",
48
49
  "@types/micromatch": "4.0.10",
49
50
  "@types/node": "24.10.1",
50
51
  "@types/semver": "^7.5.0",