You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have searched existing issues to ensure the bug has not already been reported
Fastify version
Latest
Plugin version
Latest
Node.js version
20
Operating system
macOS
Operating system version (i.e. 20.04, 11.3, 10)
Sonoma
Description
I use a src/dist build approach and want my files to live in src/routes/client. It works fine in development and I can build it however needed but as the outDir is not configurable it fails when starting due to this if statement in production.js
if (!exists(clientDist)) {
throw new Error('No client distribution bundle found.')
}
const serverDist = resolve(config.bundle.dir, 'server')
if (!config.spa && !exists(serverDist)) {
throw new Error('No server distribution bundle found.')
}`
When I try setting the resolve to resolve(config.bundle.dir) for both the server and the client dist it passes this but then somehow finds a duplicate in the root path in the fastify static plugin
Its extremly difficult to make this plugin work with anything else working along side it. Fastify autoload is also almost impossible to configure with Vite.
Link to code that reproduces the bug
No response
Expected Behavior
No response
The text was updated successfully, but these errors were encountered:
Prerequisites
Fastify version
Latest
Plugin version
Latest
Node.js version
20
Operating system
macOS
Operating system version (i.e. 20.04, 11.3, 10)
Sonoma
Description
I use a src/dist build approach and want my files to live in src/routes/client. It works fine in development and I can build it however needed but as the outDir is not configurable it fails when starting due to this if statement in production.js
` const clientDist = config.spa
? resolve(config.bundle.dir)
: resolve(config.bundle.dir, 'client')
if (!exists(clientDist)) {
throw new Error('No client distribution bundle found.')
}
const serverDist = resolve(config.bundle.dir, 'server')
if (!config.spa && !exists(serverDist)) {
throw new Error('No server distribution bundle found.')
}`
When I try setting the resolve to resolve(config.bundle.dir) for both the server and the client dist it passes this but then somehow finds a duplicate in the root path in the fastify static plugin
rootPath [ '/dist/client/assets', '/dist/client/assets' ]
Its extremly difficult to make this plugin work with anything else working along side it. Fastify autoload is also almost impossible to configure with Vite.
Link to code that reproduces the bug
No response
Expected Behavior
No response
The text was updated successfully, but these errors were encountered: