File tree Expand file tree Collapse file tree 14 files changed +74
-32
lines changed Expand file tree Collapse file tree 14 files changed +74
-32
lines changed Original file line number Diff line number Diff line change
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.0 " />
6
+ < title > Example (React)</ title >
7
+ </ head >
8
+ < body >
9
+ < div id ="react-app "> </ div >
10
+ < script type ="module " src ="/src/main.ts "> </ script >
11
+ </ body >
12
+ </ html >
Original file line number Diff line number Diff line change
1
+ {
2
+ "private" : true ,
3
+ "type" : " module" ,
4
+ "scripts" : {
5
+ "build" : " vite build" ,
6
+ "dev" : " vite"
7
+ },
8
+ "devDependencies" : {
9
+ "@tanstack/react-query" : " ^4.29.12" ,
10
+ "@tanstack/react-query-devtools" : " ^4.29.12" ,
11
+ "@types/node" : " ^18.7.23" ,
12
+ "@types/react" : " ^18.2.21" ,
13
+ "@types/react-dom" : " ^18.2.7" ,
14
+ "@vitejs/plugin-react" : " ^4.0.0" ,
15
+ "react" : " ^18.2.0" ,
16
+ "react-dom" : " ^18.2.0" ,
17
+ "typescript" : " ^5.0.0" ,
18
+ "vite" : " ^4.0.0" ,
19
+ "vite-plugin-node-polyfills" : " workspace:*"
20
+ }
21
+ }
Original file line number Diff line number Diff line change @@ -10,29 +10,22 @@ function App() {
10
10
11
11
return (
12
12
< div className = 'App' >
13
- < h1 > React + Vite</ h1 >
14
- < h2 > On CodeSandbox!</ h2 >
15
- < div className = 'card' >
13
+ < h1 > Example (React)</ h1 >
14
+ < p > The following app includes React Query DevTools (see below) to assert that this plugin does not conflict with it.</ p >
15
+ < p > Here is a dynamic counter to test that React works as expected.</ p >
16
+ < p >
16
17
< button onClick = { ( ) => setCount ( ( count ) => count + 1 ) } >
17
18
count is { count }
18
19
</ button >
19
- < p >
20
- Edit < code > src/App.tsx</ code > and save to test HMR.
21
- </ p >
22
-
23
- < p >
24
- Tip: you can use the inspector button next to address bar to click on
25
- components in the preview and open the code in the editor!
26
- </ p >
27
- </ div >
28
- < p className = 'read-the-docs' >
29
- Click on the Vite and React logos to learn more
20
+ </ p >
21
+ < p >
22
+ The following text is encoded and decoded with Buffer: { Buffer . from ( 'Hello!' ) . toString ( ) }
30
23
</ p >
31
24
</ div >
32
25
)
33
26
}
34
27
35
- export const react = ( ) => {
28
+ export const app = ( ) => {
36
29
ReactDOM . createRoot ( document . getElementById ( 'react-app' ) as HTMLElement ) . render (
37
30
< React . StrictMode >
38
31
< QueryClientProvider client = { queryClient } >
Original file line number Diff line number Diff line change
1
+ /// <reference types="vite/client" />
Original file line number Diff line number Diff line change
1
+ import { app } from './app'
2
+
3
+ app ( )
Original file line number Diff line number Diff line change
1
+ {
2
+ "compilerOptions" : {
3
+ "jsx" : " react-jsx" ,
4
+ "module" : " ESNext" ,
5
+ "moduleResolution" : " Bundler"
6
+ }
7
+ }
Original file line number Diff line number Diff line change
1
+ import react from '@vitejs/plugin-react'
2
+ import { defineConfig } from 'vite'
3
+ import { nodePolyfills } from 'vite-plugin-node-polyfills'
4
+
5
+ // https://vitejs.dev/config/
6
+ export default defineConfig ( {
7
+ plugins : [
8
+ nodePolyfills ( ) ,
9
+ react ( ) ,
10
+ ] ,
11
+ } )
Original file line number Diff line number Diff line change 50
50
},
51
51
"packageManager" :
" [email protected] " ,
52
52
"devDependencies" : {
53
- "@tanstack/react-query" : " ^4.29.12" ,
54
- "@tanstack/react-query-devtools" : " ^4.29.12" ,
55
- "@types/node" : " ^18.7.23" ,
56
- "@vitejs/plugin-react" : " ^4.0.0" ,
53
+ "@types/node" : " ^18.17.15" ,
57
54
"@vitejs/plugin-vue" : " ^4.2.3" ,
58
- "esbuild" : " ^0.16.16 " ,
55
+ "esbuild" : " ^0.18.20 " ,
59
56
"npm-run-all" : " ^4.1.5" ,
60
57
"ohmyfetch" : " ^0.4.20" ,
61
- "react" : " ^18.2.0" ,
62
- "react-dom" : " ^18.2.0" ,
63
- "rollup" : " ^3.8.1" ,
58
+ "rollup" : " ^3.29.1" ,
64
59
"typescript" : " 4.8.3" ,
65
- "vite" : " ^4.0.4 " ,
66
- "vite-node" : " ^0.34.1 " ,
60
+ "vite" : " ^4.4.9 " ,
61
+ "vite-node" : " ^0.34.4 " ,
67
62
"vite-plugin-externalize-deps" : " ^0.1.5" ,
68
63
"vite-plugin-inspect" : " ^0.6.0" ,
69
64
"vite-plugin-node-polyfills" : " workspace:*" ,
Original file line number Diff line number Diff line change 1
1
workspaces :
2
2
- ' .'
3
+ - ' ./examples/*'
Original file line number Diff line number Diff line change 3
3
< head >
4
4
< meta charset ="UTF-8 " />
5
5
< meta name ="viewport " content ="width=device-width, initial-scale=1.0 " />
6
- < title > Example</ title >
6
+ < title > Example (Vue) </ title >
7
7
</ head >
8
8
< body >
9
- < div id ="react-app "> </ div >
10
9
< div id ="vue-app "> </ div >
11
10
< script type ="module " src ="/src/main.ts "> </ script >
12
11
</ body >
You can’t perform that action at this time.
0 commit comments