wip
This commit is contained in:
@@ -19,23 +19,24 @@ export class FileLoader implements IPluginBuilder {
|
||||
const { menuManifest } = builderContext;
|
||||
const { files } = this.options;
|
||||
files.forEach((file) => {
|
||||
const fileName =
|
||||
file.nameOverride ?? file.path.split("/").pop() ?? file.path;
|
||||
const filePath = file.path.split("/").pop() ?? file.path;
|
||||
const fileName = file.nameOverride ?? filePath;
|
||||
const isImage = fileName.match(/\.(png|jpe?g|gif|webp)$/);
|
||||
if (isImage) {
|
||||
console.log("Processing image", file.path);
|
||||
ffmpeg(file.path)
|
||||
.output(`${builderContext.outputDirectory}/${fileName}`)
|
||||
.output(`${builderContext.outputDirectory}/${filePath}`)
|
||||
.size(`${this.options.imageWidth ?? 200}x?`)
|
||||
.run();
|
||||
} else {
|
||||
console.log("Copying file", file.path);
|
||||
copyFile(file.path, `${builderContext.outputDirectory}/${fileName}`);
|
||||
const destination = `${builderContext.outputDirectory}/${filePath}`;
|
||||
console.log("Copying file", file.path, "to", destination);
|
||||
copyFile(file.path, destination);
|
||||
}
|
||||
if (file.menuEntry) {
|
||||
menuManifest.push({
|
||||
name: fileName,
|
||||
link: file.path,
|
||||
link: filePath,
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user