File tree Expand file tree Collapse file tree 2 files changed +35
-20
lines changed
Expand file tree Collapse file tree 2 files changed +35
-20
lines changed Original file line number Diff line number Diff line change @@ -12,26 +12,29 @@ import {
1212 TASK_EXTRACTION_PROMPT ,
1313} from "./transcription-prompts.js" ;
1414
15- let FileConstructor : typeof File ;
16- try {
17- const { File : NodeFile } = await import ( "node:buffer" ) ;
18- FileConstructor = NodeFile as typeof File ;
19- } catch {
20- FileConstructor = class File extends Blob {
21- name : string ;
22- lastModified : number ;
23-
24- constructor ( bits : BlobPart [ ] , name : string , options ?: FilePropertyBag ) {
25- super ( bits , options ) ;
26- this . name = name ;
27- this . lastModified = options ?. lastModified ?? Date . now ( ) ;
28- }
29- } as typeof File ;
30- }
15+ const fallbackFile = class File extends Blob {
16+ name : string ;
17+ lastModified : number ;
18+
19+ constructor ( bits : BlobPart [ ] , name : string , options ?: FilePropertyBag ) {
20+ super ( bits , options ) ;
21+ this . name = name ;
22+ this . lastModified = options ?. lastModified ?? Date . now ( ) ;
23+ }
24+ } as typeof File ;
3125
32- if ( ! globalThis . File ) {
33- globalThis . File = FileConstructor ;
34- }
26+ ( async ( ) => {
27+ let FileConstructor : typeof File ;
28+ try {
29+ FileConstructor = ( await import ( "node:buffer" ) ) . File as typeof File ;
30+ } catch {
31+ FileConstructor = fallbackFile ;
32+ }
33+
34+ if ( ! globalThis . File ) {
35+ globalThis . File = FileConstructor ;
36+ }
37+ } ) ( ) ;
3538
3639interface RecordingSession {
3740 id : string ;
Original file line number Diff line number Diff line change 11import { copyFileSync , mkdirSync } from "node:fs" ;
2- import { join } from "node:path" ;
2+ import path , { join } from "node:path" ;
3+ import { fileURLToPath } from "node:url" ;
34import { defineConfig , type Plugin } from "vite" ;
45
6+ const __dirname = path . dirname ( fileURLToPath ( import . meta. url ) ) ;
7+
58/**
69 * Custom Vite plugin to fix circular __filename references in bundled ESM packages.
710 *
@@ -56,6 +59,15 @@ function copyAgentTemplates(): Plugin {
5659
5760export default defineConfig ( {
5861 plugins : [ fixFilenameCircularRef ( ) , copyAgentTemplates ( ) ] ,
62+ resolve : {
63+ alias : {
64+ "@" : path . resolve ( __dirname , "./src" ) ,
65+ "@main" : path . resolve ( __dirname , "./src/main" ) ,
66+ "@renderer" : path . resolve ( __dirname , "./src/renderer" ) ,
67+ "@shared" : path . resolve ( __dirname , "./src/shared" ) ,
68+ "@api" : path . resolve ( __dirname , "./src/api" ) ,
69+ } ,
70+ } ,
5971 build : {
6072 target : "node18" ,
6173 minify : false , // Disable minification to prevent variable name conflicts
You can’t perform that action at this time.
0 commit comments