build(vite): resolve @/ alias in main + preload configs
The four renderer vite configs all resolve "@" to ./src; main and preload didn't, so any main-reachable file using @/ imports would break the bundle. Mirror the same alias block in both configs and revert lib/errors.ts + src/main/* to the project's @/ convention.
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
import { z } from "zod";
|
import { z } from "zod";
|
||||||
import { appEnv } from "../config/env";
|
import { appEnv } from "@/config/env";
|
||||||
|
|
||||||
export class ApiError extends Error {
|
export class ApiError extends Error {
|
||||||
constructor(
|
constructor(
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { ipcMain, type IpcMainInvokeEvent } from "electron";
|
import { ipcMain, type IpcMainInvokeEvent } from "electron";
|
||||||
import { reportError } from "../lib/errors";
|
import { reportError } from "@/lib/errors";
|
||||||
|
|
||||||
type InvokeHandler = (
|
type InvokeHandler = (
|
||||||
event: IpcMainInvokeEvent,
|
event: IpcMainInvokeEvent,
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import { app } from "electron";
|
import { app } from "electron";
|
||||||
import * as Sentry from "@sentry/electron/main";
|
import * as Sentry from "@sentry/electron/main";
|
||||||
import { appConfig } from "../config/env";
|
import { appConfig } from "@/config/env";
|
||||||
import { installErrorSinks } from "../lib/errors";
|
import { installErrorSinks } from "@/lib/errors";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Initialise Sentry for the main process. Captures uncaught exceptions from
|
* Initialise Sentry for the main process. Captures uncaught exceptions from
|
||||||
|
|||||||
@@ -1,7 +1,13 @@
|
|||||||
|
import path from "path";
|
||||||
import { defineConfig } from 'vite';
|
import { defineConfig } from 'vite';
|
||||||
import { defineEnv } from './vite.env';
|
import { defineEnv } from './vite.env';
|
||||||
|
|
||||||
// https://vitejs.dev/config
|
// https://vitejs.dev/config
|
||||||
export default defineConfig({
|
export default defineConfig({
|
||||||
|
resolve: {
|
||||||
|
alias: {
|
||||||
|
"@": path.resolve(__dirname, "./src"),
|
||||||
|
},
|
||||||
|
},
|
||||||
define: defineEnv,
|
define: defineEnv,
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -1,7 +1,13 @@
|
|||||||
|
import path from "path";
|
||||||
import { defineConfig } from 'vite';
|
import { defineConfig } from 'vite';
|
||||||
import { defineEnv } from './vite.env';
|
import { defineEnv } from './vite.env';
|
||||||
|
|
||||||
// https://vitejs.dev/config
|
// https://vitejs.dev/config
|
||||||
export default defineConfig({
|
export default defineConfig({
|
||||||
|
resolve: {
|
||||||
|
alias: {
|
||||||
|
"@": path.resolve(__dirname, "./src"),
|
||||||
|
},
|
||||||
|
},
|
||||||
define: defineEnv,
|
define: defineEnv,
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user