Skip to content

Commit b9dba0c

Browse files
committed
initial commit
0 parents  commit b9dba0c

13 files changed

+1148
-0
lines changed

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
node_modules
2+
dist

README.md

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
## Usage
2+
3+
Those templates dependencies are maintained via [pnpm](https://pnpm.io) via `pnpm up -Lri`.
4+
5+
This is the reason you see a `pnpm-lock.yaml`. That being said, any package manager will work. This file can be safely be removed once you clone a template.
6+
7+
```bash
8+
$ npm install # or pnpm install or yarn install
9+
```
10+
11+
### Learn more on the [Solid Website](https://solidjs.com) and come chat with us on our [Discord](https://discord.com/invite/solidjs)
12+
13+
## Available Scripts
14+
15+
In the project directory, you can run:
16+
17+
### `npm run dev` or `npm start`
18+
19+
Runs the app in the development mode.<br>
20+
Open [http://localhost:3000](http://localhost:3000) to view it in the browser.
21+
22+
The page will reload if you make edits.<br>
23+
24+
### `npm run build`
25+
26+
Builds the app for production to the `dist` folder.<br>
27+
It correctly bundles Solid in production mode and optimizes the build for the best performance.
28+
29+
The build is minified and the filenames include the hashes.<br>
30+
Your app is ready to be deployed!
31+
32+
## Deployment
33+
34+
You can deploy the `dist` folder to any static host provider (netlify, surge, now, etc.)

index.html

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="utf-8" />
5+
<meta name="viewport" content="width=device-width, initial-scale=1" />
6+
<meta name="theme-color" content="#000000" />
7+
<link rel="shortcut icon" type="image/ico" href="/src/assets/favicon.ico" />
8+
<title>Solid App</title>
9+
</head>
10+
<body>
11+
<noscript>You need to enable JavaScript to run this app.</noscript>
12+
<div id="root"></div>
13+
14+
<script src="/src/index.tsx" type="module"></script>
15+
</body>
16+
</html>

package.json

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{
2+
"name": "vite-template-solid",
3+
"version": "0.0.0",
4+
"description": "",
5+
"scripts": {
6+
"start": "vite",
7+
"dev": "vite",
8+
"build": "vite build",
9+
"serve": "vite preview"
10+
},
11+
"license": "MIT",
12+
"devDependencies": {
13+
"solid-devtools": "^0.27.3",
14+
"typescript": "^5.1.3",
15+
"vite": "^4.3.9",
16+
"vite-plugin-solid": "^2.7.0"
17+
},
18+
"dependencies": {
19+
"solid-js": "^1.7.6"
20+
}
21+
}

src/App.module.css

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
.App {
2+
text-align: center;
3+
}
4+
5+
.logo {
6+
animation: logo-spin infinite 20s linear;
7+
height: 40vmin;
8+
pointer-events: none;
9+
}
10+
11+
.header {
12+
background-color: #282c34;
13+
min-height: 100vh;
14+
display: flex;
15+
flex-direction: column;
16+
align-items: center;
17+
justify-content: center;
18+
font-size: calc(10px + 2vmin);
19+
color: white;
20+
}
21+
22+
.link {
23+
color: #b318f0;
24+
}
25+
26+
@keyframes logo-spin {
27+
from {
28+
transform: rotate(0deg);
29+
}
30+
to {
31+
transform: rotate(360deg);
32+
}
33+
}

src/App.tsx

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
import type { Component } from 'solid-js';
2+
3+
import logo from './logo.svg';
4+
import styles from './App.module.css';
5+
6+
const App: Component = () => {
7+
return (
8+
<div class={styles.App}>
9+
<header class={styles.header}>
10+
<img src={logo} class={styles.logo} alt="logo" />
11+
<p>
12+
Edit <code>src/App.tsx</code> and save to reload.
13+
</p>
14+
<a
15+
class={styles.link}
16+
href="https://github.com/solidjs/solid"
17+
target="_blank"
18+
rel="noopener noreferrer"
19+
>
20+
Learn Solid
21+
</a>
22+
</header>
23+
</div>
24+
);
25+
};
26+
27+
export default App;

src/assets/favicon.ico

14.7 KB
Binary file not shown.

src/index.css

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
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+
}

src/index.tsx

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
/* @refresh reload */
2+
import { render } from 'solid-js/web';
3+
4+
import './index.css';
5+
import App from './App';
6+
7+
const root = document.getElementById('root');
8+
9+
if (import.meta.env.DEV && !(root instanceof HTMLElement)) {
10+
throw new Error(
11+
'Root element not found. Did you forget to add it to your index.html? Or maybe the id attribute got misspelled?',
12+
);
13+
}
14+
15+
render(() => <App />, root!);

src/logo.svg

+1
Loading

tsconfig.json

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"compilerOptions": {
3+
"strict": true,
4+
"target": "ESNext",
5+
"module": "ESNext",
6+
"moduleResolution": "node",
7+
"allowSyntheticDefaultImports": true,
8+
"esModuleInterop": true,
9+
"jsx": "preserve",
10+
"jsxImportSource": "solid-js",
11+
"types": ["vite/client"],
12+
"noEmit": true,
13+
"isolatedModules": true
14+
}
15+
}

vite.config.ts

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
import { defineConfig } from 'vite';
2+
import solidPlugin from 'vite-plugin-solid';
3+
// import devtools from 'solid-devtools/vite';
4+
5+
export default defineConfig({
6+
plugins: [
7+
/*
8+
Uncomment the following line to enable solid-devtools.
9+
For more info see https://github.com/thetarnav/solid-devtools/tree/main/packages/extension#readme
10+
*/
11+
// devtools(),
12+
solidPlugin(),
13+
],
14+
server: {
15+
port: 3000,
16+
},
17+
build: {
18+
target: 'esnext',
19+
},
20+
});

0 commit comments

Comments
 (0)