Home / File/ ssr-conditions.spec.ts — vite Source File

ssr-conditions.spec.ts — vite Source File

Architecture documentation for ssr-conditions.spec.ts, a typescript file in the vite codebase. 3 imports, 0 dependents.

Entity Profile

Dependency Diagram

graph LR
  465dec62_4e99_ffa9_c0e1_e7d12119fab9["ssr-conditions.spec.ts"]
  e8390d52_78f0_b541_e7ec_a9dc528f4eae["serve.ts"]
  465dec62_4e99_ffa9_c0e1_e7d12119fab9 --> e8390d52_78f0_b541_e7ec_a9dc528f4eae
  a340ba46_b2b7_3048_3bb3_6907a74c8464["vitest"]
  465dec62_4e99_ffa9_c0e1_e7d12119fab9 --> a340ba46_b2b7_3048_3bb3_6907a74c8464
  d3fd5575_295b_d6be_24dd_62d277645dc9["~utils"]
  465dec62_4e99_ffa9_c0e1_e7d12119fab9 --> d3fd5575_295b_d6be_24dd_62d277645dc9
  style 465dec62_4e99_ffa9_c0e1_e7d12119fab9 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

import { expect, test } from 'vitest'
import { port } from './serve'
import { isServe, page } from '~utils'

const url = `http://localhost:${port}`

test('ssr.resolve.conditions affect non-externalized imports during ssr', async () => {
  await page.goto(url)
  expect(await page.textContent('.no-external-react-server')).toMatch(
    'node.unbundled.js',
  )
})

// externalConditions is only used for dev
test.runIf(isServe)(
  'ssr.resolve.externalConditions affect externalized imports during ssr',
  async () => {
    await page.goto(url)
    expect(await page.textContent('.external-react-server')).toMatch('edge.js')
  },
)

test('ssr.resolve settings do not affect non-ssr imports', async () => {
  await page.goto(url)
  await expect
    .poll(() => page.textContent('.browser-no-external-react-server'))
    .toMatch('default.js')
  await expect
    .poll(() => page.textContent('.browser-external-react-server'))
    .toMatch('default.js')
})

Domain

Dependencies

Frequently Asked Questions

What does ssr-conditions.spec.ts do?
ssr-conditions.spec.ts is a source file in the vite codebase, written in typescript. It belongs to the ViteCore domain.
What does ssr-conditions.spec.ts depend on?
ssr-conditions.spec.ts imports 3 module(s): serve.ts, vitest, ~utils.
Where is ssr-conditions.spec.ts in the architecture?
ssr-conditions.spec.ts is located at playground/ssr-conditions/__tests__/ssr-conditions.spec.ts (domain: ViteCore, directory: playground/ssr-conditions/__tests__).

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free