Skip to content

Commit

Permalink
fix(build): include media queries config only if valid
Browse files Browse the repository at this point in the history
extract CSS mediaquieres styles for every entrypoint given a media-queries.config.js configuration
  • Loading branch information
sebastiandg7 committed Dec 17, 2020
1 parent 0064c9f commit 67113d0
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions packages/nx-shopify/src/webpack/configs/common.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 67113d0

Please sign in to comment.