Home / File/ zoo-with-sourcemap-plugin.ts — vite Source File

zoo-with-sourcemap-plugin.ts — vite Source File

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

File typescript ViteCore ConfigEngine 2 imports 1 dependents 2 functions

Entity Profile

Dependency Diagram

graph LR
  a82ebd23_6b79_17ae_d2be_bc45ae15984b["zoo-with-sourcemap-plugin.ts"]
  ff79973e_f09f_1c6b_f6b5_d1707df47116["magic-string"]
  a82ebd23_6b79_17ae_d2be_bc45ae15984b --> ff79973e_f09f_1c6b_f6b5_d1707df47116
  54c37fea_4fe7_2693_71cb_1276b77f55f9["vite"]
  a82ebd23_6b79_17ae_d2be_bc45ae15984b --> 54c37fea_4fe7_2693_71cb_1276b77f55f9
  446f618c_4534_006f_d231_e5da67c68c53["vite.config.js"]
  446f618c_4534_006f_d231_e5da67c68c53 --> a82ebd23_6b79_17ae_d2be_bc45ae15984b
  style a82ebd23_6b79_17ae_d2be_bc45ae15984b fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

import MagicString from 'magic-string'
import type { Plugin } from 'vite'

export const transformZooWithSourcemapPlugin: () => Plugin = () => ({
  name: 'sourcemap',
  transform(code, id) {
    if (id.includes('zoo.js')) {
      const ms = new MagicString(code)
      ms.append('// add comment')
      return {
        code: ms.toString(),
        // NOTE: MagicString without `filename` option generates
        //       a sourcemap with `sources: ['']` or `sources: [null]`
        map: ms.generateMap({ hires: true }),
      }
    }
  },
})

Domain

Subdomains

Dependencies

  • magic-string
  • vite

Frequently Asked Questions

What does zoo-with-sourcemap-plugin.ts do?
zoo-with-sourcemap-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 zoo-with-sourcemap-plugin.ts?
zoo-with-sourcemap-plugin.ts defines 2 function(s): Plugin, transformZooWithSourcemapPlugin.
What does zoo-with-sourcemap-plugin.ts depend on?
zoo-with-sourcemap-plugin.ts imports 2 module(s): magic-string, vite.
What files import zoo-with-sourcemap-plugin.ts?
zoo-with-sourcemap-plugin.ts is imported by 1 file(s): vite.config.js.
Where is zoo-with-sourcemap-plugin.ts in the architecture?
zoo-with-sourcemap-plugin.ts is located at playground/js-sourcemap/zoo-with-sourcemap-plugin.ts (domain: ViteCore, subdomain: ConfigEngine, directory: playground/js-sourcemap).

Analyze Your Own Codebase

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

Try Supermodel Free