File tree Expand file tree Collapse file tree 2 files changed +13
-1
lines changed
Expand file tree Collapse file tree 2 files changed +13
-1
lines changed 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