File tree Expand file tree Collapse file tree 3 files changed +7
-7
lines changed
packages/vitest-pool-workers/src Expand file tree Collapse file tree 3 files changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ import fs from "node:fs/promises";
44import { builtinModules } from "node:module" ;
55import path from "node:path" ;
66import { MessageChannel , receiveMessageOnPort } from "node:worker_threads" ;
7- import { workerdBuiltinModules } from "../pool/module-fallback " ;
7+ import { workerdBuiltinModules } from "../pool/builtin-modules " ;
88import type {
99 WorkersConfigPluginAPI ,
1010 WorkersPoolOptions ,
Original file line number Diff line number Diff line change 1+ // Node.js built-in modules provided by `workerd`
2+ export const workerdBuiltinModules = new Set ( [
3+ ...VITEST_POOL_WORKERS_DEFINE_BUILTIN_MODULES ,
4+ "__STATIC_CONTENT_MANIFEST" ,
5+ ] ) ;
Original file line number Diff line number Diff line change @@ -8,6 +8,7 @@ import util from "node:util";
88import * as cjsModuleLexer from "cjs-module-lexer" ;
99import { buildSync } from "esbuild" ;
1010import { ModuleRuleTypeSchema , Response } from "miniflare" ;
11+ import { workerdBuiltinModules } from "./builtin-modules" ;
1112import { isFileNotFoundError } from "./helpers" ;
1213import type { ModuleRuleType , Request , Worker_Module } from "miniflare" ;
1314import type { ViteDevServer } from "vite" ;
@@ -67,12 +68,6 @@ const forceModuleTypeRegexp = new RegExp(
6768 `\\?mf_vitest_force=(${ ModuleRuleTypeSchema . options . join ( "|" ) } )$`
6869) ;
6970
70- // Node.js built-in modules provided by `workerd`
71- export const workerdBuiltinModules = new Set ( [
72- ...VITEST_POOL_WORKERS_DEFINE_BUILTIN_MODULES ,
73- "__STATIC_CONTENT_MANIFEST" ,
74- ] ) ;
75-
7671// `chai` contains circular `require()`s which aren't supported by `workerd`
7772// TODO(someday): support circular `require()` in `workerd`
7873const bundleDependencies = [ "chai" ] ;
You can’t perform that action at this time.
0 commit comments