Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(create-app): add template vanilla-ts #2023

Merged
merged 6 commits into from
Apr 10, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions packages/create-app/README.md
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
@@ -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
Loading
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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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"]
}