vite/playground/alias/index.html
Shinigami 60721ac53a
chore: use node prefix (#8309)
Co-authored-by: bluwy <bjornlu.dev@gmail.com>
2022-06-19 21:59:52 +02:00

49 lines
1.3 KiB
HTML

<h1>Alias</h1>
<p class="fs"></p>
<p class="fs-dir"></p>
<p class="regex"></p>
<p class="dep"></p>
<p class="from-script-src"></p>
<p class="aliased-module"></p>
<p class="custom-resolver"></p>
<div class="optimized"></div>
<script type="module">
// no node: protocol intentionally
import { msg as fsMsg } from 'fs'
import { msg as fsDirMsg } from 'fs-dir/test'
import { msg as regexMsg } from 'regex/test'
import { msg as depMsg } from 'dep'
import { msg as moduleMsg } from 'aliased-module/index.js'
import { msg as customResolverMsg } from 'custom-resolver'
function text(el, text) {
document.querySelector(el).textContent = text
}
text('.fs', fsMsg)
text('.fs-dir', fsDirMsg)
text('.regex', regexMsg + ' via regex')
text('.dep', depMsg)
text('.aliased-module', moduleMsg)
text('.custom-resolver', customResolverMsg)
import { createApp } from 'vue'
import { ref } from 'foo'
// vue is aliased to the full browser build AND optimized.
// should resolve as expected
createApp({
template: '[{{ msg }}] alias optimized dep',
setup() {
return {
msg: ref('success')
}
}
}).mount('.optimized')
</script>
<script type="module" src="/@/from-script-src.js"></script>
<link rel="stylesheet" href="/@/test.css" />