Repository navigation
Expand file tree
/
Copy pathnext.config.js
More file actions
52 lines (47 loc) · 1.7 KB
/
Copy pathnext.config.js
File metadata and controls
52 lines (47 loc) · 1.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
/* eslint-disable @typescript-eslint/ban-ts-comment */
/* eslint-disable @typescript-eslint/no-unsafe-call */
/* eslint-disable @typescript-eslint/no-unsafe-assignment */
/**
* Run `build` or `dev` with `SKIP_ENV_VALIDATION` to skip env validation. This is especially useful
* for Docker builds.
*/
await import('./src/env.js');
/** @type {import("next").NextConfig} */
import pwa from 'next-pwa';
// eslint-disable-next-line @typescript-eslint/no-unsafe-call
const withPwa = pwa({
dest: 'public',
// Next 15 emits this build-only manifest; it isn't served, so precaching it breaks SW install
buildExcludes: [/dynamic-css-manifest\.json$/],
// Translations are fetched on demand, so most users never download them
publicExcludes: ['!noprecache/**/*', '!locales/**/*'],
// disable: process.env.NODE_ENV === 'development',
});
const config = {
reactStrictMode: true,
output: process.env.DOCKER_OUTPUT ? 'standalone' : undefined,
/**
* If you are using `appDir` then you must comment the below `i18n` config out.
*
* @see https://github.com/vercel/next.js/issues/41980
*/
i18n: {
locales: ['en'],
defaultLocale: 'en',
},
transpilePackages: ['geist'],
// Analytics runs on our own origin. Umami derives its collect endpoint from the directory the
// script was loaded from, so /stats/script.js fixes the second path.
async rewrites() {
return [
{ source: '/stats/script.js', destination: '/api/stats/script' },
{ source: '/stats/api/send', destination: '/api/stats/send' },
];
},
images: {
// Images are static assets or user-uploaded receipts; never run them through the optimizer
unoptimized: true,
},
};
// @ts-ignore
export default withPwa(config);