File tree 9 files changed +79
-0
lines changed
9 files changed +79
-0
lines changed Original file line number Diff line number Diff line change
1
+ import { useState } from 'react'
2
+ import "./assets/index.css"
3
+ function App ( ) {
4
+ const [ count , setCount ] = useState ( 0 )
5
+ return (
6
+ < div className = "App" >
7
+ < button onClick = { ( ) => setCount ( ( count ) => count + 1 ) } >
8
+ count is { count }
9
+ </ button >
10
+ </ div >
11
+ )
12
+ }
13
+ export default App
Original file line number Diff line number Diff line change
1
+ : root {background-color : # fff }
Original file line number Diff line number Diff line change
1
+ {
2
+ "template" : " tests/example/templates/tpl.html"
3
+ }
Original file line number Diff line number Diff line change
1
+ import React from 'react'
2
+ import ReactDOM from 'react-dom/client'
3
+ import App from './App'
4
+
5
+ ReactDOM . createRoot ( document . getElementById ( 'root' ) ) . render (
6
+ < React . StrictMode >
7
+ < App />
8
+ </ React . StrictMode > ,
9
+ )
Original file line number Diff line number Diff line change
1
+ import { useState } from 'react'
2
+ function App ( ) {
3
+ const [ count , setCount ] = useState ( 0 )
4
+ return (
5
+ < div className = "App" >
6
+ < button onClick = { ( ) => setCount ( ( count ) => count + 1 ) } >
7
+ count is { count }
8
+ </ button >
9
+ </ div >
10
+ )
11
+ }
12
+ export default App
Original file line number Diff line number Diff line change
1
+ {
2
+ "template" : " tests/example/templates/tpl.html"
3
+ }
Original file line number Diff line number Diff line change
1
+ import React from 'react'
2
+ import ReactDOM from 'react-dom/client'
3
+ import App from './App'
4
+
5
+ ReactDOM . createRoot ( document . getElementById ( 'root' ) ) . render (
6
+ < React . StrictMode >
7
+ < App />
8
+ </ React . StrictMode > ,
9
+ )
Original file line number Diff line number Diff line change
1
+ <!DOCTYPE html>
2
+ < html lang ="en ">
3
+
4
+ < head >
5
+ < meta charset ="UTF-8 " />
6
+ < meta name ="viewport " content ="width=device-width, initial-scale=1.0 " />
7
+ < title > Minimal React Vite Project</ title >
8
+ </ head >
9
+
10
+ < body >
11
+ < div id ="root "> </ div >
12
+ < script type ="module " src ="/src/main.jsx "> </ script >
13
+ </ body >
14
+
15
+ </ html >
Original file line number Diff line number Diff line change
1
+ import { defineConfig } from 'vite'
2
+ import react from '@vitejs/plugin-react'
3
+ import autoMpaHTMLPlugin from '../../lib/index'
4
+
5
+ // https://vitejs.dev/config/
6
+ export default defineConfig ( {
7
+ plugins : [ react ( ) , autoMpaHTMLPlugin ( {
8
+ sourceDir : "src" ,
9
+ configName : "config.json" ,
10
+ entryName : "main.jsx" ,
11
+ sharedData : { } ,
12
+ ejsOption : { } ,
13
+ } ) ] ,
14
+ } )
You can’t perform that action at this time.
0 commit comments