Skip to content

Commit

Permalink
Merge pull request #197 from oliverlynch/main
Browse files Browse the repository at this point in the history
fix(astro-engine): Add support for GIF, TIFF and AVIF image imports
  • Loading branch information
Tate-CC authored Aug 27, 2024
2 parents c0598c8 + 130febf commit 3e5e95f
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion javascript-modules/engines/astro-engine/lib/builder.js
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ export const buildPlugins = [
loader: "js",
};
});
build.onResolve({ filter: /^\/.*\.(svg|png|jpe?g|webp)/ }, (args) => {
build.onResolve({ filter: /^\/.*\.(svg|png|jpe?g|webp|gif|tiff|avif)/ }, (args) => {
return { path: join(process.cwd(), "public", args.path) };
});
build.onLoad({ filter: /\.(j|t)sx$/ }, async (args) => {
Expand Down Expand Up @@ -266,6 +266,9 @@ export const buildPlugins = [
args.path.endsWith(".jpg") ||
args.path.endsWith(".jpeg") ||
args.path.endsWith(".webp") ||
args.path.endsWith(".gif") ||
args.path.endsWith(".tiff") ||
args.path.endsWith(".avif") ||
args.path.endsWith(".json") ||
args.path.endsWith(".ts")
) {
Expand Down Expand Up @@ -321,6 +324,9 @@ export const esbuildConfigFn = (esbuildOptions, options) => {
".jpg": "file",
".jpeg": "file",
".webp": "file",
".gif": "file",
".tiff": "file",
".avif": "file",
".ts": "ts",
...esbuildOptions.loader,
};
Expand Down

0 comments on commit 3e5e95f

Please sign in to comment.