Closed quadratz closed 2 weeks ago
site.loadAssets()
needs the loader as the second argument. If it's not specified, it uses the text loader, but for binary files, you have to pass the binary loader:
import lume from "lume/mod.ts";
import binary from "lume/core/loaders/binary.ts";
const site = lume();
site.loadAssets([".webp"], binary);
export default site;
I'm planning to detect automatically the proper loader based on the file extension. But it's not implemented yet.
Thank you. I can confirm that adding the binary loader solves the issue. Perhaps we should add this information to the documentation.
Good idea. Thanks for the PR on lume.land!
Version
v2.2.1
Platform
Linux
What steps will reproduce the bug?
Steps:
assets
at the root of the project. Move all webp files there.site.loadAssets([".webp"])
to _config.ts.deno task build
.The reproduction repository is available at https://github.com/quadratz/lume-issue.
How often does it reproduce? Is there a required condition?
Always.
Not sure.
What is the expected behavior?
The build result of webp should not changed because there is no process happens.
What do you see instead?
The webp files produced after building have a larger size than the originals, and they are also corrupted.
Additional information
The reproduction repository is available at https://github.com/quadratz/lume-issue.