Skip to content

Commit fd176a4

Browse files
committed
feat: add vite example
1 parent d9f0a28 commit fd176a4

File tree

8 files changed

+58
-2
lines changed

8 files changed

+58
-2
lines changed

examples/esbuild/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<meta charset="UTF-8" />
55
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
66
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
7-
<title>esbuild</title>
7+
<title>ESBuild</title>
88
</head>
99
<body>
1010
<div id="app"></div>

examples/rollup/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<meta charset="UTF-8" />
55
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
66
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
7-
<title>rollup</title>
7+
<title>Rollup</title>
88
</head>
99
<body>
1010
<div id="app"></div>

examples/vite/index.html

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8" />
5+
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
6+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
7+
<title>Vite</title>
8+
</head>
9+
<body>
10+
<div id="app"></div>
11+
<script src="./src/main.ts" type="module"></script>
12+
</body>
13+
</html>

examples/vite/package.json

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"private": true,
3+
"author": "三咲智子 <[email protected]>",
4+
"scripts": {
5+
"dev": "vite",
6+
"build": "vite build",
7+
"preview": "vite preview"
8+
},
9+
"dependencies": {
10+
"vue": "^3.2.27"
11+
},
12+
"devDependencies": {
13+
"unplugin-vue": "workspace:^0.1.0",
14+
"vite": "^2.7.13"
15+
}
16+
}

examples/vite/src/App.vue

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<script setup lang="ts">
2+
import { ref } from 'vue'
3+
const msg = ref('')
4+
</script>
5+
6+
<template>
7+
<div>
8+
<h1>Hello world</h1>
9+
<h2>{{ msg }}</h2>
10+
<input v-model="msg" type="text" />
11+
</div>
12+
</template>

examples/vite/src/main.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
import { createApp } from 'vue'
2+
import App from './App.vue'
3+
4+
createApp(App).mount('#app')

examples/vite/tsconfig.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"include": ["src/**/*"],
3+
"exclude": ["node_modules"],
4+
"compilerOptions": {}
5+
}

examples/vite/vite.config.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import { defineConfig } from 'vite'
2+
import Vue from 'unplugin-vue/vite'
3+
4+
export default defineConfig({
5+
plugins: [Vue()],
6+
})

0 commit comments

Comments
 (0)