CYBERCLOUD/next.config.mjs

36 lines
853 B
JavaScript
Raw Permalink Normal View History

2025-09-16 11:32:59 +08:00
/** @type {import('next').NextConfig} */
const isExport = process.env.NEXT_OUTPUT_MODE === 'export';
/** @type {import('next').NextConfig} */
const nextConfig = {
distDir: 'build',
output: isExport ? 'export' : 'standalone',
trailingSlash: isExport,
...(!isExport && {
async redirects() {
return [
{
source: '/',
destination: '/zh',
permanent: false,
},
];
},
async rewrites() {
return [
{
source: '/zh-tw',
destination: '/tw',
},
{
source: '/zh-hk',
destination: '/tw',
},
];
},
}),
};
export default nextConfig;