mirror of
https://github.com/hanzoai/vite.git
synced 2026-10-30 19:36:16 +00:00
20 lines
417 B
HTML
20 lines
417 B
HTML
<h1>Import assertion</h1>
|
|
|
|
<h2>From source code</h2>
|
|
<p class="src"></p>
|
|
|
|
<h2>From dependency</h2>
|
|
<p class="dep"></p>
|
|
|
|
<script type="module">
|
|
import * as data from './data.json' assert { type: 'json' }
|
|
text('.src', data.foo)
|
|
|
|
import * as depData from '@vitejs/test-import-assertion-dep'
|
|
text('.dep', depData.hello)
|
|
|
|
function text(el, text) {
|
|
document.querySelector(el).textContent = text
|
|
}
|
|
</script>
|