@cypress/vite-dev-server 5.0.4 → 5.0.6
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.
- package/dist/resolveConfig.js +13 -3
- package/package.json +5 -4
package/dist/resolveConfig.js
CHANGED
|
@@ -9,6 +9,7 @@ const tslib_1 = require("tslib");
|
|
|
9
9
|
*/
|
|
10
10
|
const debug_1 = tslib_1.__importDefault(require("debug"));
|
|
11
11
|
const path_1 = tslib_1.__importDefault(require("path"));
|
|
12
|
+
const gte_1 = tslib_1.__importDefault(require("semver/functions/gte"));
|
|
12
13
|
const constants_1 = require("./constants");
|
|
13
14
|
const index_1 = require("./plugins/index");
|
|
14
15
|
const dynamic_import_1 = require("./dynamic-import");
|
|
@@ -50,13 +51,15 @@ const createViteDevServerConfig = async (config, vite) => {
|
|
|
50
51
|
};
|
|
51
52
|
exports.createViteDevServerConfig = createViteDevServerConfig;
|
|
52
53
|
function makeCypressViteConfig(config, vite) {
|
|
53
|
-
|
|
54
|
+
var _a, _b, _c;
|
|
55
|
+
const { cypressConfig: { port, projectRoot, devServerPublicPathRoute, supportFile, cypressBinaryRoot, isTextTerminal, }, specs, } = config;
|
|
56
|
+
const vitePort = port !== null && port !== void 0 ? port : undefined;
|
|
54
57
|
// Vite caches its output in the .vite directory in the node_modules where vite lives.
|
|
55
58
|
// So we want to find that node_modules path and ensure it's added to the "allow" list
|
|
56
59
|
const vitePathNodeModules = path_1.default.dirname(path_1.default.dirname(require.resolve(`vite/package.json`, {
|
|
57
60
|
paths: [projectRoot],
|
|
58
61
|
})));
|
|
59
|
-
|
|
62
|
+
const viteConfig = {
|
|
60
63
|
root: projectRoot,
|
|
61
64
|
base: `${devServerPublicPathRoute}/`,
|
|
62
65
|
optimizeDeps: {
|
|
@@ -88,8 +91,11 @@ function makeCypressViteConfig(config, vite) {
|
|
|
88
91
|
projectRoot,
|
|
89
92
|
vitePathNodeModules,
|
|
90
93
|
cypressBinaryRoot,
|
|
94
|
+
// Allow in monorepo: https://vitejs.dev/config/server-options.html#server-fs-allow
|
|
95
|
+
// Supported from Vite v3 - add null check for v2 users.
|
|
96
|
+
(_a = vite.searchForWorkspaceRoot) === null || _a === void 0 ? void 0 : _a.call(vite, process.cwd()),
|
|
91
97
|
],
|
|
92
|
-
}, host: '127.0.0.1' }, (isTextTerminal
|
|
98
|
+
}, port: vitePort, host: '127.0.0.1' }, (isTextTerminal
|
|
93
99
|
? { watch: { ignored: '**/*' }, hmr: false }
|
|
94
100
|
: {})),
|
|
95
101
|
plugins: [
|
|
@@ -97,4 +103,8 @@ function makeCypressViteConfig(config, vite) {
|
|
|
97
103
|
(0, index_1.CypressSourcemap)(config, vite),
|
|
98
104
|
],
|
|
99
105
|
};
|
|
106
|
+
if (vite.version && (0, gte_1.default)(vite.version, '4.2.0')) {
|
|
107
|
+
(_c = (_b = viteConfig.optimizeDeps) === null || _b === void 0 ? void 0 : _b.esbuildOptions) === null || _c === void 0 ? true : delete _c.incremental;
|
|
108
|
+
}
|
|
109
|
+
return viteConfig;
|
|
100
110
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cypress/vite-dev-server",
|
|
3
|
-
"version": "5.0.
|
|
3
|
+
"version": "5.0.6",
|
|
4
4
|
"description": "Launches Vite Dev Server for Component Testing",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -18,7 +18,8 @@
|
|
|
18
18
|
"dependencies": {
|
|
19
19
|
"debug": "^4.3.4",
|
|
20
20
|
"find-up": "6.3.0",
|
|
21
|
-
"node-html-parser": "5.3.3"
|
|
21
|
+
"node-html-parser": "5.3.3",
|
|
22
|
+
"semver": "^7.5.3"
|
|
22
23
|
},
|
|
23
24
|
"devDependencies": {
|
|
24
25
|
"chai": "^4.3.6",
|
|
@@ -26,8 +27,8 @@
|
|
|
26
27
|
"mocha": "^9.2.2",
|
|
27
28
|
"sinon": "^13.0.1",
|
|
28
29
|
"ts-node": "^10.9.1",
|
|
29
|
-
"vite": "4.
|
|
30
|
-
"vite-plugin-inspect": "0.
|
|
30
|
+
"vite": "4.3.2",
|
|
31
|
+
"vite-plugin-inspect": "0.7.24"
|
|
31
32
|
},
|
|
32
33
|
"files": [
|
|
33
34
|
"dist",
|