Closed ranyefet closed 6 months ago
workaround for you:
import fastifyStatic from "@fastify/static";
await server.register(fastifyStatic, {
root: new URL("./public", import.meta.url),
});
@tantaman Thanks I already have a workaround but I still think it should be solved in fastidy-vite
You're right! This should be handled by @fastify/vite
— I'm adding it in the next minor.
Fixed in v6.0.1
.
Prerequisites
Fastify version
4.13.0
Plugin version
3.0.8
Node.js version
16.15.1
Operating system
macOS
Operating system version (i.e. 20.04, 11.3, 10)
latest
Description
Hello,
In my Vite application I'm using the public folder feature to serve static files without transformations such as
favicon.svg
and other js/css files.After building for production and running my fastify app I noticed that the these files are not served.
It appears that
fastify-vite
is only servingindex.html
and everything in theassets
folder.I would expect that it will support public folder feature and serve everything in the
build
folder as is.Steps to Reproduce
public
folder under yourclient
folderrobots.txt
localhost/robots.txt
Expected Behavior
Fastify Vite should serve all files in build folder as static files and not just
index.html
andassets
folder.