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 async rewrites() {
24 return [
25 {
26 source: '/graphql',
27 destination: `${STRAPI_URL}/graphql`,
28 },
29 {
30 source: '/api/nauth/:slug*',
31 destination: `/api/nauth/:slug*`,
32 },
33 {
34 source: '/api/:slug*',
35 destination: `${STRAPI_URL}/api/:slug*`,
36 },
37 {
38 source: '/admin/:slug*',
39 destination: `${STRAPI_URL}/admin/:slug*`,
40 },
41 {
42 source: '/i18n/:slug*',
43 destination: `${STRAPI_URL}/i18n/:slug*`,
44 },
45 {
46 source: '/content-manager/:slug*',
47 destination: `${STRAPI_URL}/content-manager/:slug*`,
48 },
49 {
50 source: '/email-designer/:slug*',
51 destination: `${STRAPI_URL}/email-designer/:slug*`,
52 },
53 ];
54 },
55});