fix: resolve standalone symlinks and exclude electron from TS check
- Replace symlinks in .next/standalone with real copies for electron-builder - Exclude electron/, dist-electron/, scripts/, release/ from tsconfig - Use arm64 target instead of universal to avoid native module merge issues Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
1 parent
ff1fb38735
commit
85ec4f9b96
3 files changed
+28
-2
No files matched your search
@@ -25,4 +25,4 @@ mac:
|
||||
category: public.app-category.developer-tools
|
||||
target:
|
||||
- target: dmg
|
||||
arch: [universal]
|
||||
arch: [arm64]
|
||||
@@ -1,4 +1,27 @@
|
||||
import { build } from 'esbuild';
|
||||
import fs from 'fs';
|
||||
import path from 'path';
|
||||
|
||||
// Replace symlinks in standalone with real copies so electron-builder can package them
|
||||
function resolveStandaloneSymlinks() {
|
||||
const standaloneModules = '.next/standalone/.next/node_modules';
|
||||
if (!fs.existsSync(standaloneModules)) return;
|
||||
|
||||
const entries = fs.readdirSync(standaloneModules);
|
||||
for (const entry of entries) {
|
||||
const fullPath = path.join(standaloneModules, entry);
|
||||
const stat = fs.lstatSync(fullPath);
|
||||
if (stat.isSymbolicLink()) {
|
||||
const target = fs.readlinkSync(fullPath);
|
||||
const resolved = path.resolve(standaloneModules, target);
|
||||
if (fs.existsSync(resolved)) {
|
||||
fs.rmSync(fullPath);
|
||||
fs.cpSync(resolved, fullPath, { recursive: true });
|
||||
console.log(`Resolved symlink: ${entry} -> ${target}`);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
async function buildElectron() {
|
||||
const shared = {
|
||||
@@ -23,6 +46,9 @@ async function buildElectron() {
|
||||
});
|
||||
|
||||
console.log('Electron build complete');
|
||||
|
||||
// Fix standalone symlinks after next build
|
||||
resolveStandaloneSymlinks();
|
||||
}
|
||||
|
||||
buildElectron().catch((err) => {
|
||||
|
||||
+1
-1
@@ -30,5 +30,5 @@
|
||||
".next/dev/types/**/*.ts",
|
||||
"**/*.mts"
|
||||
],
|
||||
"exclude": ["node_modules"]
|
||||
"exclude": ["node_modules", "electron", "dist-electron", "scripts", "release"]
|
||||
}
|
||||
Reference in new issue
Block a user