cypress-devserver-esbuild
Advanced tools
Comparing version 1.2.7 to 1.3.0
{ | ||
"name": "cypress-devserver-esbuild", | ||
"version": "1.2.7", | ||
"version": "1.3.0", | ||
"description": "Minimal esbuild dev server for usage with cypress component tests.", | ||
@@ -37,4 +37,4 @@ "main": "./src/dev-server.js", | ||
"dependencies": { | ||
"cypress-ct-custom-devserver": "^1.1.1" | ||
"cypress-ct-custom-devserver": "2.0.0" | ||
} | ||
} | ||
} |
@@ -85,7 +85,6 @@ const { context, build } = require('esbuild') | ||
loadTest: async (spec, { injectHTML, loadBundle }) => { | ||
const supportPath = supportFile && join(outdir, supportFile.relative.replace(supportFile?.fileExtension, '.js')) | ||
if (supportFile && !singleBundle) { | ||
loadBundle(resolve(supportPath)) | ||
loadBundle(supportFile.relative.replace(supportFile?.fileExtension, '.js')) | ||
} | ||
const testPath = join(outdir, spec.relative.replace(spec?.fileExtension, '.js')) | ||
const testPath = spec.relative.replace(spec?.fileExtension, '.js') | ||
const hash = crypto.createHash('md5').update(testPath).digest('base64url') | ||
@@ -95,5 +94,7 @@ | ||
const now = Date.now() | ||
const fileName = join(outdir, `/__bundle/test.${hash}.js`) | ||
const publicPath = `/__bundle/test.${hash}.js` | ||
const fileName = join(outdir, publicPath) | ||
const supportPath = supportFile && join(outdir, supportFile.relative.replace(supportFile?.fileExtension, '.js')) | ||
await build({ | ||
entryPoints: [testPath], | ||
entryPoints: [join(outdir, testPath)], | ||
inject: [supportPath], | ||
@@ -108,5 +109,5 @@ bundle: true, | ||
log(3, `Creating bundle took ${Date.now() - now}ms.`) | ||
loadBundle(resolve(fileName)) | ||
loadBundle(publicPath) | ||
} else { | ||
loadBundle(resolve(testPath)) | ||
loadBundle(testPath) | ||
} | ||
@@ -113,0 +114,0 @@ |
12575
158
+ Addedcypress-ct-custom-devserver@2.0.0(transitive)
- Removedcypress-ct-custom-devserver@1.2.0(transitive)