From 73cd1bc3ebbd497b3048c55ab2fcfed85e839b78 Mon Sep 17 00:00:00 2001 From: Bauke Date: Sat, 9 Mar 2019 13:45:23 +0100 Subject: [PATCH] fix: add outputstyle change if in dev or prod --- build.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/build.js b/build.js index ca7253b..fb1df2e 100644 --- a/build.js +++ b/build.js @@ -23,8 +23,9 @@ let cssFiles = readdirSync(join(__dirname, 'src')); // Generate all the SCSS using the CLI console.log(logMeta + 'generating SASS/SCSS -> CSS'); +const outputStyle = process.env.STYLE_ENV === 'dev' ? 'expanded' : 'compressed'; for (const cssFile of cssFiles) { - execSync(`npx node-sass src/${cssFile}/ --output-style compressed -o ${tempPath}`); + execSync(`npx node-sass src/${cssFile}/ --output-style ${outputStyle} -o ${tempPath}`); console.log(`${logMeta}✔ ${cssFile}`); } @@ -62,7 +63,7 @@ for (const cssFile of cssFiles) { const usercssLength = '==/UserStyle== */'.length; css = css.substring(0, usercssIndex + usercssLength) + - `\n@-moz-document domain(${usercss.namespace}) {\n ` + + `\n@-moz-document domain("${usercss.namespace}") {\n` + css.substring(usercssIndex + usercssLength + 1, css.length) + '}\n'; writeFileSync(cssPath, css);