Home / File/ plugin.ts — vite Source File

plugin.ts — vite Source File

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

File typescript ViteCore ConfigEngine 2 imports 1 dependents 1 functions

Entity Profile

Dependency Diagram

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

Relationship Graph

Source Code

import path from 'node:path'
import { type Plugin, normalizePath } from 'vite'

// use plugin to simulate server rendered css link
export function TestCssLinkPlugin(): Plugin {
  return {
    name: 'test-css-link',
    transformIndexHtml: {
      handler(_html, ctx) {
        if (!ctx.filename.endsWith('/css-link/index.html')) return
        return [
          {
            tag: 'link',
            attrs: {
              rel: 'stylesheet',
              href: '/css-link/styles.css',
              'data-vite-dev-id': normalizePath(
                path.resolve(import.meta.dirname, 'styles.css'),
              ),
            },
          },
        ]
      },
    },
  }
}

Domain

Subdomains

Dependencies

  • node:path
  • vite

Frequently Asked Questions

What does plugin.ts do?
plugin.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 plugin.ts?
plugin.ts defines 1 function(s): TestCssLinkPlugin.
What does plugin.ts depend on?
plugin.ts imports 2 module(s): node:path, vite.
What files import plugin.ts?
plugin.ts is imported by 1 file(s): vite.config.ts.
Where is plugin.ts in the architecture?
plugin.ts is located at playground/hmr/css-link/plugin.ts (domain: ViteCore, subdomain: ConfigEngine, directory: playground/hmr/css-link).

Analyze Your Own Codebase

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

Try Supermodel Free