Fix ES module error - use CommonJS for main process

- Removed 'type: module' from package.json
- Added postbuild script to create CommonJS package.json in dist/main
- Fixed main entry path
This commit is contained in:
alper 2025-12-01 00:58:42 +03:00
parent 4c3d3c6961
commit 0f84450205
5 changed files with 4 additions and 4 deletions

Binary file not shown.

View File

@ -1 +1 @@
Portable Mode Enabled
Portable Mode

View File

@ -2,14 +2,14 @@
"name": "ip-monitor",
"version": "1.0.0",
"description": "Modern IP Monitor Desktop Application",
"main": "dist/main/main/index.js",
"type": "module",
"main": "dist/main/index.js",
"scripts": {
"dev": "concurrently \"npm run dev:vite\" \"npm run dev:electron\"",
"dev:vite": "vite",
"dev:electron": "wait-on tcp:5173 && cross-env NODE_ENV=development electron .",
"build": "npm run build:main && npm run build:renderer",
"build": "npm run build:main && npm run build:renderer && npm run postbuild",
"build:main": "tsc -p tsconfig.main.json",
"postbuild": "echo {\"type\":\"commonjs\"} > dist/main/package.json",
"build:renderer": "vite build",
"build:electron": "npm run build && electron-builder --win",
"build:portable": "npm run build && electron-builder --win portable",