From e43345f17f2b467b27fb46ae72b8fe092bbf4c49 Mon Sep 17 00:00:00 2001 From: David Berlin Date: Mon, 4 Mar 2024 08:37:19 +0200 Subject: [PATCH 1/2] feat: introduce env var to include dev server plugin --- src/commands/dev/dev.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/commands/dev/dev.ts b/src/commands/dev/dev.ts index b10d02a1c9c..da13b3eccc2 100644 --- a/src/commands/dev/dev.ts +++ b/src/commands/dev/dev.ts @@ -137,6 +137,11 @@ export const dev = async (options: OptionValues, command: BaseCommand) => { try { settings = await detectServerSettings(devConfig, options, command) + if (process.env.NETLIFY_INCLUDE_DEV_SERVER_PLUGIN) { + log(`${NETLIFYDEVLOG} Including dev server plugin`) + settings.plugins = [...(settings.plugins || []), '@netlify/plugin-dev-server'] + } + cachedConfig.config = getConfigWithPlugins(cachedConfig.config, settings) } catch (error_) { if (error_ && typeof error_ === 'object' && 'message' in error_) { From 03d9cd479747c9851c5833cb34a23de078a5b822 Mon Sep 17 00:00:00 2001 From: David Berlin <47757213+davbree@users.noreply.github.com> Date: Mon, 4 Mar 2024 14:35:02 +0200 Subject: [PATCH 2/2] fix: log message only in debug --- src/commands/dev/dev.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/commands/dev/dev.ts b/src/commands/dev/dev.ts index da13b3eccc2..cd19954465b 100644 --- a/src/commands/dev/dev.ts +++ b/src/commands/dev/dev.ts @@ -138,7 +138,9 @@ export const dev = async (options: OptionValues, command: BaseCommand) => { settings = await detectServerSettings(devConfig, options, command) if (process.env.NETLIFY_INCLUDE_DEV_SERVER_PLUGIN) { - log(`${NETLIFYDEVLOG} Including dev server plugin`) + if (options.debug) { + log(`${NETLIFYDEVLOG} Including dev server plugin`) + } settings.plugins = [...(settings.plugins || []), '@netlify/plugin-dev-server'] }