27 lines
699 B
TypeScript
Executable File
27 lines
699 B
TypeScript
Executable File
import type { NextConfig } from "next";
|
|
|
|
// 静态导出开关:BUILD_EXPORT=true 时启用 output:export + basePath
|
|
// 这样 dev 服务器不受影响,仅构建静态资源时切换配置
|
|
const isExport = process.env.BUILD_EXPORT === "true";
|
|
|
|
const nextConfig: NextConfig = {
|
|
output: isExport ? "export" : "standalone",
|
|
// 部署到 https://gitea-pages.atdunbg.xyz/Super_Z/echo-nexus 时需要 basePath
|
|
...(isExport
|
|
? {
|
|
basePath: "/Super_Z/echo-nexus",
|
|
trailingSlash: true,
|
|
}
|
|
: {}),
|
|
images: {
|
|
unoptimized: true,
|
|
},
|
|
/* config options here */
|
|
typescript: {
|
|
ignoreBuildErrors: true,
|
|
},
|
|
reactStrictMode: false,
|
|
};
|
|
|
|
export default nextConfig;
|