From f46f4e539e1bff414085295abaa900413e983da9 Mon Sep 17 00:00:00 2001 From: "devid.farinelli@gmail.com" Date: Sat, 20 Apr 2019 19:53:04 +0200 Subject: [PATCH] fix(genrators/utils/style): typo & fix --- packages/generators/utils/style.ts | 60 ++++++++++++------------------ 1 file changed, 24 insertions(+), 36 deletions(-) diff --git a/packages/generators/utils/style.ts b/packages/generators/utils/style.ts index 5a642932f97..cc07306d3c0 100644 --- a/packages/generators/utils/style.ts +++ b/packages/generators/utils/style.ts @@ -42,25 +42,22 @@ export default function style(self, stylingType) { self.dependencies.push( Loader.CSS, ); - if (self.isProf) { + if (!self.isProd) { self.dependencies.push( Loader.STYLE, ); + ExtractUseProps.push( + { + loader: `"${Loader.STYLE}"`, + }, + ); } - ExtractUseProps.push({ loader: `"${Loader.CSS}"`, options: { sourceMap: true, }, }); - if (!self.isProd) { - ExtractUseProps.push( - { - loader: `"${Loader.STYLE}"`, - }, - ); - } break; case StylingType.SASS: @@ -71,12 +68,16 @@ export default function style(self, stylingType) { Loader.SASS, Loader.CSS, ); - if (self.isProf) { + if (!self.isProd) { self.dependencies.push( Loader.STYLE, ); + ExtractUseProps.push( + { + loader: `"${Loader.STYLE}"`, + }, + ); } - ExtractUseProps.push( { loader: `"${Loader.CSS}"`, @@ -91,13 +92,6 @@ export default function style(self, stylingType) { }, }, ); - if (!self.isProd) { - ExtractUseProps.push( - { - loader: `"${Loader.STYLE}"`, - }, - ); - } break; case StylingType.LESS: @@ -108,12 +102,16 @@ export default function style(self, stylingType) { Loader.LESS, Loader.CSS, ); - if (self.isProf) { + if (!self.isProd) { self.dependencies.push( Loader.STYLE, ); + ExtractUseProps.push( + { + loader: `"${Loader.STYLE}"`, + }, + ); } - ExtractUseProps.push( { loader: `"${Loader.CSS}"`, @@ -128,13 +126,6 @@ export default function style(self, stylingType) { }, }, ); - if (!self.isProd) { - ExtractUseProps.push( - { - loader: `"${Loader.STYLE}"`, - }, - ); - } break; case StylingType.PostCSS: @@ -153,12 +144,16 @@ export default function style(self, stylingType) { Loader.CSS, Loader.POSTCSS, ); - if (self.isProf) { + if (!self.isProd) { self.dependencies.push( Loader.STYLE, ); + ExtractUseProps.push( + { + loader: `"${Loader.STYLE}"`, + }, + ); } - ExtractUseProps.push( { loader: `"${Loader.CSS}"`, @@ -179,13 +174,6 @@ export default function style(self, stylingType) { }, }, ); - if (!self.isProd) { - ExtractUseProps.push( - { - loader: `"${Loader.STYLE}"`, - }, - ); - } break; } return { ExtractUseProps, regExpForStyles };