frontend/next.config.js (view raw)
1const {i18n} = require('./react-i18next.config');
2const {NODE_ENV, STRAPI_URL = 'http://localhost:1337', DEFAULT_LOCALE = 'share'} = process.env;
3
4const withPWA = require('next-pwa')({
5 dest: 'public',
6 disable: NODE_ENV !== 'production',
7});
8
9module.exports = withPWA({
10 swcMinify: true,
11 eslint: {
12 ignoreDuringBuilds: true,
13 },
14 typescript: {
15 ignoreBuildErrors: true,
16 },
17 env: {
18 STRAPI_URL: process.env.STRAPI_URL,
19 DEFAULT_LOCALE
20 },
21 i18n,
22
23 trailingSlash: true,
24 async rewrites() {
25 return [
26 {
27 source: '/graphql',
28 destination: `${STRAPI_URL}/graphql`,
29 },
30 {
31 source: '/api/nauth/:slug*',
32 destination: `/api/nauth/:slug*`,
33 },
34 {
35 source: '/api/:slug*',
36 destination: `${STRAPI_URL}/api/:slug*`,
37 },
38 {
39 source: '/admin/:slug*',
40 destination: `${STRAPI_URL}/admin/:slug*`,
41 },
42 {
43 source: '/i18n/:slug*',
44 destination: `${STRAPI_URL}/i18n/:slug*`,
45 },
46 {
47 source: '/content-manager/:slug*',
48 destination: `${STRAPI_URL}/content-manager/:slug*`,
49 },
50 {
51 source: '/email-designer/:slug*',
52 destination: `${STRAPI_URL}/email-designer/:slug*`,
53 },
54 ];
55 },
56});