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