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