├── .gitignore ├── LICENSE ├── README.md ├── index.js ├── package.json ├── template-preact-ts ├── _gitignore ├── index.html ├── package.json ├── src │ ├── app.tsx │ ├── index.css │ ├── logo.tsx │ └── main.tsx ├── tsconfig.json └── vite.config.ts ├── template-preact ├── _gitignore ├── index.html ├── package.json ├── src │ ├── app.jsx │ ├── index.css │ ├── logo.jsx │ └── main.jsx └── vite.config.js ├── template-react-ts ├── _gitignore ├── index.html ├── package.json ├── src │ ├── App.css │ ├── App.tsx │ ├── index.css │ ├── logo.svg │ ├── main.tsx │ └── react-app-env.d.ts ├── tsconfig.json └── vite.config.ts ├── template-react ├── _gitignore ├── index.html ├── package.json ├── src │ ├── App.css │ ├── App.jsx │ ├── index.css │ ├── logo.svg │ └── main.jsx └── vite.config.js ├── template-reason-react ├── _gitignore ├── bsconfig.json ├── index.html ├── package.json ├── src │ ├── App.css │ ├── App.re │ ├── Index.re │ ├── index.css │ └── logo.svg └── vite.config.js ├── template-vue-ts ├── _gitignore ├── index.html ├── package.json ├── public │ └── favicon.ico ├── src │ ├── App.vue │ ├── assets │ │ └── logo.png │ ├── components │ │ └── HelloWorld.vue │ ├── index.css │ ├── main.ts │ └── vue-app-env.d.ts └── tsconfig.json ├── template-vue ├── _gitignore ├── index.html ├── package.json ├── public │ └── favicon.ico └── src │ ├── App.vue │ ├── assets │ └── logo.png │ ├── components │ └── HelloWorld.vue │ ├── index.css │ └── main.js ├── updateVersions.js └── yarn.lock /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | .DS_Store 3 | dist 4 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2020-present, Yuxi (Evan) You 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # [ARCHIVED] create-vite-app 2 | 3 | This repo has moved to [create-vite](https://github.com/vitejs/vite/tree/main/packages/create-vite). 4 | -------------------------------------------------------------------------------- /index.js: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | const path = require('path') 3 | const fs = require('fs-extra') 4 | const argv = require('minimist')(process.argv.slice(2)) 5 | 6 | async function init() { 7 | const targetDir = argv._[0] || '.' 8 | const cwd = process.cwd() 9 | const root = path.join(cwd, targetDir) 10 | const renameFiles = { 11 | _gitignore: '.gitignore', 12 | } 13 | console.log(`Scaffolding project in ${root}...`) 14 | 15 | await fs.ensureDir(root) 16 | const existing = await fs.readdir(root) 17 | if (existing.length) { 18 | console.error(`Error: target directory is not empty.`) 19 | process.exit(1) 20 | } 21 | 22 | const templateDir = path.join( 23 | __dirname, 24 | `template-${argv.t || argv.template || 'vue'}` 25 | ) 26 | const write = async (file, content) => { 27 | const targetPath = renameFiles[file] 28 | ? path.join(root, renameFiles[file]) 29 | : path.join(root, file) 30 | if (content) { 31 | await fs.writeFile(targetPath, content) 32 | } else { 33 | await fs.copy(path.join(templateDir, file), targetPath) 34 | } 35 | } 36 | 37 | const files = await fs.readdir(templateDir) 38 | for (const file of files.filter((f) => f !== 'package.json')) { 39 | await write(file) 40 | } 41 | 42 | const pkg = require(path.join(templateDir, `package.json`)) 43 | pkg.name = path.basename(root) 44 | await write('package.json', JSON.stringify(pkg, null, 2)) 45 | 46 | console.log(`\nDone. Now run:\n`) 47 | if (root !== cwd) { 48 | console.log(` cd ${path.relative(cwd, root)}`) 49 | } 50 | console.log(` npm install (or \`yarn\`)`) 51 | console.log(` npm run dev (or \`yarn dev\`)`) 52 | console.log() 53 | } 54 | 55 | init().catch((e) => { 56 | console.error(e) 57 | }) 58 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "create-vite-app", 3 | "version": "1.21.0", 4 | "license": "MIT", 5 | "author": "Evan You", 6 | "main": "index.js", 7 | "bin": { 8 | "create-vite-app": "index.js", 9 | "cva": "index.js" 10 | }, 11 | "files": [ 12 | "index.js", 13 | "template-*" 14 | ], 15 | "repository": { 16 | "type": "git", 17 | "url": "git+https://github.com/vitejs/create-vite-app.git" 18 | }, 19 | "bugs": { 20 | "url": "https://github.com/vitejs/create-vite-app/issues" 21 | }, 22 | "homepage": "https://github.com/vitejs/create-vite-app/tree/master/#readme", 23 | "dependencies": { 24 | "fs-extra": "^9.0.0", 25 | "minimist": "^1.2.5" 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /template-preact-ts/_gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | .DS_Store 3 | dist 4 | dist-ssr 5 | *.local 6 | -------------------------------------------------------------------------------- /template-preact-ts/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Vite App 7 | 8 | 9 |
10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /template-preact-ts/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "vite-preact-ts-starter", 3 | "version": "0.0.0", 4 | "scripts": { 5 | "dev": "vite", 6 | "build": "tsc && vite build" 7 | }, 8 | "dependencies": { 9 | "preact": "^10.4.8" 10 | }, 11 | "devDependencies": { 12 | "@prefresh/vite": "^1.2.1", 13 | "typescript": "^4.0.5", 14 | "vite": "^1.0.0-rc.13" 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /template-preact-ts/src/app.tsx: -------------------------------------------------------------------------------- 1 | import { h, Fragment } from 'preact' 2 | import { Logo } from './logo' 3 | 4 | export function App() { 5 | return ( 6 | <> 7 | 8 |

Hello Vite + Preact!

9 |

10 | 16 | Learn Preact 17 | 18 |

19 | 20 | ) 21 | } 22 | -------------------------------------------------------------------------------- /template-preact-ts/src/index.css: -------------------------------------------------------------------------------- 1 | html, body { 2 | height: 100%; 3 | width: 100%; 4 | padding: 0; 5 | margin: 0; 6 | background: #FAFAFA; 7 | font-family: 'Helvetica Neue', arial, sans-serif; 8 | font-weight: 400; 9 | color: #444; 10 | -webkit-font-smoothing: antialiased; 11 | -moz-osx-font-smoothing: grayscale; 12 | } 13 | 14 | * { 15 | box-sizing: border-box; 16 | } 17 | 18 | #app { 19 | height: 100%; 20 | text-align: center; 21 | background-color: #673ab8; 22 | color: #fff; 23 | font-size: 1.5em; 24 | padding-top: 100px; 25 | } 26 | 27 | .link { 28 | color: #fff; 29 | } 30 | -------------------------------------------------------------------------------- /template-preact-ts/src/logo.tsx: -------------------------------------------------------------------------------- 1 | import { h } from 'preact' 2 | 3 | export const Logo = () => ( 4 | 49 | ) 50 | -------------------------------------------------------------------------------- /template-preact-ts/src/main.tsx: -------------------------------------------------------------------------------- 1 | import { render, h } from 'preact' 2 | import { App } from './app' 3 | import './index.css' 4 | 5 | render(, document.getElementById('app')!) 6 | -------------------------------------------------------------------------------- /template-preact-ts/tsconfig.json: -------------------------------------------------------------------------------- 1 | 2 | { 3 | "compilerOptions": { 4 | "target": "ESNext", 5 | "lib": ["DOM", "DOM.Iterable", "ESNext"], 6 | "types": [], 7 | "allowJs": false, 8 | "skipLibCheck": false, 9 | "esModuleInterop": false, 10 | "allowSyntheticDefaultImports": true, 11 | "strict": true, 12 | "forceConsistentCasingInFileNames": true, 13 | "module": "ESNext", 14 | "moduleResolution": "Node", 15 | "resolveJsonModule": true, 16 | "isolatedModules": true, 17 | "noEmit": true, 18 | "jsx": "react", 19 | "jsxFactory": "h", 20 | "jsxFragmentFactory": "Fragment" 21 | }, 22 | "include": ["src"] 23 | } 24 | -------------------------------------------------------------------------------- /template-preact-ts/vite.config.ts: -------------------------------------------------------------------------------- 1 | import preactRefresh from '@prefresh/vite' 2 | import type { UserConfig } from 'vite' 3 | 4 | const config: UserConfig = { 5 | jsx: { 6 | factory: 'h', 7 | fragment: 'Fragment' 8 | }, 9 | plugins: [preactRefresh()] 10 | } 11 | 12 | export default config 13 | -------------------------------------------------------------------------------- /template-preact/_gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | .DS_Store 3 | dist 4 | dist-ssr 5 | *.local 6 | -------------------------------------------------------------------------------- /template-preact/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Vite App 7 | 8 | 9 |
10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /template-preact/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "vite-preact-starter", 3 | "version": "0.0.0", 4 | "scripts": { 5 | "dev": "vite", 6 | "build": "vite build" 7 | }, 8 | "dependencies": { 9 | "preact": "^10.4.1" 10 | }, 11 | "devDependencies": { 12 | "@prefresh/vite": "^1.2.1", 13 | "vite": "^1.0.0-rc.13" 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /template-preact/src/app.jsx: -------------------------------------------------------------------------------- 1 | import { Logo } from './logo' 2 | 3 | export function App(props) { 4 | return ( 5 | <> 6 | 7 |

Hello Vite + Preact!

8 |

9 | 15 | Learn Preact 16 | 17 |

18 | 19 | ) 20 | } -------------------------------------------------------------------------------- /template-preact/src/index.css: -------------------------------------------------------------------------------- 1 | html, body { 2 | height: 100%; 3 | width: 100%; 4 | padding: 0; 5 | margin: 0; 6 | background: #FAFAFA; 7 | font-family: 'Helvetica Neue', arial, sans-serif; 8 | font-weight: 400; 9 | color: #444; 10 | -webkit-font-smoothing: antialiased; 11 | -moz-osx-font-smoothing: grayscale; 12 | } 13 | 14 | * { 15 | box-sizing: border-box; 16 | } 17 | 18 | #app { 19 | height: 100%; 20 | text-align: center; 21 | background-color: #673ab8; 22 | color: #fff; 23 | font-size: 1.5em; 24 | padding-top: 100px; 25 | } 26 | 27 | .link { 28 | color: #fff; 29 | } 30 | -------------------------------------------------------------------------------- /template-preact/src/logo.jsx: -------------------------------------------------------------------------------- 1 | export const Logo = () => ( 2 | 47 | ) 48 | -------------------------------------------------------------------------------- /template-preact/src/main.jsx: -------------------------------------------------------------------------------- 1 | import { render } from 'preact' 2 | import { App } from './app' 3 | import './index.css' 4 | 5 | render(, document.getElementById('app')) 6 | -------------------------------------------------------------------------------- /template-preact/vite.config.js: -------------------------------------------------------------------------------- 1 | // @ts-check 2 | import preactRefresh from '@prefresh/vite' 3 | 4 | /** 5 | * @type { import('vite').UserConfig } 6 | */ 7 | const config = { 8 | jsx: 'preact', 9 | plugins: [preactRefresh()] 10 | } 11 | 12 | export default config 13 | -------------------------------------------------------------------------------- /template-react-ts/_gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | .DS_Store 3 | dist 4 | dist-ssr 5 | *.local 6 | -------------------------------------------------------------------------------- /template-react-ts/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Vite App 7 | 8 | 9 |
10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /template-react-ts/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "vite-react-typescript-starter", 3 | "version": "0.0.0", 4 | "scripts": { 5 | "dev": "vite", 6 | "build": "tsc && vite build" 7 | }, 8 | "dependencies": { 9 | "react": "^17.0.0", 10 | "react-dom": "^17.0.0" 11 | }, 12 | "devDependencies": { 13 | "@types/react": "^17.0.0", 14 | "@types/react-dom": "^17.0.0", 15 | "typescript": "^4.1.2", 16 | "vite": "^1.0.0-rc.13", 17 | "vite-plugin-react": "^4.0.0" 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /template-react-ts/src/App.css: -------------------------------------------------------------------------------- 1 | .App { 2 | text-align: center; 3 | } 4 | 5 | .App-logo { 6 | height: 40vmin; 7 | pointer-events: none; 8 | } 9 | 10 | @media (prefers-reduced-motion: no-preference) { 11 | .App-logo { 12 | animation: App-logo-spin infinite 20s linear; 13 | } 14 | } 15 | 16 | .App-header { 17 | background-color: #282c34; 18 | min-height: 100vh; 19 | display: flex; 20 | flex-direction: column; 21 | align-items: center; 22 | justify-content: center; 23 | font-size: calc(10px + 2vmin); 24 | color: white; 25 | } 26 | 27 | .App-link { 28 | color: #61dafb; 29 | } 30 | 31 | @keyframes App-logo-spin { 32 | from { 33 | transform: rotate(0deg); 34 | } 35 | to { 36 | transform: rotate(360deg); 37 | } 38 | } 39 | 40 | button { 41 | font-size: calc(10px + 2vmin); 42 | } 43 | -------------------------------------------------------------------------------- /template-react-ts/src/App.tsx: -------------------------------------------------------------------------------- 1 | import React, { useState } from 'react' 2 | import logo from './logo.svg' 3 | import './App.css' 4 | 5 | function App() { 6 | const [count, setCount] = useState(0) 7 | 8 | return ( 9 |
10 |
11 | logo 12 |

Hello Vite + React!

13 |

14 | 15 |

16 |

17 | Edit App.tsx and save to test HMR updates. 18 |

19 | 25 | Learn React 26 | 27 |
28 |
29 | ) 30 | } 31 | 32 | export default App 33 | -------------------------------------------------------------------------------- /template-react-ts/src/index.css: -------------------------------------------------------------------------------- 1 | body { 2 | margin: 0; 3 | font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen", 4 | "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", 5 | sans-serif; 6 | -webkit-font-smoothing: antialiased; 7 | -moz-osx-font-smoothing: grayscale; 8 | } 9 | 10 | code { 11 | font-family: source-code-pro, Menlo, Monaco, Consolas, "Courier New", 12 | monospace; 13 | } 14 | -------------------------------------------------------------------------------- /template-react-ts/src/logo.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /template-react-ts/src/main.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import ReactDOM from 'react-dom' 3 | import './index.css' 4 | import App from './App' 5 | 6 | ReactDOM.render( 7 | 8 | 9 | , 10 | document.getElementById('root') 11 | ) 12 | -------------------------------------------------------------------------------- /template-react-ts/src/react-app-env.d.ts: -------------------------------------------------------------------------------- 1 | 2 | /// 3 | /// 4 | 5 | declare namespace NodeJS { 6 | interface Process { 7 | env: ProcessEnv 8 | } 9 | interface ProcessEnv { 10 | /** 11 | * By default, there are two modes in Vite: 12 | * 13 | * * `development` is used by vite and vite serve 14 | * * `production` is used by vite build 15 | * 16 | * You can overwrite the default mode used for a command by passing the --mode option flag. 17 | * 18 | */ 19 | readonly NODE_ENV: 'development' | 'production' 20 | } 21 | } 22 | 23 | declare var process: NodeJS.Process 24 | 25 | declare module '*.gif' { 26 | const src: string 27 | export default src 28 | } 29 | 30 | declare module '*.jpg' { 31 | const src: string 32 | export default src 33 | } 34 | 35 | declare module '*.jpeg' { 36 | const src: string 37 | export default src 38 | } 39 | 40 | declare module '*.png' { 41 | const src: string 42 | export default src 43 | } 44 | 45 | declare module '*.webp' { 46 | const src: string 47 | export default src 48 | } 49 | 50 | declare module '*.svg' { 51 | import * as React from 'react' 52 | 53 | export const ReactComponent: React.FunctionComponent & { title?: string }> 56 | 57 | const src: string 58 | export default src 59 | } 60 | 61 | declare module '*.module.css' { 62 | const classes: { readonly [key: string]: string } 63 | export default classes 64 | } 65 | 66 | declare module '*.module.scss' { 67 | const classes: { readonly [key: string]: string } 68 | export default classes 69 | } 70 | 71 | declare module '*.module.sass' { 72 | const classes: { readonly [key: string]: string } 73 | export default classes 74 | } 75 | -------------------------------------------------------------------------------- /template-react-ts/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "ESNext", 4 | "lib": ["DOM", "DOM.Iterable", "ESNext"], 5 | "types": [], 6 | "allowJs": false, 7 | "skipLibCheck": false, 8 | "esModuleInterop": false, 9 | "allowSyntheticDefaultImports": true, 10 | "strict": true, 11 | "forceConsistentCasingInFileNames": true, 12 | "module": "ESNext", 13 | "moduleResolution": "Node", 14 | "resolveJsonModule": true, 15 | "isolatedModules": true, 16 | "noEmit": true, 17 | "jsx": "react" 18 | }, 19 | "include": ["src"] 20 | } 21 | -------------------------------------------------------------------------------- /template-react-ts/vite.config.ts: -------------------------------------------------------------------------------- 1 | import * as reactPlugin from 'vite-plugin-react' 2 | import type { UserConfig } from 'vite' 3 | 4 | const config: UserConfig = { 5 | jsx: 'react', 6 | plugins: [reactPlugin] 7 | } 8 | 9 | export default config 10 | -------------------------------------------------------------------------------- /template-react/_gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | .DS_Store 3 | dist 4 | dist-ssr 5 | *.local -------------------------------------------------------------------------------- /template-react/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Vite App 7 | 8 | 9 |
10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /template-react/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "vite-react-starter", 3 | "version": "0.0.0", 4 | "scripts": { 5 | "dev": "vite", 6 | "build": "vite build" 7 | }, 8 | "dependencies": { 9 | "react": "^17.0.0", 10 | "react-dom": "^17.0.0" 11 | }, 12 | "devDependencies": { 13 | "vite": "^1.0.0-rc.13", 14 | "vite-plugin-react": "^4.0.0" 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /template-react/src/App.css: -------------------------------------------------------------------------------- 1 | .App { 2 | text-align: center; 3 | } 4 | 5 | .App-logo { 6 | height: 40vmin; 7 | pointer-events: none; 8 | } 9 | 10 | @media (prefers-reduced-motion: no-preference) { 11 | .App-logo { 12 | animation: App-logo-spin infinite 20s linear; 13 | } 14 | } 15 | 16 | .App-header { 17 | background-color: #282c34; 18 | min-height: 100vh; 19 | display: flex; 20 | flex-direction: column; 21 | align-items: center; 22 | justify-content: center; 23 | font-size: calc(10px + 2vmin); 24 | color: white; 25 | } 26 | 27 | .App-link { 28 | color: #61dafb; 29 | } 30 | 31 | @keyframes App-logo-spin { 32 | from { 33 | transform: rotate(0deg); 34 | } 35 | to { 36 | transform: rotate(360deg); 37 | } 38 | } 39 | 40 | button { 41 | font-size: calc(10px + 2vmin); 42 | } 43 | -------------------------------------------------------------------------------- /template-react/src/App.jsx: -------------------------------------------------------------------------------- 1 | import React, { useState } from 'react' 2 | import logo from './logo.svg' 3 | import './App.css' 4 | 5 | function App() { 6 | const [count, setCount] = useState(0) 7 | 8 | return ( 9 |
10 |
11 | logo 12 |

Hello Vite + React!

13 |

14 | 15 |

16 |

17 | Edit App.jsx and save to test HMR updates. 18 |

19 | 25 | Learn React 26 | 27 |
28 |
29 | ) 30 | } 31 | 32 | export default App 33 | -------------------------------------------------------------------------------- /template-react/src/index.css: -------------------------------------------------------------------------------- 1 | body { 2 | margin: 0; 3 | font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen", 4 | "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", 5 | sans-serif; 6 | -webkit-font-smoothing: antialiased; 7 | -moz-osx-font-smoothing: grayscale; 8 | } 9 | 10 | code { 11 | font-family: source-code-pro, Menlo, Monaco, Consolas, "Courier New", 12 | monospace; 13 | } 14 | -------------------------------------------------------------------------------- /template-react/src/logo.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /template-react/src/main.jsx: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import ReactDOM from 'react-dom' 3 | import './index.css' 4 | import App from './App' 5 | 6 | ReactDOM.render( 7 | 8 | 9 | , 10 | document.getElementById('root') 11 | ) 12 | -------------------------------------------------------------------------------- /template-react/vite.config.js: -------------------------------------------------------------------------------- 1 | // @ts-check 2 | import reactPlugin from 'vite-plugin-react' 3 | 4 | /** 5 | * @type { import('vite').UserConfig } 6 | */ 7 | const config = { 8 | jsx: 'react', 9 | plugins: [reactPlugin] 10 | } 11 | 12 | export default config 13 | -------------------------------------------------------------------------------- /template-reason-react/_gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | .merlin 3 | .bsb.lock 4 | npm-debug.log 5 | lib/bs 6 | node_modules 7 | bundleOutput 8 | dist 9 | dist-ssr 10 | *.local -------------------------------------------------------------------------------- /template-reason-react/bsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "vite-reason-react-starter", 3 | "reason": { 4 | "react-jsx": 3 5 | }, 6 | "sources": { 7 | "dir": "src", 8 | "subdirs": true 9 | }, 10 | "bsc-flags": [ 11 | "-bs-super-errors", 12 | "-bs-no-version-header" 13 | ], 14 | "package-specs": [ 15 | { 16 | "module": "es6", 17 | "in-source": true 18 | } 19 | ], 20 | "suffix": ".bs.js", 21 | "namespace": true, 22 | "bs-dependencies": [ 23 | "reason-react" 24 | ], 25 | "refmt": 3 26 | // You can uncomment the next warnings sections to get a stricter compilation. 27 | // e.g: fail compilation on non exhaustive pattern matches and other goodies. 28 | // For more information please refer to this blog post: 29 | // https://dev.to/yawaramin/ocaml-reasonml-best-practice-warnings-and-errors-4mkm 30 | // "warnings": { 31 | // "number": "+A-48", 32 | // "error": "+A-3-44-102" 33 | // } 34 | } -------------------------------------------------------------------------------- /template-reason-react/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Vite App 7 | 8 | 9 | 10 |
11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /template-reason-react/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "vite-reason-react-starter", 3 | "version": "0.0.0", 4 | "scripts": { 5 | "dev": "run-p re:watch vite:serve", 6 | "build": "run-s re:build vite:build", 7 | "vite:serve": "vite", 8 | "vite:build": "vite build", 9 | "re:build": "bsb -make-world -clean-world", 10 | "re:watch": "bsb -make-world -clean-world -w", 11 | "re:clean": "bsb -clean-world" 12 | }, 13 | "dependencies": { 14 | "react": "^17.0.0", 15 | "react-dom": "^17.0.0" 16 | }, 17 | "devDependencies": { 18 | "bs-platform": "^8.3.3", 19 | "npm-run-all": "^4.1.5", 20 | "reason-react": "^0.9.1", 21 | "vite": "^1.0.0-rc.13", 22 | "vite-plugin-react": "^4.0.1" 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /template-reason-react/src/App.css: -------------------------------------------------------------------------------- 1 | .App { 2 | text-align: center; 3 | } 4 | 5 | .App-logo { 6 | height: 40vmin; 7 | pointer-events: none; 8 | } 9 | 10 | @media (prefers-reduced-motion: no-preference) { 11 | .App-logo { 12 | animation: App-logo-spin infinite 20s linear; 13 | } 14 | } 15 | 16 | .App-header { 17 | background-color: #282c34; 18 | min-height: 100vh; 19 | display: flex; 20 | flex-direction: column; 21 | align-items: center; 22 | justify-content: center; 23 | font-size: calc(10px + 2vmin); 24 | color: white; 25 | } 26 | 27 | .App-link { 28 | color: #61dafb; 29 | } 30 | 31 | @keyframes App-logo-spin { 32 | from { 33 | transform: rotate(0deg); 34 | } 35 | to { 36 | transform: rotate(360deg); 37 | } 38 | } 39 | 40 | button { 41 | font-size: calc(10px + 2vmin); 42 | } 43 | -------------------------------------------------------------------------------- /template-reason-react/src/App.re: -------------------------------------------------------------------------------- 1 | %raw 2 | "import './App.css'"; 3 | 4 | [@bs.module "./logo.svg"] external logo: string = "default"; 5 | 6 | [@react.component] 7 | let make = () => { 8 | let (count, setCount) = React.useState(() => 0); 9 |
10 |
11 | logo 12 |

{React.string("Hello Vite + Reason React?fesfesf")}

13 |

14 | 17 |

18 |

19 | {React.string("Edit ")} 20 | {React.string("App.jsx ")} 21 | {React.string("and save to test HMR updates.")} 22 |

23 | 28 | {React.string("Learn Reason React")} 29 | 30 |
31 |
; 32 | }; 33 | -------------------------------------------------------------------------------- /template-reason-react/src/Index.re: -------------------------------------------------------------------------------- 1 | [%%raw "import './index.css'"]; 2 | 3 | ReactDOMRe.renderToElementWithId(, "root"); -------------------------------------------------------------------------------- /template-reason-react/src/index.css: -------------------------------------------------------------------------------- 1 | body { 2 | margin: 0; 3 | font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen", 4 | "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", 5 | sans-serif; 6 | -webkit-font-smoothing: antialiased; 7 | -moz-osx-font-smoothing: grayscale; 8 | } 9 | 10 | code { 11 | font-family: source-code-pro, Menlo, Monaco, Consolas, "Courier New", 12 | monospace; 13 | } 14 | -------------------------------------------------------------------------------- /template-reason-react/src/logo.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /template-reason-react/vite.config.js: -------------------------------------------------------------------------------- 1 | // @ts-check 2 | import reactPlugin from 'vite-plugin-react' 3 | 4 | /** 5 | * @type { import('vite').UserConfig } 6 | */ 7 | const config = { 8 | jsx: 'react', 9 | plugins: [reactPlugin] 10 | } 11 | 12 | export default config 13 | -------------------------------------------------------------------------------- /template-vue-ts/_gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | .DS_Store 3 | dist 4 | dist-ssr 5 | *.local 6 | -------------------------------------------------------------------------------- /template-vue-ts/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Vite App 8 | 9 | 10 |
11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /template-vue-ts/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "vite-vue-typescript-starter", 3 | "version": "0.0.0", 4 | "scripts": { 5 | "dev": "vite", 6 | "build": "vuedx-typecheck . && vite build" 7 | }, 8 | "dependencies": { 9 | "vue": "^3.0.4" 10 | }, 11 | "devDependencies": { 12 | "@vue/compiler-sfc": "^3.0.4", 13 | "@vuedx/typecheck": "^0.3.1-insiders-1606311019.0", 14 | "@vuedx/typescript-plugin-vue": "^0.3.1-insiders-1606311019.0", 15 | "typescript": "^4.1.2", 16 | "vite": "^1.0.0-rc.13" 17 | } 18 | } -------------------------------------------------------------------------------- /template-vue-ts/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vitejs/create-vite-app/7b1c46dab57d14abd5f36941fe867a3d45e7c6af/template-vue-ts/public/favicon.ico -------------------------------------------------------------------------------- /template-vue-ts/src/App.vue: -------------------------------------------------------------------------------- 1 | 5 | 6 | 17 | -------------------------------------------------------------------------------- /template-vue-ts/src/assets/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vitejs/create-vite-app/7b1c46dab57d14abd5f36941fe867a3d45e7c6af/template-vue-ts/src/assets/logo.png -------------------------------------------------------------------------------- /template-vue-ts/src/components/HelloWorld.vue: -------------------------------------------------------------------------------- 1 | 30 | 31 | 48 | -------------------------------------------------------------------------------- /template-vue-ts/src/index.css: -------------------------------------------------------------------------------- 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 | } 9 | -------------------------------------------------------------------------------- /template-vue-ts/src/main.ts: -------------------------------------------------------------------------------- 1 | import { createApp } from 'vue' 2 | import App from './App.vue' 3 | import './index.css' 4 | 5 | createApp(App).mount('#app') 6 | -------------------------------------------------------------------------------- /template-vue-ts/src/vue-app-env.d.ts: -------------------------------------------------------------------------------- 1 | declare namespace NodeJS { 2 | interface Process { 3 | env: ProcessEnv 4 | } 5 | interface ProcessEnv { 6 | /** 7 | * By default, there are two modes in Vite: 8 | * 9 | * * `development` is used by vite and vite serve 10 | * * `production` is used by vite build 11 | * 12 | * You can overwrite the default mode used for a command by passing the --mode option flag. 13 | * 14 | */ 15 | readonly NODE_ENV: 'development' | 'production' 16 | } 17 | } 18 | 19 | declare var process: NodeJS.Process 20 | 21 | declare module '*.gif' { 22 | const src: string 23 | export default src 24 | } 25 | 26 | declare module '*.jpg' { 27 | const src: string 28 | export default src 29 | } 30 | 31 | declare module '*.jpeg' { 32 | const src: string 33 | export default src 34 | } 35 | 36 | declare module '*.png' { 37 | const src: string 38 | export default src 39 | } 40 | 41 | declare module '*.webp' { 42 | const src: string 43 | export default src 44 | } 45 | 46 | declare module '*.svg' { 47 | const src: string 48 | export default src 49 | } 50 | 51 | declare module '*.module.css' { 52 | const classes: { readonly [key: string]: string } 53 | export default classes 54 | } 55 | 56 | declare module '*.module.scss' { 57 | const classes: { readonly [key: string]: string } 58 | export default classes 59 | } 60 | 61 | declare module '*.module.sass' { 62 | const classes: { readonly [key: string]: string } 63 | export default classes 64 | } 65 | -------------------------------------------------------------------------------- /template-vue-ts/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "esnext", 4 | "module": "esnext", 5 | "moduleResolution": "node", 6 | "strict": true, 7 | "jsx": "preserve", 8 | "sourceMap": true, 9 | "lib": ["esnext", "dom"], 10 | "plugins": [{ "name": "@vuedx/typescript-plugin-vue" }] 11 | }, 12 | "include": ["src/**/*.ts", "src/**/*.d.ts", "src/**/*.tsx", "src/**/*.vue"] 13 | } 14 | -------------------------------------------------------------------------------- /template-vue/_gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | .DS_Store 3 | dist 4 | dist-ssr 5 | *.local -------------------------------------------------------------------------------- /template-vue/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Vite App 8 | 9 | 10 |
11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /template-vue/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "vite-starter", 3 | "version": "0.0.0", 4 | "scripts": { 5 | "dev": "vite", 6 | "build": "vite build" 7 | }, 8 | "dependencies": { 9 | "vue": "^3.0.4" 10 | }, 11 | "devDependencies": { 12 | "vite": "^1.0.0-rc.13", 13 | "@vue/compiler-sfc": "^3.0.4" 14 | } 15 | } -------------------------------------------------------------------------------- /template-vue/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vitejs/create-vite-app/7b1c46dab57d14abd5f36941fe867a3d45e7c6af/template-vue/public/favicon.ico -------------------------------------------------------------------------------- /template-vue/src/App.vue: -------------------------------------------------------------------------------- 1 | 5 | 6 | 16 | -------------------------------------------------------------------------------- /template-vue/src/assets/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vitejs/create-vite-app/7b1c46dab57d14abd5f36941fe867a3d45e7c6af/template-vue/src/assets/logo.png -------------------------------------------------------------------------------- /template-vue/src/components/HelloWorld.vue: -------------------------------------------------------------------------------- 1 | 6 | 7 | 20 | -------------------------------------------------------------------------------- /template-vue/src/index.css: -------------------------------------------------------------------------------- 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 | } 9 | -------------------------------------------------------------------------------- /template-vue/src/main.js: -------------------------------------------------------------------------------- 1 | import { createApp } from 'vue' 2 | import App from './App.vue' 3 | import './index.css' 4 | 5 | createApp(App).mount('#app') 6 | -------------------------------------------------------------------------------- /updateVersions.js: -------------------------------------------------------------------------------- 1 | const fs = require('fs-extra') 2 | const path = require('path') 3 | 4 | ;(async () => { 5 | const templates = (await fs.readdir(__dirname)).filter((d) => 6 | d.startsWith('template-') 7 | ) 8 | for (const t of templates) { 9 | const pkgPath = path.join(__dirname, t, `package.json`) 10 | const pkg = require(pkgPath) 11 | pkg.devDependencies.vite = `^` + require('../vite/package.json').version 12 | if (t === 'template-vue') { 13 | pkg.dependencies.vue = `^` + require('../vue-next/package.json').version 14 | pkg.devDependencies['@vue/compiler-sfc'] = pkg.dependencies.vue 15 | } 16 | await fs.writeFile(pkgPath, JSON.stringify(pkg, null, 2)) 17 | } 18 | })() 19 | -------------------------------------------------------------------------------- /yarn.lock: -------------------------------------------------------------------------------- 1 | # THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. 2 | # yarn lockfile v1 3 | 4 | 5 | at-least-node@^1.0.0: 6 | version "1.0.0" 7 | resolved "https://registry.yarnpkg.com/at-least-node/-/at-least-node-1.0.0.tgz#602cd4b46e844ad4effc92a8011a3c46e0238dc2" 8 | integrity sha512-+q/t7Ekv1EDY2l6Gda6LLiX14rU9TV20Wa3ofeQmwPFZbOMo9DXrLbOjFaaclkXKWidIaopwAObQDqwWtGUjqg== 9 | 10 | fs-extra@^9.0.0: 11 | version "9.0.0" 12 | resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-9.0.0.tgz#b6afc31036e247b2466dc99c29ae797d5d4580a3" 13 | integrity sha512-pmEYSk3vYsG/bF651KPUXZ+hvjpgWYw/Gc7W9NFUe3ZVLczKKWIij3IKpOrQcdw4TILtibFslZ0UmR8Vvzig4g== 14 | dependencies: 15 | at-least-node "^1.0.0" 16 | graceful-fs "^4.2.0" 17 | jsonfile "^6.0.1" 18 | universalify "^1.0.0" 19 | 20 | graceful-fs@^4.1.6, graceful-fs@^4.2.0: 21 | version "4.2.4" 22 | resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.4.tgz#2256bde14d3632958c465ebc96dc467ca07a29fb" 23 | integrity sha512-WjKPNJF79dtJAVniUlGGWHYGz2jWxT6VhN/4m1NdkbZ2nOsEF+cI1Edgql5zCRhs/VsQYRvrXctxktVXZUkixw== 24 | 25 | jsonfile@^6.0.1: 26 | version "6.0.1" 27 | resolved "https://registry.yarnpkg.com/jsonfile/-/jsonfile-6.0.1.tgz#98966cba214378c8c84b82e085907b40bf614179" 28 | integrity sha512-jR2b5v7d2vIOust+w3wtFKZIfpC2pnRmFAhAC/BuweZFQR8qZzxH1OyrQ10HmdVYiXWkYUqPVsz91cG7EL2FBg== 29 | dependencies: 30 | universalify "^1.0.0" 31 | optionalDependencies: 32 | graceful-fs "^4.1.6" 33 | 34 | minimist@^1.2.5: 35 | version "1.2.5" 36 | resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.5.tgz#67d66014b66a6a8aaa0c083c5fd58df4e4e97602" 37 | integrity sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw== 38 | 39 | universalify@^1.0.0: 40 | version "1.0.0" 41 | resolved "https://registry.yarnpkg.com/universalify/-/universalify-1.0.0.tgz#b61a1da173e8435b2fe3c67d29b9adf8594bd16d" 42 | integrity sha512-rb6X1W158d7pRQBg5gkR8uPaSfiids68LTJQYOtEUhoJUWBdaQHsuT/EUduxXYxcrt4r5PJ4fuHW1MHT6p0qug== 43 | --------------------------------------------------------------------------------