@cypress/vite-dev-server
Advanced tools
Comparing version 2.0.4 to 2.0.5
@@ -0,1 +1,8 @@ | ||
# [@cypress/vite-dev-server-v2.0.5](https://github.com/cypress-io/cypress/compare/@cypress/vite-dev-server-v2.0.4...@cypress/vite-dev-server-v2.0.5) (2021-08-04) | ||
### Bug Fixes | ||
* reload every spec file when support updated ([#17598](https://github.com/cypress-io/cypress/issues/17598)) ([efc38b6](https://github.com/cypress-io/cypress/commit/efc38b67497b48db5b3a636acac3be45dd930593)) | ||
# [@cypress/vite-dev-server-v2.0.4](https://github.com/cypress-io/cypress/compare/@cypress/vite-dev-server-v2.0.3...@cypress/vite-dev-server-v2.0.4) (2021-07-31) | ||
@@ -2,0 +9,0 @@ |
@@ -22,12 +22,10 @@ "use strict"; | ||
const HMR_DEPENDENCY_LOOKUP_MAX_ITERATION = 50; | ||
function getSpecsPathsSet(specs, supportFile) { | ||
return new Set(supportFile | ||
? [...specs.map((spec) => spec.absolute), supportFile] | ||
: specs.map((spec) => spec.absolute)); | ||
function getSpecsPathsSet(specs) { | ||
return new Set(specs.map((spec) => spec.absolute)); | ||
} | ||
const makeCypressPlugin = (projectRoot, supportFilePath, devServerEvents, specs) => { | ||
let base = '/'; | ||
let specsPathsSet = getSpecsPathsSet(specs, supportFilePath); | ||
let specsPathsSet = getSpecsPathsSet(specs); | ||
devServerEvents.on('dev-server:specs:changed', (specs) => { | ||
specsPathsSet = getSpecsPathsSet(specs, supportFilePath); | ||
specsPathsSet = getSpecsPathsSet(specs); | ||
}); | ||
@@ -84,4 +82,9 @@ const posixSupportFilePath = supportFilePath ? convertPathToPosix(path_1.resolve(projectRoot, supportFilePath)) : undefined; | ||
debug('handleHotUpdate - mod.file', mod.file); | ||
if (mod.file === supportFilePath) { | ||
debug('handleHotUpdate - support compile success'); | ||
devServerEvents.emit('dev-server:compile:success'); | ||
return []; | ||
} | ||
if (mod.file && specsPathsSet.has(mod.file)) { | ||
debug('handleHotUpdate - compile success'); | ||
debug('handleHotUpdate - spec compile success', mod.file); | ||
devServerEvents.emit('dev-server:compile:success', { specFile: mod.file }); | ||
@@ -88,0 +91,0 @@ return []; |
{ | ||
"name": "@cypress/vite-dev-server", | ||
"version": "2.0.4", | ||
"version": "2.0.5", | ||
"description": "Launches Vite Dev Server for Component Testing", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
25853
248