File tree Expand file tree Collapse file tree 2 files changed +15
-9
lines changed Expand file tree Collapse file tree 2 files changed +15
-9
lines changed Original file line number Diff line number Diff line change @@ -10,6 +10,8 @@ export default defineConfig(({ mode }) => {
10
10
const envs = loadEnv ( mode , CWD ) ;
11
11
return {
12
12
...envs ,
13
+ // Ensure Vite uses the app directory as root
14
+ root : fileURLToPath ( new URL ( './' , import . meta. url ) ) ,
13
15
cacheDir : '../../node_modules/.vite/chat-app' ,
14
16
server : {
15
17
port : 4200 ,
@@ -21,6 +23,12 @@ export default defineConfig(({ mode }) => {
21
23
] ,
22
24
} ,
23
25
} ,
26
+ build : {
27
+ rollupOptions : {
28
+ // Explicit entry to resolve index.html correctly when building via Nx
29
+ input : fileURLToPath ( new URL ( './index.html' , import . meta. url ) ) ,
30
+ } ,
31
+ } ,
24
32
plugins : [
25
33
vue ( ) ,
26
34
nxViteTsPaths ( ) ,
Original file line number Diff line number Diff line change @@ -14,15 +14,13 @@ const props = defineProps<{
14
14
documents: Array <ChatDocumentModel >
15
15
}>()
16
16
17
- const groupedDocuments = computed ((): ChatDocumentItemModel [] => {
18
- const documents = props .documents .map ((document ) => mapToDocumentItem (document ));
19
- const grouped = documents .reduce (
20
- (reduced : any , element : ChatDocumentItemModel ) => {
21
- reduced [element .title ] = reduced [element .title ] || [];
22
- reduced [element .title ].push (element );
23
- return reduced ;
24
- }, Object .create (null ));
25
- return grouped ;
17
+ const groupedDocuments = computed ((): Record <string , ChatDocumentItemModel []> => {
18
+ const items = props .documents .map ((document ) => mapToDocumentItem (document ));
19
+ return items .reduce ((acc : Record <string , ChatDocumentItemModel []>, element : ChatDocumentItemModel ) => {
20
+ if (! acc [element .title ]) acc [element .title ] = [];
21
+ acc [element .title ].push (element );
22
+ return acc ;
23
+ }, {});
26
24
});
27
25
</script >
28
26
<template >
You can’t perform that action at this time.
0 commit comments