1
Fork 0

fix: add outputstyle change if in dev or prod

This commit is contained in:
Bauke 2019-03-09 13:45:23 +01:00
parent 4e8898dc50
commit 73cd1bc3eb
Signed by: Bauke
GPG Key ID: C1C0F29952BCF558
1 changed files with 3 additions and 2 deletions

View File

@ -23,8 +23,9 @@ let cssFiles = readdirSync(join(__dirname, 'src'));
// Generate all the SCSS using the CLI // Generate all the SCSS using the CLI
console.log(logMeta + 'generating SASS/SCSS -> CSS'); console.log(logMeta + 'generating SASS/SCSS -> CSS');
const outputStyle = process.env.STYLE_ENV === 'dev' ? 'expanded' : 'compressed';
for (const cssFile of cssFiles) { 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}`); console.log(`${logMeta}${cssFile}`);
} }
@ -62,7 +63,7 @@ for (const cssFile of cssFiles) {
const usercssLength = '==/UserStyle== */'.length; const usercssLength = '==/UserStyle== */'.length;
css = css =
css.substring(0, usercssIndex + usercssLength) + 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) + css.substring(usercssIndex + usercssLength + 1, css.length) +
'}\n'; '}\n';
writeFileSync(cssPath, css); writeFileSync(cssPath, css);