@@ -4,6 +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" ;
78import type {
89 WorkersConfigPluginAPI ,
910 WorkersPoolOptions ,
@@ -111,13 +112,6 @@ function ensureArrayExcludes<T>(array: T[], items: T[]) {
111112const requiredConditions = [ "workerd" , "worker" , "browser" ] ;
112113const requiredMainFields = [ "browser" , "module" , "jsnext:main" , "jsnext" ] ;
113114
114- const cloudflareBuiltInModules = [
115- "cloudflare:email" ,
116- "cloudflare:sockets" ,
117- "cloudflare:workers" ,
118- "cloudflare:workflows" ,
119- ] ;
120-
121115function createConfigPlugin ( ) : Plugin < WorkersConfigPluginAPI > {
122116 // Use a unique ID for each `cloudflare:test` module so updates in one `main`
123117 // don't trigger re-runs in all other projects, just the one that changed.
@@ -162,7 +156,7 @@ function createConfigPlugin(): Plugin<WorkersConfigPluginAPI> {
162156 config . test . deps . optimizer . ssr . enabled ??= true ;
163157 config . test . deps . optimizer . ssr . exclude ??= [ ] ;
164158 ensureArrayIncludes ( config . test . deps . optimizer . ssr . exclude , [
165- ...cloudflareBuiltInModules ,
159+ ...workerdBuiltinModules ,
166160 ...builtinModules . concat ( builtinModules . map ( ( m ) => `node:${ m } ` ) ) ,
167161 ] ) ;
168162
0 commit comments