Skip to content

Commit

Permalink
fix(genrators/utils/style): typo & fix
Browse files Browse the repository at this point in the history
  • Loading branch information
misterdev committed May 28, 2019
1 parent 392fcfe commit f46f4e5
Showing 1 changed file with 24 additions and 36 deletions.
60 changes: 24 additions & 36 deletions packages/generators/utils/style.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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}"`,
Expand All @@ -91,13 +92,6 @@ export default function style(self, stylingType) {
},
},
);
if (!self.isProd) {
ExtractUseProps.push(
{
loader: `"${Loader.STYLE}"`,
},
);
}
break;

case StylingType.LESS:
Expand All @@ -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}"`,
Expand All @@ -128,13 +126,6 @@ export default function style(self, stylingType) {
},
},
);
if (!self.isProd) {
ExtractUseProps.push(
{
loader: `"${Loader.STYLE}"`,
},
);
}
break;

case StylingType.PostCSS:
Expand All @@ -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}"`,
Expand All @@ -179,13 +174,6 @@ export default function style(self, stylingType) {
},
},
);
if (!self.isProd) {
ExtractUseProps.push(
{
loader: `"${Loader.STYLE}"`,
},
);
}
break;
}
return { ExtractUseProps, regExpForStyles };
Expand Down

0 comments on commit f46f4e5

Please sign in to comment.