mirror of
https://github.com/penpot/penpot.git
synced 2025-05-10 10:46:38 +02:00
🐛 Fix helper to compile polyfills
This commit is contained in:
parent
4212b46835
commit
6a0768b490
1 changed files with 6 additions and 3 deletions
|
@ -32,7 +32,6 @@ async function findFiles(basePath, predicate, options={}) {
|
||||||
predicate = predicate ?? function() { return true; }
|
predicate = predicate ?? function() { return true; }
|
||||||
|
|
||||||
let files = await fs.readdir(basePath, {recursive: options.recursive ?? false})
|
let files = await fs.readdir(basePath, {recursive: options.recursive ?? false})
|
||||||
files = files.filter((path) => path.endsWith(".svg"));
|
|
||||||
files = files.map((path) => ph.join(basePath, path));
|
files = files.map((path) => ph.join(basePath, path));
|
||||||
|
|
||||||
return files;
|
return files;
|
||||||
|
@ -54,7 +53,11 @@ export function isSassFile(path) {
|
||||||
}
|
}
|
||||||
|
|
||||||
export function isSvgFile(path) {
|
export function isSvgFile(path) {
|
||||||
return path.endsWith(".scss");
|
return path.endsWith(".svg");
|
||||||
|
}
|
||||||
|
|
||||||
|
export function isJsFile(path) {
|
||||||
|
return path.endsWith(".js");
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function compileSass(worker, path, options) {
|
export async function compileSass(worker, path, options) {
|
||||||
|
@ -378,7 +381,7 @@ export async function compilePolyfills() {
|
||||||
log.info("init: compile polyfills")
|
log.info("init: compile polyfills")
|
||||||
|
|
||||||
|
|
||||||
const files = await findFiles("resources/polyfills/");
|
const files = await findFiles("resources/polyfills/", isJsFile);
|
||||||
let result = [];
|
let result = [];
|
||||||
for (let path of files) {
|
for (let path of files) {
|
||||||
const content = await fs.readFile(path, {encoding:"utf-8"});
|
const content = await fs.readFile(path, {encoding:"utf-8"});
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue