Skip to content

Commit 25b4128

Browse files
committed
init
0 parents  commit 25b4128

File tree

14 files changed

+751
-0
lines changed

14 files changed

+751
-0
lines changed

.gitignore

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Logs
2+
logs
3+
*.log
4+
npm-debug.log*
5+
yarn-debug.log*
6+
yarn-error.log*
7+
pnpm-debug.log*
8+
lerna-debug.log*
9+
10+
node_modules
11+
dist
12+
dist-ssr
13+
*.local
14+
15+
# Editor directories and files
16+
.vscode
17+
.idea
18+
.DS_Store
19+
*.suo
20+
*.ntvs*
21+
*.njsproj
22+
*.sln
23+
*.sw?

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Vue 3 + TypeScript + Vite
2+
3+
My Vue project starter.

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+
<link rel="icon" href="/favicon.ico" />
6+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
7+
<title>Vite App</title>
8+
</head>
9+
<body>
10+
<div id="app"></div>
11+
<script type="module" src="/src/main.ts"></script>
12+
</body>
13+
</html>

package.json

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{
2+
"name": "my-vue-app",
3+
"private": true,
4+
"version": "0.0.0",
5+
"type": "module",
6+
"scripts": {
7+
"dev": "vite",
8+
"build": "vue-tsc --noEmit && vite build",
9+
"preview": "vite preview"
10+
},
11+
"dependencies": {
12+
"vue": "^3.2.36"
13+
},
14+
"devDependencies": {
15+
"typescript": "^4.7.3",
16+
"vite": "^2.9.9",
17+
"vue-tsc": "0.35.2"
18+
}
19+
}

pnpm-lock.yaml

Lines changed: 615 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

public/favicon.ico

4.19 KB
Binary file not shown.

src/App.vue

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<template>
2+
<AComponent worker="Vue with TypeScript" />
3+
</template>
4+
5+
<script setup lang="ts">
6+
import AComponent from './components/AComponent.vue'
7+
</script>

src/assets/logo.png

6.69 KB
Loading

src/components/AComponent.vue

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<template v-if="true">
2+
<h1>{{ `${task} by ${worker}.` }}</h1>
3+
</template>
4+
5+
<script setup lang="ts">
6+
interface Props {
7+
task?: string
8+
worker: 'Vue' | 'TypeScript' | string
9+
}
10+
11+
withDefaults(defineProps<Props>(), {
12+
task: 'Validate props',
13+
})
14+
</script>

src/env.d.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
declare module '*.vue' {
2+
import type { DefineComponent } from 'vue'
3+
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/ban-types
4+
const component: DefineComponent<{}, {}, any>
5+
export default component
6+
}

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')

tsconfig.json

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
{
2+
"compilerOptions": {
3+
"target": "esnext",
4+
"useDefineForClassFields": true,
5+
"module": "esnext",
6+
"moduleResolution": "node",
7+
"strict": true,
8+
"jsx": "preserve",
9+
"sourceMap": true,
10+
"resolveJsonModule": true,
11+
"isolatedModules": true,
12+
"esModuleInterop": true,
13+
"lib": [
14+
"esnext",
15+
"dom"
16+
],
17+
"skipLibCheck": true,
18+
"types": [
19+
"vite/client",
20+
]
21+
},
22+
"include": [
23+
// see https://www.typescriptlang.org/tsconfig#include
24+
"src/**/*",
25+
"src/*.vue",
26+
],
27+
"references": [
28+
{
29+
"path": "./tsconfig.node.json"
30+
}
31+
]
32+
}

tsconfig.node.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"compilerOptions": {
3+
"composite": true,
4+
"module": "esnext",
5+
"moduleResolution": "node"
6+
},
7+
"include": ["vite.config.ts"]
8+
}

vite.config.ts

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

0 commit comments

Comments
 (0)