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. 5 imports, 0 dependents.

File typescript ViteCore ConfigEngine 5 imports 4 functions

Entity Profile

Dependency Diagram

graph LR
  1881247f_497c_87d7_8eb6_75c8f50658ae["vite.config.ts"]
  781d8cbd_13ea_7fbf_365c_3960563bd6f1["plugin.ts"]
  1881247f_497c_87d7_8eb6_75c8f50658ae --> 781d8cbd_13ea_7fbf_365c_3960563bd6f1
  cc2696cb_eb07_3bc8_3f9c_5c748a77e44f["TestCssLinkPlugin"]
  1881247f_497c_87d7_8eb6_75c8f50658ae --> cc2696cb_eb07_3bc8_3f9c_5c748a77e44f
  a09ff191_7c83_bdcd_30f1_b4e129910bf6["promises"]
  1881247f_497c_87d7_8eb6_75c8f50658ae --> a09ff191_7c83_bdcd_30f1_b4e129910bf6
  51e96894_3556_ed5c_1ede_97d449867adf["node:path"]
  1881247f_497c_87d7_8eb6_75c8f50658ae --> 51e96894_3556_ed5c_1ede_97d449867adf
  54c37fea_4fe7_2693_71cb_1276b77f55f9["vite"]
  1881247f_497c_87d7_8eb6_75c8f50658ae --> 54c37fea_4fe7_2693_71cb_1276b77f55f9
  style 1881247f_497c_87d7_8eb6_75c8f50658ae fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

import fs from 'node:fs/promises'
import path from 'node:path'
import { defineConfig } from 'vite'
import type { Plugin } from 'vite'
import { TestCssLinkPlugin } from './css-link/plugin'

export default defineConfig(({ command }) => ({
  experimental: {
    hmrPartialAccept: true,
  },
  build: {
    rollupOptions: {
      input: [
        path.resolve(import.meta.dirname, './index.html'),
        ...(command === 'build'
          ? []
          : [path.resolve(import.meta.dirname, './missing-import/index.html')]),
        path.resolve(
          import.meta.dirname,
          './unicode-path/中文-にほんご-한글-🌕🌖🌗/index.html',
        ),
        path.resolve(import.meta.dirname, './counter/index.html'),
        path.resolve(
          import.meta.dirname,
          './self-accept-within-circular/index.html',
        ),
        path.resolve(import.meta.dirname, './css-deps/index.html'),
      ],
    },
    assetsInlineLimit(filePath) {
      if (filePath.endsWith('logo-no-inline.svg')) {
        return false
      }
    },
  },
  plugins: [
    {
      name: 'mock-custom',
      async hotUpdate({ file, read }) {
        if (file.endsWith('customFile.js')) {
          const content = await read()
          const msg = content.match(/export const msg = '(\w+)'/)[1]
          this.environment.hot.send('custom:foo', { msg })
          this.environment.hot.send('custom:remove', { msg })
        }
      },
      configureServer(server) {
        server.environments.client.hot.on(
          'custom:remote-add',
          ({ a, b }, client) => {
            client.send('custom:remote-add-result', { result: a + b })
          },
        )
      },
    },
    virtualPlugin(),
    transformCountPlugin(),
    watchCssDepsPlugin(),
    TestCssLinkPlugin(),
    hotEventsPlugin(),
// ... (84 more lines)

Domain

Subdomains

Dependencies

Frequently Asked Questions

What does vite.config.ts do?
vite.config.ts is a source file in the vite codebase, written in typescript. It belongs to the ViteCore domain, ConfigEngine subdomain.
What functions are defined in vite.config.ts?
vite.config.ts defines 4 function(s): hotEventsPlugin, transformCountPlugin, virtualPlugin, watchCssDepsPlugin.
What does vite.config.ts depend on?
vite.config.ts imports 5 module(s): TestCssLinkPlugin, node:path, plugin.ts, promises, vite.
Where is vite.config.ts in the architecture?
vite.config.ts is located at playground/hmr/vite.config.ts (domain: ViteCore, subdomain: ConfigEngine, directory: playground/hmr).

Analyze Your Own Codebase

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

Try Supermodel Free