From 6ffcdf5c548b54660efa06f3bbcfcdb844010279 Mon Sep 17 00:00:00 2001 From: Vince Picone Date: Mon, 21 Sep 2020 11:57:06 -0500 Subject: [PATCH] fix: proper optional plugin syntax --- packages/gatsby-theme-carbon/gatsby-config.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/gatsby-theme-carbon/gatsby-config.js b/packages/gatsby-theme-carbon/gatsby-config.js index 887305cfc..7e2245bf0 100644 --- a/packages/gatsby-theme-carbon/gatsby-config.js +++ b/packages/gatsby-theme-carbon/gatsby-config.js @@ -26,7 +26,7 @@ module.exports = (themeOptions) => { isServiceWorkerEnabled = false, } = themeOptions; - const optionalPlugins = [isServiceWorkerEnabled && `gatsby-plugin-offline`]; + const optionalPlugins = []; if (mediumAccount) { optionalPlugins.push({ @@ -38,6 +38,10 @@ module.exports = (themeOptions) => { }); } + if (isServiceWorkerEnabled) { + optionalPlugins.push(`gatsby-plugin-offline`); + } + const defaultRemarkPlugins = [ { resolve: `gatsby-remark-unwrap-images` }, { resolve: `gatsby-remark-smartypants` },