chore(demos): added svelte default demo

This commit is contained in:
Dominik Biedebach
2022-06-24 18:31:39 +02:00
parent 8e65c20815
commit e0b13a5125
9 changed files with 1719 additions and 671 deletions

View File

@@ -1,3 +1,4 @@
import { svelte } from '@sveltejs/vite-plugin-svelte'
import react from '@vitejs/plugin-react'
import vue from '@vitejs/plugin-vue'
import fg from 'fast-glob'
@@ -38,6 +39,7 @@ export default defineConfig({
// checker({ typescript: { tsconfigPath: './tsconfig.vue-3.json' } }),
vue(),
react(),
svelte(),
{
name: 'html-transform',
@@ -95,6 +97,29 @@ export default defineConfig({
}
}
if (dir.endsWith('/Svelte')) {
return {
html: `
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
</head>
<body>
<div id="app"></div>
<script type="module">
import setup from '../../../../setup/svelte.ts'
import source from '@source'
setup('${demoCategory}/${demoName}', source)
</script>
</body>
</html>
`,
tags: [],
}
}
if (dir.endsWith('/React')) {
return {
html: `