mirror of
https://github.com/readest/readest.git
synced 2026-05-03 14:00:54 +00:00
32 lines
1 KiB
JavaScript
32 lines
1 KiB
JavaScript
/** @type {import('next').NextConfig} */
|
|
const isProd = process.env.NODE_ENV === 'production';
|
|
|
|
const internalHost = process.env.TAURI_DEV_HOST || 'localhost';
|
|
|
|
/** @type {import('next').NextConfig} */
|
|
const nextConfig = {
|
|
// Ensure Next.js uses SSG instead of SSR
|
|
// https://nextjs.org/docs/pages/building-your-application/deploying/static-exports
|
|
output: process.env['NEXT_PUBLIC_APP_PLATFORM'] === 'web' ? undefined : 'output',
|
|
// Note: This feature is required to use the Next.js Image component in SSG mode.
|
|
// See https://nextjs.org/docs/messages/export-image-api for different workarounds.
|
|
images: {
|
|
unoptimized: true,
|
|
},
|
|
devIndicators: {
|
|
appIsrStatus: false,
|
|
},
|
|
// Configure assetPrefix or else the server won't properly resolve your assets.
|
|
assetPrefix: isProd ? '' : `http://${internalHost}:3000`,
|
|
reactStrictMode: true,
|
|
async rewrites() {
|
|
return [
|
|
{
|
|
source: '/api/deepl/:path*',
|
|
destination: 'https://api-free.deepl.com/v2/:path*',
|
|
},
|
|
];
|
|
},
|
|
};
|
|
|
|
export default nextConfig;
|