forked from akai/readest
942524c110
* chore: disable PWA in dev mode for better performance * mobile: fix annotator tools in iOS browsers
30 lines
930 B
JavaScript
30 lines
930 B
JavaScript
import withPWA from 'next-pwa';
|
|
|
|
const isDev = process.env['NODE_ENV'] === 'development';
|
|
const appPlatform = process.env['NEXT_PUBLIC_APP_PLATFORM'];
|
|
|
|
/** @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: appPlatform === 'web' ? undefined : 'export',
|
|
// 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: '',
|
|
reactStrictMode: true,
|
|
};
|
|
|
|
export default withPWA({
|
|
dest: 'public',
|
|
disable: isDev || appPlatform !== 'web',
|
|
register: true,
|
|
skipWaiting: true,
|
|
})(nextConfig);
|