vite项目映入会报错:
import { ConfigEntities } from '@shared/db-entities/Config'
已经在electron.vite.config.ts配置了:
import { defineConfig, externalizeDepsPlugin } from 'electron-vite'
import react from '@vitejs/plugin-react'
import path from 'path'
export default defineConfig({
main: {
resolve: {
alias: {
'@main': path.resolve(__dirname, 'src/main'),
'@preload': path.resolve(__dirname, 'src/preload'),
'@renderer': path.resolve(__dirname, 'src/main'),
'@shared': path.resolve(__dirname, 'src/shared')
}
},
plugins: [externalizeDepsPlugin()]
},
preload: {
resolve: {
alias: {
'@main': path.resolve(__dirname, 'src/main'),
'@preload': path.resolve(__dirname, 'src/preload'),
'@renderer': path.resolve(__dirname, 'src/main'),
'@shared': path.resolve(__dirname, 'src/shared')
}
},
plugins: [externalizeDepsPlugin()]
},
renderer: {
resolve: {
alias: {
'@main': path.resolve(__dirname, 'src/main'),
'@preload': path.resolve(__dirname, 'src/preload'),
'@renderer': path.resolve(__dirname, 'src/main'),
'@shared': path.resolve(__dirname, 'src/shared')
}
},
plugins: [react()]
}
})
但是为何还是会提示错误呢?