mirror of
https://github.com/beilunyang/moemail.git
synced 2025-12-24 11:30:51 +08:00
40 lines
860 B
TypeScript
40 lines
860 B
TypeScript
import withPWA from 'next-pwa'
|
|
import createNextIntlPlugin from 'next-intl/plugin'
|
|
import { setupDevPlatform } from '@cloudflare/next-on-pages/next-dev';
|
|
|
|
async function setup() {
|
|
if (process.env.NODE_ENV === 'development') {
|
|
await setupDevPlatform()
|
|
}
|
|
}
|
|
|
|
setup()
|
|
|
|
const withNextIntl = createNextIntlPlugin('./app/i18n/request.ts')
|
|
|
|
const nextConfig = {
|
|
images: {
|
|
remotePatterns: [
|
|
{
|
|
protocol: 'https',
|
|
hostname: 'avatars.githubusercontent.com',
|
|
},
|
|
{
|
|
protocol: 'https',
|
|
hostname: '*.googleusercontent.com',
|
|
}
|
|
],
|
|
},
|
|
};
|
|
|
|
const withPWAConfigured = withPWA({
|
|
dest: 'public',
|
|
register: true,
|
|
skipWaiting: true,
|
|
disable: process.env.NODE_ENV === 'development',
|
|
}) as any
|
|
|
|
const configWithPWA = withPWAConfigured(nextConfig as any) as any
|
|
|
|
export default withNextIntl(configWithPWA)
|