File tree Expand file tree Collapse file tree 9 files changed +33
-112
lines changed
Expand file tree Collapse file tree 9 files changed +33
-112
lines changed Original file line number Diff line number Diff line change 1717 "postcss" : " 8.4.16" ,
1818 "tailwindcss" : " 3.1.8" ,
1919 "typescript" : " 4.8.2" ,
20+ "vite-tsconfig-paths" : " 3.5.0" ,
2021 "vite" : " 3.1.0"
2122 }
2223}
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1- import { useState } from 'preact/hooks'
2- import preactLogo from './assets/preact.svg'
3- import './app.css'
1+ import { useState } from 'preact/hooks' ;
42
53export function App ( ) {
6- const [ count , setCount ] = useState ( 0 )
4+ const [ count , setCount ] = useState ( 0 ) ;
75
86 return (
9- < >
10- < div >
11- < a href = "https://vitejs.dev" target = "_blank" >
12- < img src = "/vite.svg" class = "logo" alt = "Vite logo" />
13- </ a >
14- < a href = "https://preactjs.com" target = "_blank" >
15- < img src = { preactLogo } class = "logo preact" alt = "Preact logo" />
16- </ a >
17- </ div >
18- < h1 > Vite + Preact</ h1 >
19- < div class = "card" >
20- < button onClick = { ( ) => setCount ( ( count ) => count + 1 ) } >
21- count is { count }
22- </ button >
23- < p >
24- Edit < code > src/app.tsx</ code > and save to test HMR
25- </ p >
26- </ div >
27- < p class = "read-the-docs" >
28- Click on the Vite and Preact logos to learn more
29- </ p >
30- </ >
31- )
7+ < div >
8+ < button onClick = { ( ) => setCount ( ( count ) => count + 1 ) } >
9+ count is { count }
10+ </ button >
11+ < h1 className = "text-3xl font-bold underline" > Hello world!</ h1 >
12+ </ div >
13+ ) ;
3214}
Load Diff This file was deleted.
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1- import { render } from 'preact'
2- import { App } from './app'
3- import './index.css'
1+ import { render } from 'preact' ;
42
5- render ( < App /> , document . getElementById ( 'app' ) as HTMLElement )
3+ // App =>
4+ import { App } from '@/app' ;
5+
6+ // Styles =>
7+ import '@/styles/globals.css' ;
8+
9+ render ( < App /> , document . getElementById ( 'app' ) as HTMLElement ) ;
Original file line number Diff line number Diff line change 1- import React from 'preact' ;
2-
31const Home = ( ) => {
4- return < div > index</ div > ;
2+ return (
3+ < div >
4+ < h1 > page</ h1 >
5+ </ div >
6+ ) ;
57} ;
68
79export default Home ;
Original file line number Diff line number Diff line change 1-
1+ @tailwind base;
2+ @tailwind components;
3+ @tailwind utilities;
Original file line number Diff line number Diff line change 1- import { defineConfig } from 'vite'
2- import preact from '@preact/preset-vite'
1+ import { defineConfig } from 'vite' ;
2+ import preact from '@preact/preset-vite' ;
3+
4+ // Plugins =>
5+ import tsconfigPaths from 'vite-tsconfig-paths' ;
36
4- // https://vitejs.dev/config/
57export default defineConfig ( {
6- plugins : [ preact ( ) ]
7- } )
8+ plugins : [ preact ( ) , tsconfigPaths ( ) ]
9+ } ) ;
You can’t perform that action at this time.
0 commit comments