Skip to content

Commit 89898d3

Browse files
HenryVogtHenry Vogtantfu
authored
feat(create-app): add template vanilla-ts (#2023)
Co-authored-by: Henry Vogt <[email protected]> Co-authored-by: Anthony Fu <[email protected]>
1 parent 7e98c07 commit 89898d3

File tree

9 files changed

+82
-0
lines changed

9 files changed

+82
-0
lines changed

packages/create-app/README.md

+1
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ yarn create @vitejs/app my-vue-app --template vue
3535
Currently supported template presets include:
3636

3737
- `vanilla`
38+
- `vanilla-ts`
3839
- `vue`
3940
- `vue-ts`
4041
- `react`

packages/create-app/index.js

+1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ const cwd = process.cwd()
1919

2020
const TEMPLATES = [
2121
yellow('vanilla'),
22+
yellow('vanilla-ts'),
2223
green('vue'),
2324
green('vue-ts'),
2425
cyan('react'),
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
node_modules
2+
.DS_Store
3+
dist
4+
dist-ssr
5+
*.local
Loading
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" type="image/svg+xml" href="favicon.svg" />
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>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"name": "vite-typescript-starter",
3+
"version": "0.0.0",
4+
"scripts": {
5+
"dev": "vite",
6+
"build": "tsc && vite build",
7+
"serve": "vite preview"
8+
},
9+
"devDependencies": {
10+
"typescript": "^4.2.3",
11+
"vite": "^2.1.5"
12+
}
13+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import './style.css'
2+
3+
const app = document.querySelector<HTMLDivElement>('#app')!
4+
5+
app.innerHTML = `
6+
<h1>Hello Vite!</h1>
7+
<a href="https://vitejs.dev/guide/features.html" target="_blank">Documentation</a>
8+
`
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#app {
2+
font-family: Avenir, Helvetica, Arial, sans-serif;
3+
-webkit-font-smoothing: antialiased;
4+
-moz-osx-font-smoothing: grayscale;
5+
text-align: center;
6+
color: #2c3e50;
7+
margin-top: 60px;
8+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
"compilerOptions": {
3+
"target": "ESNext",
4+
"module": "ESNext",
5+
"lib": ["ESNext", "DOM"],
6+
"moduleResolution": "Node",
7+
"strict": true,
8+
"sourceMap": true,
9+
"resolveJsonModule": true,
10+
"esModuleInterop": true,
11+
"types": ["vite/client"],
12+
"noEmit": true,
13+
"noUnusedLocals": true,
14+
"noUnusedParameters": true,
15+
"noImplicitReturns": true
16+
},
17+
"include": ["./src"]
18+
}

0 commit comments

Comments
 (0)