-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathnext.config.js
More file actions
26 lines (23 loc) · 1010 Bytes
/
Copy pathnext.config.js
File metadata and controls
26 lines (23 loc) · 1010 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
/** @type {import('next').NextConfig} */
const { readFileSync, existsSync, rmSync } = require('fs');
const packageJson = JSON.parse(readFileSync('./package.json', 'utf-8'));
// Clean previous build outputs so the type checker and file tracer don't scan old artifacts.
// electron/standalone-build must be removed too: if left in place, Next.js traces it into
// .next/standalone, and prepare-standalone.js then copies that nested copy back in, so each
// build adds another nested layer (installer bloat + broken ESLint tsconfig resolution).
for (const dir of ['./dist', './electron/standalone-build']) {
if (existsSync(dir)) {
rmSync(dir, { recursive: true, force: true });
}
}
const nextConfig = {
output: process.env.VERCEL ? undefined : 'standalone',
allowedDevOrigins: ['http://localhost:3001', 'http://127.0.0.1:3001'],
turbopack: {
root: process.cwd(),
},
env: {
NEXT_PUBLIC_APP_VERSION: packageJson.version,
},
};
module.exports = nextConfig;