mirror of
https://github.com/jeffvli/feishin.git
synced 2026-06-16 16:34:24 +02:00
fix all imports for new structure
This commit is contained in:
+30
-6
@@ -1,13 +1,41 @@
|
||||
import react from '@vitejs/plugin-react';
|
||||
import { externalizeDepsPlugin, UserConfig } from 'electron-vite';
|
||||
import { resolve } from 'path';
|
||||
import conditionalImportPlugin from 'vite-plugin-conditional-import';
|
||||
import dynamicImportPlugin from 'vite-plugin-dynamic-import';
|
||||
|
||||
const currentOSEnv = process.platform;
|
||||
|
||||
const config: UserConfig = {
|
||||
main: {
|
||||
plugins: [externalizeDepsPlugin()],
|
||||
define: {
|
||||
'import.meta.env.IS_LINUX': JSON.stringify(currentOSEnv === 'linux'),
|
||||
'import.meta.env.IS_MACOS': JSON.stringify(currentOSEnv === 'darwin'),
|
||||
'import.meta.env.IS_WIN': JSON.stringify(currentOSEnv === 'win32'),
|
||||
},
|
||||
plugins: [
|
||||
externalizeDepsPlugin(),
|
||||
dynamicImportPlugin(),
|
||||
conditionalImportPlugin({
|
||||
currentEnv: currentOSEnv,
|
||||
envs: ['win32', 'linux', 'darwin'],
|
||||
}),
|
||||
],
|
||||
resolve: {
|
||||
alias: {
|
||||
'/@/main': resolve('src/main'),
|
||||
'/@/shared': resolve('src/shared'),
|
||||
},
|
||||
},
|
||||
},
|
||||
preload: {
|
||||
plugins: [externalizeDepsPlugin()],
|
||||
resolve: {
|
||||
alias: {
|
||||
'/@/preload': resolve('src/preload'),
|
||||
'/@/shared': resolve('src/shared'),
|
||||
},
|
||||
},
|
||||
},
|
||||
renderer: {
|
||||
css: {
|
||||
@@ -20,12 +48,8 @@ const config: UserConfig = {
|
||||
resolve: {
|
||||
alias: {
|
||||
'/@/i18n': resolve('src/i18n'),
|
||||
'/@/main': resolve('src/main'),
|
||||
'/@/remote': resolve('src/remote'),
|
||||
'/@/renderer': resolve('src/renderer'),
|
||||
'/@/renderer/api': resolve('src/renderer/api'),
|
||||
'/@/renderer/components': resolve('src/renderer/components'),
|
||||
'/@/renderer/features': resolve('src/renderer/features'),
|
||||
'/@/renderer/hooks': resolve('src/renderer/hooks'),
|
||||
'/@/shared': resolve('src/shared'),
|
||||
},
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user