From 55d206b735b00991d2952b4c077dfc2f85f23fa4 Mon Sep 17 00:00:00 2001 From: t-kelly Date: Tue, 16 Oct 2018 09:14:08 -0400 Subject: [PATCH] Fix cssVarLoader running on development build --- packages/slate-tools/tools/webpack/config/parts/css.js | 3 +-- packages/slate-tools/tools/webpack/config/parts/sass.js | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/packages/slate-tools/tools/webpack/config/parts/css.js b/packages/slate-tools/tools/webpack/config/parts/css.js index 4241b7ae9..ed3bd825a 100644 --- a/packages/slate-tools/tools/webpack/config/parts/css.js +++ b/packages/slate-tools/tools/webpack/config/parts/css.js @@ -43,8 +43,7 @@ const postcssLoader = { const cssVarLoader = {loader: '@shopify/slate-cssvar-loader'}; cssRule.use = [ - isDev ? styleLoader : MiniCssExtractPlugin.loader, - cssVarLoader, + ...(isDev ? [styleLoader] : [MiniCssExtractPlugin.loader, cssVarLoader]), cssLoader, postcssLoader, ]; diff --git a/packages/slate-tools/tools/webpack/config/parts/sass.js b/packages/slate-tools/tools/webpack/config/parts/sass.js index 2029c28d2..16cdc63e4 100644 --- a/packages/slate-tools/tools/webpack/config/parts/sass.js +++ b/packages/slate-tools/tools/webpack/config/parts/sass.js @@ -47,8 +47,7 @@ const sassLoader = { }; sassRule.use = [ - isDev ? styleLoader : MiniCssExtractPlugin.loader, - cssVarLoader, + ...(isDev ? [styleLoader] : [MiniCssExtractPlugin.loader, cssVarLoader]), cssLoader, postcssLoader, sassLoader,