From 67113d0f336dd4fce0a0d57cb022cf21fd43bad3 Mon Sep 17 00:00:00 2001 From: Sebastiandg7 Date: Thu, 17 Dec 2020 12:32:15 -0500 Subject: [PATCH] fix(build): include media queries config only if valid extract CSS mediaquieres styles for every entrypoint given a media-queries.config.js configuration --- .../src/webpack/configs/common.config.ts | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/packages/nx-shopify/src/webpack/configs/common.config.ts b/packages/nx-shopify/src/webpack/configs/common.config.ts index 443ff1e..33ca13f 100644 --- a/packages/nx-shopify/src/webpack/configs/common.config.ts +++ b/packages/nx-shopify/src/webpack/configs/common.config.ts @@ -65,16 +65,16 @@ function getExtraPlugins(options: BuildBuilderOptions) { } if (mediaQueriesConfig) { - console.log('Media quieries are: ', mediaQueriesConfig); - const mediaQueries = require(mediaQueriesConfig); - extraPlugins.push( - new MediaQueryPlugin({ - include: /.*/, - queries: mediaQueries, - }) - ); + if (typeof mediaQueries === 'object' && mediaQueries !== null) { + extraPlugins.push( + new MediaQueryPlugin({ + include: /.*/, + queries: mediaQueries, + }) + ); + } } return extraPlugins;