@cypress/vite-dev-server 5.0.5 → 5.0.7

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.
@@ -1,5 +1,4 @@
1
1
  /// <reference types="cypress" />
2
- /// <reference types="cypress" />
3
2
  /// <reference types="node" />
4
3
  import type { UserConfig } from 'vite';
5
4
  declare const ALL_FRAMEWORKS: readonly ["react", "vue"];
@@ -33,7 +33,7 @@ const Cypress = (options, vite) => {
33
33
  base = config.base;
34
34
  },
35
35
  async transformIndexHtml(html) {
36
- // it's possibe other plugins have modified the HTML
36
+ // it's possible other plugins have modified the HTML
37
37
  // before we get to. For example vitejs/plugin-react will
38
38
  // add a preamble. We do our best to look at the HTML we
39
39
  // receive and inject it.
@@ -52,7 +52,8 @@ const createViteDevServerConfig = async (config, vite) => {
52
52
  exports.createViteDevServerConfig = createViteDevServerConfig;
53
53
  function makeCypressViteConfig(config, vite) {
54
54
  var _a, _b, _c;
55
- const { cypressConfig: { projectRoot, devServerPublicPathRoute, supportFile, cypressBinaryRoot, isTextTerminal, }, specs, } = config;
55
+ const { cypressConfig: { port, projectRoot, devServerPublicPathRoute, supportFile, cypressBinaryRoot, isTextTerminal, }, specs, } = config;
56
+ const vitePort = port !== null && port !== void 0 ? port : undefined;
56
57
  // Vite caches its output in the .vite directory in the node_modules where vite lives.
57
58
  // So we want to find that node_modules path and ensure it's added to the "allow" list
58
59
  const vitePathNodeModules = path_1.default.dirname(path_1.default.dirname(require.resolve(`vite/package.json`, {
@@ -63,8 +64,6 @@ function makeCypressViteConfig(config, vite) {
63
64
  base: `${devServerPublicPathRoute}/`,
64
65
  optimizeDeps: {
65
66
  esbuildOptions: {
66
- // We are using Vite 4.2.0+, so `incremental` doesn't exist in the types
67
- // @ts-expect-error
68
67
  incremental: true,
69
68
  plugins: [
70
69
  {
@@ -96,7 +95,7 @@ function makeCypressViteConfig(config, vite) {
96
95
  // Supported from Vite v3 - add null check for v2 users.
97
96
  (_a = vite.searchForWorkspaceRoot) === null || _a === void 0 ? void 0 : _a.call(vite, process.cwd()),
98
97
  ],
99
- }, host: '127.0.0.1' }, (isTextTerminal
98
+ }, port: vitePort, host: '127.0.0.1' }, (isTextTerminal
100
99
  ? { watch: { ignored: '**/*' }, hmr: false }
101
100
  : {})),
102
101
  plugins: [
@@ -105,8 +104,6 @@ function makeCypressViteConfig(config, vite) {
105
104
  ],
106
105
  };
107
106
  if (vite.version && (0, gte_1.default)(vite.version, '4.2.0')) {
108
- // We are using Vite 4.2.0+, so `incremental` doesn't exist in the types
109
- // @ts-expect-error
110
107
  (_c = (_b = viteConfig.optimizeDeps) === null || _b === void 0 ? void 0 : _b.esbuildOptions) === null || _c === void 0 ? true : delete _c.incremental;
111
108
  }
112
109
  return viteConfig;
package/package.json CHANGED
@@ -1,11 +1,10 @@
1
1
  {
2
2
  "name": "@cypress/vite-dev-server",
3
- "version": "5.0.5",
3
+ "version": "5.0.7",
4
4
  "description": "Launches Vite Dev Server for Component Testing",
5
5
  "main": "index.js",
6
6
  "scripts": {
7
7
  "build": "tsc || echo 'built, with type errors'",
8
- "build-prod": "tsc || echo 'built, with type errors'",
9
8
  "check-ts": "tsc --noEmit",
10
9
  "cypress:run": "yarn cypress:run-cypress-in-cypress node ../../scripts/cypress run --project . --browser chrome",
11
10
  "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",
@@ -19,16 +18,16 @@
19
18
  "debug": "^4.3.4",
20
19
  "find-up": "6.3.0",
21
20
  "node-html-parser": "5.3.3",
22
- "semver": "^7.3.2"
21
+ "semver": "^7.5.3"
23
22
  },
24
23
  "devDependencies": {
25
24
  "chai": "^4.3.6",
26
25
  "dedent": "^0.7.0",
27
26
  "mocha": "^9.2.2",
28
27
  "sinon": "^13.0.1",
29
- "ts-node": "^10.9.1",
30
- "vite": "4.2.0",
31
- "vite-plugin-inspect": "0.4.3"
28
+ "ts-node": "^10.9.2",
29
+ "vite": "4.3.2",
30
+ "vite-plugin-inspect": "0.7.24"
32
31
  },
33
32
  "files": [
34
33
  "dist",
@@ -46,5 +45,14 @@
46
45
  "module": "dist/index.js",
47
46
  "publishConfig": {
48
47
  "access": "public"
48
+ },
49
+ "nx": {
50
+ "targets": {
51
+ "build": {
52
+ "outputs": [
53
+ "{projectRoot}/dist"
54
+ ]
55
+ }
56
+ }
49
57
  }
50
58
  }