fix: add outputstyle change if in dev or prod
This commit is contained in:
parent
4e8898dc50
commit
73cd1bc3eb
5
build.js
5
build.js
|
@ -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);
|
||||||
|
|
Loading…
Reference in New Issue