From beba604bd7ff12819bb83a3425108190b321d76d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20FAMIBELLE-PRONZOLA?= Date: Wed, 26 Jan 2022 07:09:27 +0400 Subject: [PATCH] Config next/image and add domains to env --- .env.sample | 3 +++ next.config.js | 7 ++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/.env.sample b/.env.sample index aba048d..a4e79f7 100644 --- a/.env.sample +++ b/.env.sample @@ -57,3 +57,6 @@ NEXT_PUBLIC_PALE_USERNAME= NEXT_PUBLIC_GADE_USERNAME= NEXT_PUBLIC_YOUTUBE_USERNAME= NEXT_PUBLIC_TELEGRAM_GROUP= + +# DOMAIN IMAGE +NEXT_PUBLIC_DOMAINS_IMAGE="example.com example2.com" diff --git a/next.config.js b/next.config.js index 9dd5e95..8decde7 100644 --- a/next.config.js +++ b/next.config.js @@ -1,5 +1,7 @@ const withPWA = require('next-pwa') +const domains = process.env.NEXT_PUBLIC_DOMAINS_IMAGE.split(' ') || 'localhost' + module.exports = withPWA({ pwa: { disable: process.env.NODE_ENV !== 'production', @@ -7,5 +9,8 @@ module.exports = withPWA({ register: true, skipWaiting: true, }, - swcMinify: true + swcMinify: true, + images: { + domains + } })