Closed onlywei closed 2 months ago
Name | Link |
---|---|
Latest commit | 853306a2a3cd518a17e6466805d15242de717acf |
Latest deploy log | https://app.netlify.com/sites/agitated-mahavira-26f8f9/deploys/66f0ab5b8422670008741e0f |
This is absolutely amazing, thank you @onlywei! I'll be reviewing shortly.
@galvez In this PR I have made effort to maintain backwards compatibility. Shall I delete those backwards compatibility code since there is an upcoming major release anyway?
Shall I delete those backwards compatibility code since there is an upcoming major release anyway?
Not sure if it's "too late" or not, so it could be better to keep it until @galvez chimes in
@mcollina Do you see foresee any issues using node_modules/.cache
?
Can you explain why for instance in TypeScript's case we need distDir
to be explicit?
viteFastify({ distDir: resolve(import.meta.dirname, 'dist') }),
Perhaps we should include the explanation as part of the already extended bits in the docs you added?
Though it seems like something we could autoresolve?
Can you explain why for instance in TypeScript's case we need
distDir
to be explicit?viteFastify({ distDir: resolve(import.meta.dirname, 'dist') }),
Perhaps we should include the explanation as part of the already extended bits in the docs you added?
Though it seems like something we could autoresolve?
I forgot to delete that too. Good catch. It's deleted now.
Addresses #155
Adds a new config option that needs a vite plugin to work.
By default,
@fastify/vite
looks up the Vite configuration options by importing Vite fromnode_modules
and then using its Node API to look up the vite.config file. This is often not desirable in production mode since many production builds declare Vite as adevDependency
and exclude it from their final container/docker images to save space.To support this kind of production build, this PR makes
@fastify/vite
ship with a Vite plugin that can save the handful of properties that it needs from the resolved Vite configuration object to a file in a cache directory. These properties can than be loaded instead of loading the config through vite itself.See the changes to the docs file for exactly what is happening in this change.
Checklist
npm run test
andnpm run benchmark