File tree Expand file tree Collapse file tree 2 files changed +18
-16
lines changed
packages/vitest-pool-workers/src Expand file tree Collapse file tree 2 files changed +18
-16
lines changed Original file line number Diff line number Diff line change @@ -160,21 +160,20 @@ function createConfigPlugin(): Plugin<WorkersConfigPluginAPI> {
160160 config . test . deps . optimizer ??= { } ;
161161 config . test . deps . optimizer . ssr ??= { } ;
162162 config . test . deps . optimizer . ssr . enabled ??= true ;
163- config . test . deps . optimizer . ssr . esbuildOptions = {
164- platform : "neutral" ,
165- resolveExtensions : [
166- ".mjs" ,
167- ".js" ,
168- ".mts" ,
169- ".ts" ,
170- ".jsx" ,
171- ".tsx" ,
172- ".json" ,
173- ".cjs" ,
174- ".cts" ,
175- ".ctx" ,
176- ] ,
177- } ;
163+ config . test . deps . optimizer . ssr . esbuildOptions ??= { } ;
164+ config . test . deps . optimizer . ssr . esbuildOptions . platform ??= "neutral" ;
165+ config . test . deps . optimizer . ssr . esbuildOptions . resolveExtensions ??= [
166+ ".mjs" ,
167+ ".js" ,
168+ ".mts" ,
169+ ".ts" ,
170+ ".jsx" ,
171+ ".tsx" ,
172+ ".json" ,
173+ ".cjs" ,
174+ ".cts" ,
175+ ".ctx" ,
176+ ] ;
178177 config . test . deps . optimizer . ssr . exclude ??= [ ] ;
179178 ensureArrayIncludes ( config . test . deps . optimizer . ssr . exclude , [
180179 ...cloudflareBuiltInModules ,
Original file line number Diff line number Diff line change @@ -41,12 +41,15 @@ function trimSuffix(suffix: string, value: string) {
4141 return value . substring ( 0 , value . length - suffix . length ) ;
4242}
4343
44- const versionHashRegExp = / \? v = [ 0 - 9 a - f ] + $ / ;
4544/**
4645 * When pre-bundling is enabled, Vite will add a hash to the end of the file path
46+ * e.g. `/node_modules/.vite/deps/my-dep.js?v=f3sf2ebd`
47+ *
4748 * @see https://vite.dev/guide/features.html#npm-dependency-resolving-and-pre-bundling
4849 * @see https://github.com/cloudflare/workers-sdk/pull/5673
4950 */
51+ const versionHashRegExp = / \? v = [ 0 - 9 a - f ] + $ / ;
52+
5053function trimViteVersionHash ( filePath : string ) {
5154 return filePath . replace ( versionHashRegExp , "" ) ;
5255}
You can’t perform that action at this time.
0 commit comments