diff --git a/docs/guide/index.md b/docs/guide/index.md
index a7ab75dbfe5fb8..c257e48ceef202 100644
--- a/docs/guide/index.md
+++ b/docs/guide/index.md
@@ -36,6 +36,7 @@ The supported template presets are:
| [preact](https://vite.new/preact) | [preact-ts](https://vite.new/preact-ts) |
| [lit](https://vite.new/lit) | [lit-ts](https://vite.new/lit-ts) |
| [svelte](https://vite.new/svelte) | [svelte-ts](https://vite.new/svelte-ts) |
+| [solid](https://vite.new/solid) | [solid-ts](https://vite.new/solid-ts) |
## Scaffolding Your First Vite Project
@@ -79,7 +80,7 @@ yarn create vite my-vue-app --template vue
pnpm create vite my-vue-app --template vue
```
-See [create-vite](https://github.com/vitejs/vite/tree/main/packages/create-vite) for more details on each supported template: `vanilla`, `vanilla-ts`, `vue`, `vue-ts`, `react`, `react-ts`, `react-swc`, `react-swc-ts`, `preact`, `preact-ts`, `lit`, `lit-ts`, `svelte`, `svelte-ts`.
+See [create-vite](https://github.com/vitejs/vite/tree/main/packages/create-vite) for more details on each supported template: `vanilla`, `vanilla-ts`, `vue`, `vue-ts`, `react`, `react-ts`, `react-swc`, `react-swc-ts`, `preact`, `preact-ts`, `lit`, `lit-ts`, `svelte`, `svelte-ts`, `solid`, `solid-ts`.
## Community Templates
diff --git a/packages/create-vite/README.md b/packages/create-vite/README.md
index 8df8f4e338f8cc..8776ab3c3aeb3c 100644
--- a/packages/create-vite/README.md
+++ b/packages/create-vite/README.md
@@ -57,6 +57,8 @@ Currently supported template presets include:
- `lit-ts`
- `svelte`
- `svelte-ts`
+- `solid`
+- `solid-ts`
You can use `.` for the project name to scaffold in the current directory.
diff --git a/packages/create-vite/src/index.ts b/packages/create-vite/src/index.ts
index 04e44a2c1f0429..a333bd1986a2b4 100755
--- a/packages/create-vite/src/index.ts
+++ b/packages/create-vite/src/index.ts
@@ -169,6 +169,23 @@ const FRAMEWORKS: Framework[] = [
},
],
},
+ {
+ name: 'solid',
+ display: 'Solid',
+ color: blue,
+ variants: [
+ {
+ name: 'solid-ts',
+ display: 'TypeScript',
+ color: blue,
+ },
+ {
+ name: 'solid',
+ display: 'JavaScript',
+ color: yellow,
+ },
+ ],
+ },
{
name: 'others',
display: 'Others',
diff --git a/packages/create-vite/template-solid-ts/README.md b/packages/create-vite/template-solid-ts/README.md
new file mode 100644
index 00000000000000..99613fc0a5d37f
--- /dev/null
+++ b/packages/create-vite/template-solid-ts/README.md
@@ -0,0 +1,28 @@
+## Usage
+
+```bash
+$ npm install # or pnpm install or yarn install
+```
+
+### Learn more on the [Solid Website](https://solidjs.com) and come chat with us on our [Discord](https://discord.com/invite/solidjs)
+
+## Available Scripts
+
+In the project directory, you can run:
+
+### `npm run dev`
+
+Runs the app in the development mode.
+Open [http://localhost:5173](http://localhost:5173) to view it in the browser.
+
+### `npm run build`
+
+Builds the app for production to the `dist` folder.
+It correctly bundles Solid in production mode and optimizes the build for the best performance.
+
+The build is minified and the filenames include the hashes.
+Your app is ready to be deployed!
+
+## Deployment
+
+Learn more about deploying your application with the [documentations](https://vitejs.dev/guide/static-deploy.html)
diff --git a/packages/create-vite/template-solid-ts/_gitignore b/packages/create-vite/template-solid-ts/_gitignore
new file mode 100644
index 00000000000000..a547bf36d8d11a
--- /dev/null
+++ b/packages/create-vite/template-solid-ts/_gitignore
@@ -0,0 +1,24 @@
+# Logs
+logs
+*.log
+npm-debug.log*
+yarn-debug.log*
+yarn-error.log*
+pnpm-debug.log*
+lerna-debug.log*
+
+node_modules
+dist
+dist-ssr
+*.local
+
+# Editor directories and files
+.vscode/*
+!.vscode/extensions.json
+.idea
+.DS_Store
+*.suo
+*.ntvs*
+*.njsproj
+*.sln
+*.sw?
diff --git a/packages/create-vite/template-solid-ts/index.html b/packages/create-vite/template-solid-ts/index.html
new file mode 100644
index 00000000000000..f399a33d3c7c09
--- /dev/null
+++ b/packages/create-vite/template-solid-ts/index.html
@@ -0,0 +1,13 @@
+
+
+
+ Edit src/App.tsx
and save to test HMR
+
+ Click on the Vite and Solid logos to learn more +
+ > + ) +} + +export default App diff --git a/packages/create-vite/template-solid-ts/src/assets/solid.svg b/packages/create-vite/template-solid-ts/src/assets/solid.svg new file mode 100644 index 00000000000000..025aa303c5e3a9 --- /dev/null +++ b/packages/create-vite/template-solid-ts/src/assets/solid.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/packages/create-vite/template-solid-ts/src/index.css b/packages/create-vite/template-solid-ts/src/index.css new file mode 100644 index 00000000000000..2c3fac689c7c46 --- /dev/null +++ b/packages/create-vite/template-solid-ts/src/index.css @@ -0,0 +1,69 @@ +:root { + font-family: Inter, system-ui, Avenir, Helvetica, Arial, sans-serif; + line-height: 1.5; + font-weight: 400; + + color-scheme: light dark; + color: rgba(255, 255, 255, 0.87); + background-color: #242424; + + font-synthesis: none; + text-rendering: optimizeLegibility; + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; + -webkit-text-size-adjust: 100%; +} + +a { + font-weight: 500; + color: #646cff; + text-decoration: inherit; +} +a:hover { + color: #535bf2; +} + +body { + margin: 0; + display: flex; + place-items: center; + min-width: 320px; + min-height: 100vh; +} + +h1 { + font-size: 3.2em; + line-height: 1.1; +} + +button { + border-radius: 8px; + border: 1px solid transparent; + padding: 0.6em 1.2em; + font-size: 1em; + font-weight: 500; + font-family: inherit; + background-color: #1a1a1a; + cursor: pointer; + transition: border-color 0.25s; +} +button:hover { + border-color: #646cff; +} +button:focus, +button:focus-visible { + outline: 4px auto -webkit-focus-ring-color; +} + +@media (prefers-color-scheme: light) { + :root { + color: #213547; + background-color: #ffffff; + } + a:hover { + color: #747bff; + } + button { + background-color: #f9f9f9; + } +} diff --git a/packages/create-vite/template-solid-ts/src/index.tsx b/packages/create-vite/template-solid-ts/src/index.tsx new file mode 100644 index 00000000000000..af7bf042c3ac05 --- /dev/null +++ b/packages/create-vite/template-solid-ts/src/index.tsx @@ -0,0 +1,9 @@ +/* @refresh reload */ +import { render } from 'solid-js/web' + +import './index.css' +import App from './App' + +const root = document.getElementById('root') + +render(() =>
+ Edit src/App.jsx
and save to test HMR
+
+ Click on the Vite and Solid logos to learn more +
+ > + ) +} + +export default App diff --git a/packages/create-vite/template-solid/src/assets/solid.svg b/packages/create-vite/template-solid/src/assets/solid.svg new file mode 100644 index 00000000000000..025aa303c5e3a9 --- /dev/null +++ b/packages/create-vite/template-solid/src/assets/solid.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/packages/create-vite/template-solid/src/index.css b/packages/create-vite/template-solid/src/index.css new file mode 100644 index 00000000000000..2c3fac689c7c46 --- /dev/null +++ b/packages/create-vite/template-solid/src/index.css @@ -0,0 +1,69 @@ +:root { + font-family: Inter, system-ui, Avenir, Helvetica, Arial, sans-serif; + line-height: 1.5; + font-weight: 400; + + color-scheme: light dark; + color: rgba(255, 255, 255, 0.87); + background-color: #242424; + + font-synthesis: none; + text-rendering: optimizeLegibility; + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; + -webkit-text-size-adjust: 100%; +} + +a { + font-weight: 500; + color: #646cff; + text-decoration: inherit; +} +a:hover { + color: #535bf2; +} + +body { + margin: 0; + display: flex; + place-items: center; + min-width: 320px; + min-height: 100vh; +} + +h1 { + font-size: 3.2em; + line-height: 1.1; +} + +button { + border-radius: 8px; + border: 1px solid transparent; + padding: 0.6em 1.2em; + font-size: 1em; + font-weight: 500; + font-family: inherit; + background-color: #1a1a1a; + cursor: pointer; + transition: border-color 0.25s; +} +button:hover { + border-color: #646cff; +} +button:focus, +button:focus-visible { + outline: 4px auto -webkit-focus-ring-color; +} + +@media (prefers-color-scheme: light) { + :root { + color: #213547; + background-color: #ffffff; + } + a:hover { + color: #747bff; + } + button { + background-color: #f9f9f9; + } +} diff --git a/packages/create-vite/template-solid/src/index.jsx b/packages/create-vite/template-solid/src/index.jsx new file mode 100644 index 00000000000000..ab0c0929b48615 --- /dev/null +++ b/packages/create-vite/template-solid/src/index.jsx @@ -0,0 +1,9 @@ +/* @refresh reload */ +import { render } from 'solid-js/web' + +import './index.css' +import App from './App' + +const root = document.getElementById('root') + +render(() =>