refactor(electron): improve build process and configuration
- Enhance electron build configuration with proper asset handling - Add comprehensive logging and error tracking - Implement CSP headers for security - Fix module exports for logger compatibility - Update TypeScript and Vite configs for better build support - Improve development workflow with better dev tools integration
This commit is contained in:
@@ -3,7 +3,7 @@ import { logToDb } from "../db";
|
||||
function safeStringify(obj: unknown) {
|
||||
const seen = new WeakSet();
|
||||
|
||||
return JSON.stringify(obj, (key, value) => {
|
||||
return JSON.stringify(obj, (_key, value) => {
|
||||
if (typeof value === "object" && value !== null) {
|
||||
if (seen.has(value)) {
|
||||
return "[Circular]";
|
||||
@@ -69,3 +69,11 @@ export const logger = {
|
||||
logToDb(message + argsString);
|
||||
},
|
||||
};
|
||||
|
||||
// Add CommonJS export for Electron
|
||||
if (typeof module !== "undefined" && module.exports) {
|
||||
module.exports = { logger };
|
||||
}
|
||||
|
||||
// Add default export for ESM
|
||||
export default { logger };
|
||||
|
||||
Reference in New Issue
Block a user