Home / File/ resolve.spec.ts — vite Source File

resolve.spec.ts — vite Source File

Architecture documentation for resolve.spec.ts, a typescript file in the vite codebase. 5 imports, 0 dependents.

File typescript 5 imports

Entity Profile

Dependency Diagram

graph LR
  f5908ddc_32fd_9ffc_1d68_c7bb9604f826["resolve.spec.ts"]
  e6032fbc_44cf_58d6_868d_dd15106c18c5["node:fs"]
  f5908ddc_32fd_9ffc_1d68_c7bb9604f826 --> e6032fbc_44cf_58d6_868d_dd15106c18c5
  51e96894_3556_ed5c_1ede_97d449867adf["node:path"]
  f5908ddc_32fd_9ffc_1d68_c7bb9604f826 --> 51e96894_3556_ed5c_1ede_97d449867adf
  6feed3e8_55b8_cce7_b5ef_e40b872585f7["node:url"]
  f5908ddc_32fd_9ffc_1d68_c7bb9604f826 --> 6feed3e8_55b8_cce7_b5ef_e40b872585f7
  a340ba46_b2b7_3048_3bb3_6907a74c8464["vitest"]
  f5908ddc_32fd_9ffc_1d68_c7bb9604f826 --> a340ba46_b2b7_3048_3bb3_6907a74c8464
  d3fd5575_295b_d6be_24dd_62d277645dc9["~utils"]
  f5908ddc_32fd_9ffc_1d68_c7bb9604f826 --> d3fd5575_295b_d6be_24dd_62d277645dc9
  style f5908ddc_32fd_9ffc_1d68_c7bb9604f826 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

import fs from 'node:fs'
import path from 'node:path'
import { fileURLToPath } from 'node:url'
import { describe, expect, test } from 'vitest'
import { isBuild, isServe, isWindows, page, testDir, viteTestUrl } from '~utils'

test('bom import', async () => {
  expect(await page.textContent('.utf8-bom')).toMatch('[success]')
})

test('deep import', async () => {
  expect(await page.textContent('.deep-import')).toMatch('[2,4]')
})

test('exports and a nested package scope with a different type', async () => {
  expect(await page.textContent('.exports-and-nested-scope')).toMatch(
    '[success]',
  )
})

test('entry with exports field', async () => {
  expect(await page.textContent('.exports-entry')).toMatch('[success]')
})

test('deep import with exports field', async () => {
  expect(await page.textContent('.exports-deep')).toMatch('[success]')
})

test('deep import with query with exports field', async () => {
  // since it is imported with `?url` it should return a URL
  expect(await page.textContent('.exports-deep-query')).toMatch(
    isBuild ? /base64/ : '/exports-path/deep.json',
  )
})

test('deep import with exports field + exposed dir', async () => {
  expect(await page.textContent('.exports-deep-exposed-dir')).toMatch(
    '[success]',
  )
})

test('deep import with exports field + mapped dir', async () => {
  expect(await page.textContent('.exports-deep-mapped-dir')).toMatch(
    '[success]',
  )
})

test('exports read from the root package.json', async () => {
  expect(await page.textContent('.exports-from-root')).toMatch('[success]')
})

// this is how Svelte 3 is packaged
test('deep import with exports and legacy fallback', async () => {
  expect(await page.textContent('.exports-legacy-fallback')).toMatch(
    '[success]',
  )
})

test('Respect exports field env key priority', async () => {
  expect(await page.textContent('.exports-env')).toMatch('[success]')
// ... (239 more lines)

Dependencies

  • node:fs
  • node:path
  • node:url
  • vitest
  • ~utils

Frequently Asked Questions

What does resolve.spec.ts do?
resolve.spec.ts is a source file in the vite codebase, written in typescript.
What does resolve.spec.ts depend on?
resolve.spec.ts imports 5 module(s): node:fs, node:path, node:url, vitest, ~utils.
Where is resolve.spec.ts in the architecture?
resolve.spec.ts is located at playground/resolve/__tests__/resolve.spec.ts (directory: playground/resolve/__tests__).

Analyze Your Own Codebase

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

Try Supermodel Free