Home / File/ index.html — vite Source File

index.html — vite Source File

Architecture documentation for index.html, a html file in the vite codebase.

Entity Profile

Source Code

<h2>Normal Import</h2>
<pre class="full"></pre>
<pre class="named"></pre>

<h2>Deep Import</h2>
<pre class="deep-full"></pre>
<pre class="deep-named"></pre>

<h2>Dynamic Import</h2>
<pre class="dynamic"></pre>
<pre class="dynamic-named"></pre>

<h2>fetch</h2>
<pre class="fetch"></pre>

<h2>Importing as URL</h2>
<pre class="url"></pre>

<h2>Raw Import</h2>
<pre class="raw"></pre>

<h2>JSON Module</h2>
<pre class="module"></pre>

<h2>Has BOM Tag</h2>
<pre class="bom"></pre>

<h2>require(json) returns object without default export</h2>
<pre class="require"></pre>

<h2>HMR</h2>
<pre class="hmr"></pre>

<script type="module">
  import json, { hello } from './test.json'
  import deepJson, { name } from 'vue/package.json'

  text('.full', JSON.stringify(json))
  text('.named', hello)

  text('.deep-full', JSON.stringify(deepJson))
  text('.deep-named', name)

  import('/test.json').then((mod) => {
    text('.dynamic', JSON.stringify(mod.default))
    text('.dynamic-named', mod.hello)
  })

  fetch(import.meta.env.DEV ? '/test.json' : '/public.json')
    .then((r) => r.json())
    .then((data) => {
      text('.fetch', JSON.stringify(data))
    })

  import url from './test.json?url'
  text('.url', url)

  import raw from './test.json?raw'
  text('.raw', raw)

  import moduleJSON from '@vitejs/test-json-module'
  text('.module', JSON.stringify(moduleJSON))

  import hasBomJson from './json-bom/has-bom.json'
  text('.bom', JSON.stringify(hasBomJson))

  import requireJson from '@vitejs/test-json-require'
  text('.require', JSON.stringify(requireJson.content))

  import hmrJSON from './hmr.json'
  text('.hmr', JSON.stringify(hmrJSON))

  function text(sel, text) {
    document.querySelector(sel).textContent = text
  }
</script>

Frequently Asked Questions

What does index.html do?
index.html is a source file in the vite codebase, written in html.
Where is index.html in the architecture?
index.html is located at playground/json/index.html (directory: playground/json).

Analyze Your Own Codebase

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

Try Supermodel Free