mirror of
https://github.com/penpot/penpot.git
synced 2025-01-23 15:09:10 -05:00
✨ Ensure DS scss modules are compiled before the app css modules
This commit is contained in:
parent
eae19e8252
commit
44a2a63fb8
1 changed files with 16 additions and 5 deletions
|
@ -79,16 +79,27 @@ export async function compileSassAll(worker) {
|
||||||
const limitFn = pLimit(4);
|
const limitFn = pLimit(4);
|
||||||
const sourceDir = "src";
|
const sourceDir = "src";
|
||||||
|
|
||||||
let files = await fs.readdir(sourceDir, { recursive: true });
|
const isDesignSystemFile = (path) => {
|
||||||
files = files.filter((path) => path.endsWith(".scss"));
|
return path.startsWith("app/main/ui/ds/");
|
||||||
files = files.map((path) => ph.join(sourceDir, path));
|
};
|
||||||
|
|
||||||
|
let files = (await fs.readdir(sourceDir, { recursive: true })).filter(
|
||||||
|
isSassFile,
|
||||||
|
);
|
||||||
|
|
||||||
|
const appFiles = files
|
||||||
|
.filter((path) => !isDesignSystemFile(path))
|
||||||
|
.map((path) => ph.join(sourceDir, path));
|
||||||
|
const dsFiles = files
|
||||||
|
.filter(isDesignSystemFile)
|
||||||
|
.map((path) => ph.join(sourceDir, path));
|
||||||
|
|
||||||
const procs = [
|
const procs = [
|
||||||
compileSass(worker, "resources/styles/main-default.scss", {}),
|
compileSass(worker, "resources/styles/main-default.scss", {}),
|
||||||
compileSass(worker, "resources/styles/debug.scss", {}),
|
compileSass(worker, "resources/styles/debug.scss", {}),
|
||||||
];
|
];
|
||||||
|
|
||||||
for (let path of files) {
|
for (let path of [...dsFiles, ...appFiles]) {
|
||||||
const proc = limitFn(() => compileSass(worker, path, { modules: true }));
|
const proc = limitFn(() => compileSass(worker, path, { modules: true }));
|
||||||
procs.push(proc);
|
procs.push(proc);
|
||||||
}
|
}
|
||||||
|
@ -96,7 +107,7 @@ export async function compileSassAll(worker) {
|
||||||
const result = await Promise.all(procs);
|
const result = await Promise.all(procs);
|
||||||
|
|
||||||
return result.reduce(
|
return result.reduce(
|
||||||
(acc, item, index) => {
|
(acc, item) => {
|
||||||
acc.index[item.outputPath] = item.css;
|
acc.index[item.outputPath] = item.css;
|
||||||
acc.items.push(item.outputPath);
|
acc.items.push(item.outputPath);
|
||||||
return acc;
|
return acc;
|
||||||
|
|
Loading…
Add table
Reference in a new issue