mirror of
https://github.com/penpot/penpot.git
synced 2025-01-08 16:00:19 -05:00
✨ Improve scss compilation error handling
Don't stop watch scss process on compilation error
This commit is contained in:
parent
577b731b22
commit
e1c9691567
2 changed files with 14 additions and 6 deletions
|
@ -508,6 +508,7 @@ export async function compileStyles() {
|
||||||
const start = process.hrtime();
|
const start = process.hrtime();
|
||||||
|
|
||||||
log.info("init: compile styles");
|
log.info("init: compile styles");
|
||||||
|
|
||||||
let result = await compileSassAll(worker);
|
let result = await compileSassAll(worker);
|
||||||
result = concatSass(result);
|
result = concatSass(result);
|
||||||
|
|
||||||
|
|
|
@ -24,6 +24,8 @@ async function compileSassAll() {
|
||||||
async function compileSass(path) {
|
async function compileSass(path) {
|
||||||
const start = process.hrtime();
|
const start = process.hrtime();
|
||||||
log.info("changed:", path);
|
log.info("changed:", path);
|
||||||
|
|
||||||
|
try {
|
||||||
const result = await h.compileSass(worker, path, { modules: true });
|
const result = await h.compileSass(worker, path, { modules: true });
|
||||||
sass.index[result.outputPath] = result.css;
|
sass.index[result.outputPath] = result.css;
|
||||||
|
|
||||||
|
@ -33,6 +35,11 @@ async function compileSass(path) {
|
||||||
|
|
||||||
const end = process.hrtime(start);
|
const end = process.hrtime(start);
|
||||||
log.info("done:", `(${ppt(end)})`);
|
log.info("done:", `(${ppt(end)})`);
|
||||||
|
} catch (cause) {
|
||||||
|
console.error(cause);
|
||||||
|
const end = process.hrtime(start);
|
||||||
|
log.error("error:", `(${ppt(end)})`);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
await fs.mkdir("./resources/public/css/", { recursive: true });
|
await fs.mkdir("./resources/public/css/", { recursive: true });
|
||||||
|
|
Loading…
Reference in a new issue