Home / File/ main.js — vite Source File

main.js — vite Source File

Architecture documentation for main.js, a javascript file in the vite codebase. 1 imports, 0 dependents.

File javascript ViteCore BuildPipeline 1 imports 2 functions

Entity Profile

Dependency Diagram

graph LR
  ef914789_002f_c53e_0cc4_81c447cabe50["main.js"]
  bad13c94_2fcd_5e29_4606_de9accf512a6["chunk.js"]
  ef914789_002f_c53e_0cc4_81c447cabe50 --> bad13c94_2fcd_5e29_4606_de9accf512a6
  style ef914789_002f_c53e_0cc4_81c447cabe50 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

import chunkMsg from './chunk'

document.querySelector('.chunk').textContent = chunkMsg

const ids = {
  hello: async () => {
    await import(/* a comment */ './hello.js')
  },
  about: async () => {
    await import('./about.js') // lazy load
  },
}

for (const [id, loader] of Object.entries(ids)) {
  const loadButton = document.querySelector(`#${id} .load`)
  loadButton.addEventListener('click', async () => {
    await loader()
    loadButton.insertAdjacentHTML('afterend', '<output>loaded</output>')
  })
}

Domain

Subdomains

Dependencies

Frequently Asked Questions

What does main.js do?
main.js is a source file in the vite codebase, written in javascript. It belongs to the ViteCore domain, BuildPipeline subdomain.
What functions are defined in main.js?
main.js defines 2 function(s): ids.about, ids.hello.
What does main.js depend on?
main.js imports 1 module(s): chunk.js.
Where is main.js in the architecture?
main.js is located at playground/preload/src/main.js (domain: ViteCore, subdomain: BuildPipeline, directory: playground/preload/src).

Analyze Your Own Codebase

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

Try Supermodel Free