@cypress/vite-dev-server
Advanced tools
Comparing version 3.2.0 to 3.3.0
@@ -75,23 +75,2 @@ "use strict"; | ||
}, | ||
transform(code, id, options) { | ||
try { | ||
if (/\.js$/i.test(id) && !/\/\/# sourceMappingURL=/i.test(code)) { | ||
// The Vite dev server and plugins automatically transpile TS and JSX files, which results in sourcemaps being generated | ||
// and included in output. However, Vite serves up `esnext`-compliant Javascript which means many JS files won't be | ||
// transpiled and won't supply a sourcemap - this prevents Cypress from providing codeFrames in the event of an error. | ||
// | ||
// A sourcemap is generated by Vite for JS files (just not included) which is in effect an "identity" sourcemap mapping | ||
// 1-to-1 to the output file. We can grab this and pass it along as a sourcemap we want Vite to embed into the output, | ||
// giving Cypress a sourcemap to use for codeFrame lookups. | ||
// @see https://rollupjs.org/guide/en/#thisgetcombinedsourcemap | ||
return { | ||
code, | ||
map: this.getCombinedSourcemap(), | ||
}; | ||
} | ||
} | ||
catch (_err) { | ||
debug('Failed to propagate sourcemap for %s: %o', id, _err); | ||
} | ||
}, | ||
handleHotUpdate: ({ server, file }) => { | ||
@@ -98,0 +77,0 @@ debug('handleHotUpdate - file', file); |
export * from './inspect'; | ||
export * from './cypress'; | ||
export * from './sourcemap'; |
@@ -6,1 +6,2 @@ "use strict"; | ||
tslib_1.__exportStar(require("./cypress"), exports); | ||
tslib_1.__exportStar(require("./sourcemap"), exports); |
@@ -0,3 +1,4 @@ | ||
import type { InlineConfig } from 'vite'; | ||
import type { ViteDevServerConfig } from './devServer'; | ||
import type { Vite } from './getVite'; | ||
export declare const createViteDevServerConfig: (config: ViteDevServerConfig, vite: Vite) => Promise<Record<string, any>>; | ||
export declare const createViteDevServerConfig: (config: ViteDevServerConfig, vite: Vite) => Promise<InlineConfig>; |
@@ -87,4 +87,12 @@ "use strict"; | ||
(0, index_1.CypressInspect)(config), | ||
(0, index_1.CypressSourcemap)(config, vite), | ||
].filter((p) => p != null), | ||
}; | ||
if (config.cypressConfig.isTextTerminal) { | ||
viteBaseConfig.server = Object.assign(Object.assign({}, (viteBaseConfig.server || {})), { | ||
// Disable file watching and HMR when executing tests in `run` mode | ||
watch: { | ||
ignored: '**/*', | ||
}, hmr: false }); | ||
} | ||
let resolvedOverrides = {}; | ||
@@ -91,0 +99,0 @@ if (typeof viteOverrides === 'function') { |
{ | ||
"name": "@cypress/vite-dev-server", | ||
"version": "3.2.0", | ||
"version": "3.3.0", | ||
"description": "Launches Vite Dev Server for Component Testing", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
28182
23
509