* Whether a file reads the browser's page, so that the `browser` condition of * an import is the one it runs with: react's `fixtures/flight/src/index.js`, * which a bundler builds for the page, takes `react-server-dom-webpack/client` * as `client.browser.js`, not the `node` variant a server's fil
(file: string, context: ResolutionContext)
| 1637 | * as `client.browser.js`, not the `node` variant a server's file gets. |
| 1638 | */ |
| 1639 | function isBrowserCode(file: string, context: ResolutionContext): boolean { |
| 1640 | const source = context.readFile(file); |
| 1641 | return !!source && BROWSER_GLOBAL_READ.test(blankStringContents(stripCommentsForRegex(source, 'typescript'))); |
| 1642 | } |
| 1643 | |
| 1644 | /** `target`, build output the index lacks, as the indexed source it is built from (see builtSourcesOf); null when there is none. */ |
| 1645 | function builtSourceOf(target: string, packageDir: string, language: Language, context: ResolutionContext): string | null { |
no test coverage detected