Home / File/ vite.config.ts — vite Source File

vite.config.ts — vite Source File

Architecture documentation for vite.config.ts, a typescript file in the vite codebase. 1 imports, 0 dependents.

File typescript 1 imports

Entity Profile

Dependency Diagram

graph LR
  cdc9c692_6d2e_f3a4_54d1_dc2b8a712e8d["vite.config.ts"]
  54c37fea_4fe7_2693_71cb_1276b77f55f9["vite"]
  cdc9c692_6d2e_f3a4_54d1_dc2b8a712e8d --> 54c37fea_4fe7_2693_71cb_1276b77f55f9
  style cdc9c692_6d2e_f3a4_54d1_dc2b8a712e8d fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

import { defineConfig, normalizePath } from 'vite'

const rootPath = normalizePath(import.meta.dirname)
const absoluteRoot = rootPath.startsWith('/') ? rootPath : `/${rootPath}`
const [firstSegment] = absoluteRoot.split('/').filter(Boolean)
const base = firstSegment ? `/${firstSegment}/` : '/'

const VIRTUAL_MODULE_ID = 'absolute-importer'
const RESOLVED_VIRTUAL_MODULE_ID = '\0' + VIRTUAL_MODULE_ID

const absoluteDepPath = `${rootPath}/src/importee.ts`
export default defineConfig({
  base,
  plugins: [
    {
      name: 'absolute-path-import',
      resolveId(id) {
        if (id === VIRTUAL_MODULE_ID) {
          return RESOLVED_VIRTUAL_MODULE_ID
        }
      },
      load(id) {
        if (id === RESOLVED_VIRTUAL_MODULE_ID) {
          return (
            `import dep from ${JSON.stringify(absoluteDepPath)}\n` +
            `export default dep`
          )
        }
      },
    },
  ],
})

Dependencies

  • vite

Frequently Asked Questions

What does vite.config.ts do?
vite.config.ts is a source file in the vite codebase, written in typescript.
What does vite.config.ts depend on?
vite.config.ts imports 1 module(s): vite.
Where is vite.config.ts in the architecture?
vite.config.ts is located at playground/base-conflict/vite.config.ts (directory: playground/base-conflict).

Analyze Your Own Codebase

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

Try Supermodel Free