* 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)
| 1576 | * as `client.browser.js`, not the `node` variant a server's file gets. |
| 1577 | */ |
| 1578 | function isBrowserCode(file: string, context: ResolutionContext): boolean { |
| 1579 | const source = context.readFile(file); |
| 1580 | return !!source && BROWSER_GLOBAL_READ.test(blankStringContents(stripCommentsForRegex(source, 'typescript'))); |
| 1581 | } |
| 1582 | |
| 1583 | /** `target`, build output the index lacks, as the indexed source it is built from (see builtSourcesOf); null when there is none. */ |
| 1584 | function builtSourceOf(target: string, packageDir: string, language: Language, context: ResolutionContext): string | null { |
no test coverage detected