From 9d43b80f3b239f54a0d59967f6396be3fccc2729 Mon Sep 17 00:00:00 2001 From: Rahul Kadyan Date: Tue, 28 Aug 2018 06:32:29 +0530 Subject: [PATCH] feat: Allow disabling clean CSS --- src/compiler.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/compiler.ts b/src/compiler.ts index 48b3022..3389879 100644 --- a/src/compiler.ts +++ b/src/compiler.ts @@ -155,6 +155,8 @@ export class SFCCompiler { let tokens = undefined const needsCSSModules = style.module === true || typeof style.module === 'string' + const needsCleanCSS = + this.template.isProduction && !(this.style.postcssCleanOptions && this.style.postcssCleanOptions.disabled) const postcssPlugins = [ needsCSSModules ? postcssModules({ @@ -165,7 +167,7 @@ export class SFCCompiler { } }) : undefined, - this.template.isProduction + needsCleanCSS ? postcssClean(this.style.postcssCleanOptions) : undefined ]