Skip to content

Commit

Permalink
feat(create-app): add template vanilla-ts (#2023)
Browse files Browse the repository at this point in the history
Co-authored-by: Henry Vogt <henry.vogt@aoe.com>
Co-authored-by: Anthony Fu <anthonyfu117@hotmail.com>
  • Loading branch information
3 people committed Apr 10, 2021
1 parent 7e98c07 commit 89898d3
Show file tree
Hide file tree
Showing 9 changed files with 82 additions and 0 deletions.
1 change: 1 addition & 0 deletions packages/create-app/README.md
Expand Up @@ -35,6 +35,7 @@ yarn create @vitejs/app my-vue-app --template vue
Currently supported template presets include:

- `vanilla`
- `vanilla-ts`
- `vue`
- `vue-ts`
- `react`
Expand Down
1 change: 1 addition & 0 deletions packages/create-app/index.js
Expand Up @@ -19,6 +19,7 @@ const cwd = process.cwd()

const TEMPLATES = [
yellow('vanilla'),
yellow('vanilla-ts'),
green('vue'),
green('vue-ts'),
cyan('react'),
Expand Down
5 changes: 5 additions & 0 deletions packages/create-app/template-vanilla-ts/_gitignore
@@ -0,0 +1,5 @@
node_modules
.DS_Store
dist
dist-ssr
*.local
15 changes: 15 additions & 0 deletions packages/create-app/template-vanilla-ts/favicon.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
13 changes: 13 additions & 0 deletions packages/create-app/template-vanilla-ts/index.html
@@ -0,0 +1,13 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="favicon.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Vite App</title>
</head>
<body>
<div id="app"></div>
<script type="module" src="/src/main.ts"></script>
</body>
</html>
13 changes: 13 additions & 0 deletions packages/create-app/template-vanilla-ts/package.json
@@ -0,0 +1,13 @@
{
"name": "vite-typescript-starter",
"version": "0.0.0",
"scripts": {
"dev": "vite",
"build": "tsc && vite build",
"serve": "vite preview"
},
"devDependencies": {
"typescript": "^4.2.3",
"vite": "^2.1.5"
}
}
8 changes: 8 additions & 0 deletions packages/create-app/template-vanilla-ts/src/main.ts
@@ -0,0 +1,8 @@
import './style.css'

const app = document.querySelector<HTMLDivElement>('#app')!

app.innerHTML = `
<h1>Hello Vite!</h1>
<a href="https://vitejs.dev/guide/features.html" target="_blank">Documentation</a>
`
8 changes: 8 additions & 0 deletions packages/create-app/template-vanilla-ts/src/style.css
@@ -0,0 +1,8 @@
#app {
font-family: Avenir, Helvetica, Arial, sans-serif;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
text-align: center;
color: #2c3e50;
margin-top: 60px;
}
18 changes: 18 additions & 0 deletions packages/create-app/template-vanilla-ts/tsconfig.json
@@ -0,0 +1,18 @@
{
"compilerOptions": {
"target": "ESNext",
"module": "ESNext",
"lib": ["ESNext", "DOM"],
"moduleResolution": "Node",
"strict": true,
"sourceMap": true,
"resolveJsonModule": true,
"esModuleInterop": true,
"types": ["vite/client"],
"noEmit": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
"noImplicitReturns": true
},
"include": ["./src"]
}

0 comments on commit 89898d3

Please sign in to comment.