mirror of
https://github.com/penpot/penpot.git
synced 2025-12-11 22:14:05 +01:00
✨ Improve scss compilation error handling
Don't stop watch scss process on compilation error
This commit is contained in:
@@ -508,6 +508,7 @@ export async function compileStyles() {
|
||||
const start = process.hrtime();
|
||||
|
||||
log.info("init: compile styles");
|
||||
|
||||
let result = await compileSassAll(worker);
|
||||
result = concatSass(result);
|
||||
|
||||
|
||||
@@ -24,15 +24,22 @@ async function compileSassAll() {
|
||||
async function compileSass(path) {
|
||||
const start = process.hrtime();
|
||||
log.info("changed:", path);
|
||||
const result = await h.compileSass(worker, path, { modules: true });
|
||||
sass.index[result.outputPath] = result.css;
|
||||
|
||||
const output = h.concatSass(sass);
|
||||
try {
|
||||
const result = await h.compileSass(worker, path, { modules: true });
|
||||
sass.index[result.outputPath] = result.css;
|
||||
|
||||
await fs.writeFile("./resources/public/css/main.css", output);
|
||||
const output = h.concatSass(sass);
|
||||
|
||||
const end = process.hrtime(start);
|
||||
log.info("done:", `(${ppt(end)})`);
|
||||
await fs.writeFile("./resources/public/css/main.css", output);
|
||||
|
||||
const end = process.hrtime(start);
|
||||
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 });
|
||||
|
||||
Reference in New Issue
Block a user