Skip to content

Commit ff82ff6

Browse files
committed
refactor
1 parent 31582a9 commit ff82ff6

File tree

4 files changed

+31
-16
lines changed

4 files changed

+31
-16
lines changed

config/build/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,8 @@ const filesConfig : esbuild.BuildOptions = {
6262
},
6363
plugins: [
6464
esbuildPluginSass({
65-
type: "css-text",
66-
transform: (source) => args.develop ? source : minify(source).css
65+
type: "local-css",
66+
transform: (source) => args.develop ? source : minify(source)
6767
}),
6868
esbuildPluginSolidJs({solid: {moduleName: '@solid-js/web'}})
6969
],

src/client/app/index.html

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,7 @@
55
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
66
<title>Home</title>
77
<link rel="shortcut icon" href="./assets/favicon.svg" type="image/x-icon" />
8-
<link rel="stylesheet" href="/bundle.css" />
8+
<script type="module" src="./bundle.js" defer></script>
99
</head>
10-
<body>
11-
<h1 class="title">Home</h1>
12-
<img class="logo" src="/-/solidjs_logo.svg" alt="SolidJS Logo" />
13-
</body>
10+
<body id="root"></body>
1411
</html>

src/client/app/index.scss

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,19 +6,19 @@
66
padding: 0;
77
}
88

9-
body {
9+
.app {
1010
display: grid;
1111
padding: 100px;
1212
height: 100vh;
1313
justify-content: center;
1414
background-color: #e0e0e0;
15-
}
1615

17-
.title {
18-
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
19-
text-align: center;
20-
}
16+
.title {
17+
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
18+
text-align: center;
19+
}
2120

22-
.logo {
23-
width: 250px;
21+
.logo {
22+
width: 250px;
23+
}
2424
}

src/client/app/index.tsx

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,21 @@
11
import styles from './index.scss'
22

3-
console.log(styles)
3+
import { render } from "@solid-js/web";
4+
import { createSignal, type JSXElement } from "@solid-js";
5+
6+
function App() : JSXElement {
7+
const [count, setCount] = createSignal(1);
8+
const increment = () => setCount(count => count + 1);
9+
10+
return (
11+
<div class='app'>
12+
<h1 class='title'>Home</h1>
13+
<img class='logo' src='/-/solidjs_logo.svg' alt='SolidJS Logo' />
14+
<button type='button' onClick={increment}>
15+
{count()}
16+
</button>
17+
</div>
18+
);
19+
}
20+
21+
render(() => <App/>, document.getElementById("root")!);

0 commit comments

Comments
 (0)