From 8b253fe2f203ac0e3a0126118a9fd150ad1a4aef Mon Sep 17 00:00:00 2001 From: Kostiantyn Voskoboinik Date: Fri, 17 Jun 2022 12:40:01 +0300 Subject: [PATCH 1/4] Delete assets config --- next.config.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/next.config.js b/next.config.js index 6b39cfeb1..e6c31d417 100644 --- a/next.config.js +++ b/next.config.js @@ -17,14 +17,12 @@ const readLegacyConfig = async (filepath = './legacy.config.yml') => { return legacyConfig } -const isProd = process.env.NODE_ENV === 'production' const nextConfig = { env: Object.assign(envConfig, { GA_CODE: process.env.GA_CODE, GITHUB_TOKEN: process.env.GITHUB_TOKEN, }), - assetPrefix: isProd ? 'https://core.ac.uk' : '', - dynamicAssetPrefix: true, + webpack: (config) => { const originalEntry = config.entry config.entry = async () => { From 120f0c23d9df736bfa9dfdf061d5b08762aa6d8d Mon Sep 17 00:00:00 2001 From: Kostiantyn Voskoboinik Date: Fri, 17 Jun 2022 14:17:12 +0300 Subject: [PATCH 2/4] Update asset prefix --- next.config.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/next.config.js b/next.config.js index e6c31d417..a81c03869 100644 --- a/next.config.js +++ b/next.config.js @@ -17,12 +17,13 @@ const readLegacyConfig = async (filepath = './legacy.config.yml') => { return legacyConfig } +const isProd = process.env.NODE_ENV === 'production' const nextConfig = { env: Object.assign(envConfig, { GA_CODE: process.env.GA_CODE, GITHUB_TOKEN: process.env.GITHUB_TOKEN, }), - + assetPrefix: isProd ? 'https://core.ac.uk' : '', webpack: (config) => { const originalEntry = config.entry config.entry = async () => { From 07bbbe0adc4f192d7fa84e8f56275c6cc33f2e18 Mon Sep 17 00:00:00 2001 From: Kostiantyn Voskoboinik Date: Fri, 17 Jun 2022 14:29:11 +0300 Subject: [PATCH 3/4] change prefix --- next.config.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/next.config.js b/next.config.js index a81c03869..497ba74dc 100644 --- a/next.config.js +++ b/next.config.js @@ -23,7 +23,7 @@ const nextConfig = { GA_CODE: process.env.GA_CODE, GITHUB_TOKEN: process.env.GITHUB_TOKEN, }), - assetPrefix: isProd ? 'https://core.ac.uk' : '', + assetPrefix: isProd && 'https://core.ac.uk', webpack: (config) => { const originalEntry = config.entry config.entry = async () => { From acdc3144a760991845aae1214ef86ae6450b87cd Mon Sep 17 00:00:00 2001 From: Kostiantyn Voskoboinik Date: Fri, 17 Jun 2022 15:05:16 +0300 Subject: [PATCH 4/4] update dynamicAssetPrefix status --- next.config.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/next.config.js b/next.config.js index 497ba74dc..fea27338b 100644 --- a/next.config.js +++ b/next.config.js @@ -23,7 +23,8 @@ const nextConfig = { GA_CODE: process.env.GA_CODE, GITHUB_TOKEN: process.env.GITHUB_TOKEN, }), - assetPrefix: isProd && 'https://core.ac.uk', + assetPrefix: isProd ? 'https://core.ac.uk' : '', + dynamicAssetPrefix: !!isProd, webpack: (config) => { const originalEntry = config.entry config.entry = async () => {