( specifier: string, context: ResolveContext, defaultResolve: ResolveFunction, )
| 64 | let stashedResolve: null | ResolveFunction = null; |
| 65 | |
| 66 | export async function resolve( |
| 67 | specifier: string, |
| 68 | context: ResolveContext, |
| 69 | defaultResolve: ResolveFunction, |
| 70 | ): Promise<{url: string}> { |
| 71 | class="cm">// We stash this in case we end up needing to resolve export * statements later. |
| 72 | stashedResolve = defaultResolve; |
| 73 | |
| 74 | if (!context.conditions.includes(class="st">'react-server')) { |
| 75 | context = { |
| 76 | ...context, |
| 77 | conditions: [...context.conditions, class="st">'react-server'], |
| 78 | }; |
| 79 | if (!warnedAboutConditionsFlag) { |
| 80 | warnedAboutConditionsFlag = true; |
| 81 | class="cm">// eslint-disable-next-line react-internal/no-production-logging |
| 82 | console.warn( |
| 83 | class="st">'You did not run Node.js with the `--conditions react-server` flag. ' + |
| 84 | class="st">'Any "react-server" override will only work with ESM imports.', |
| 85 | ); |
| 86 | } |
| 87 | } |
| 88 | return await defaultResolve(specifier, context, defaultResolve); |
| 89 | } |
| 90 | |
| 91 | export async function getSource( |
| 92 | url: string, |
no outgoing calls