I have a monorepo with the following architecture:
apps/
web/
- next.config.js
- pages/
public/
My next js application is in the apps/web/ folder. How do I change the next.config.js file so that it knows to serve public assets from the public folder at the root of my monorepo and not in the apps/web/ folder?
According to the next.js docs, you cannot
Note: Be sure the directory is named public. The name cannot be changed and is the only directory used to serve static assets.
Note: Only assets that are in the public directory at build time will be served by Next.js. Files added at runtime won't be available. We recommend using a third party service like AWS S3 for persistent file storage.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With