File tree Expand file tree Collapse file tree 4 files changed +42
-24
lines changed Expand file tree Collapse file tree 4 files changed +42
-24
lines changed Original file line number Diff line number Diff line change 1
1
import React from "react" ;
2
2
import ReactDOM from "react-dom/client" ;
3
- import { HashRouter , Routes , Route } from "react-router-dom" ;
3
+ import { createHashRouter , RouterProvider } from "react-router-dom" ;
4
4
import { initializeIcons } from "@fluentui/react" ;
5
5
6
6
import "./index.css" ;
7
7
8
8
import Layout from "./pages/layout/Layout" ;
9
- import NoPage from "./pages/NoPage" ;
10
- import OneShot from "./pages/oneshot/OneShot" ;
11
9
import Chat from "./pages/chat/Chat" ;
12
10
13
11
initializeIcons ( ) ;
14
12
15
- export default function App ( ) {
16
- return (
17
- < HashRouter >
18
- < Routes >
19
- < Route path = "/" element = { < Layout /> } >
20
- < Route index element = { < Chat /> } />
21
- < Route path = "qa" element = { < OneShot /> } />
22
- < Route path = "*" element = { < NoPage /> } />
23
- </ Route >
24
- </ Routes >
25
- </ HashRouter >
26
- ) ;
27
- }
13
+ const router = createHashRouter ( [
14
+ {
15
+ path : "/" ,
16
+ element : < Layout /> ,
17
+ children : [
18
+ {
19
+ index : true ,
20
+ element : < Chat />
21
+ } ,
22
+ {
23
+ path : "qa" ,
24
+ lazy : ( ) => import ( "./pages/oneshot/OneShot" )
25
+ } ,
26
+ {
27
+ path : "*" ,
28
+ lazy : ( ) => import ( "./pages/NoPage" )
29
+ }
30
+ ]
31
+ }
32
+ ] ) ;
28
33
29
34
ReactDOM . createRoot ( document . getElementById ( "root" ) as HTMLElement ) . render (
30
35
< React . StrictMode >
31
- < App />
36
+ < RouterProvider router = { router } />
32
37
</ React . StrictMode >
33
38
) ;
Original file line number Diff line number Diff line change 1
- const NoPage = ( ) => {
1
+ export function Component ( ) : JSX . Element {
2
2
return < h1 > 404</ h1 > ;
3
- } ;
3
+ }
4
4
5
- export default NoPage ;
5
+ Component . displayName = " NoPage" ;
Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ import { ExampleList } from "../../components/Example";
10
10
import { AnalysisPanel , AnalysisPanelTabs } from "../../components/AnalysisPanel" ;
11
11
import { SettingsButton } from "../../components/SettingsButton/SettingsButton" ;
12
12
13
- const OneShot = ( ) => {
13
+ export function Component ( ) : JSX . Element {
14
14
const [ isConfigPanelOpen , setIsConfigPanelOpen ] = useState ( false ) ;
15
15
const [ approach , setApproach ] = useState < Approaches > ( Approaches . RetrieveThenRead ) ;
16
16
const [ promptTemplate , setPromptTemplate ] = useState < string > ( "" ) ;
@@ -246,6 +246,6 @@ const OneShot = () => {
246
246
</ Panel >
247
247
</ div >
248
248
) ;
249
- } ;
249
+ }
250
250
251
- export default OneShot ;
251
+ Component . displayName = " OneShot" ;
Original file line number Diff line number Diff line change @@ -7,7 +7,20 @@ export default defineConfig({
7
7
build : {
8
8
outDir : "../backend/static" ,
9
9
emptyOutDir : true ,
10
- sourcemap : true
10
+ sourcemap : true ,
11
+ rollupOptions : {
12
+ output : {
13
+ manualChunks : id => {
14
+ if ( id . includes ( "@fluentui/react-icons" ) ) {
15
+ return "fluentui-icons" ;
16
+ } else if ( id . includes ( "@fluentui/react" ) ) {
17
+ return "fluentui-react" ;
18
+ } else if ( id . includes ( "node_modules" ) ) {
19
+ return "vendor" ;
20
+ }
21
+ }
22
+ }
23
+ }
11
24
} ,
12
25
server : {
13
26
proxy : {
You can’t perform that action at this time.
0 commit comments