Next.js Discord

Discord Forum

assetPrefix

Unanswered
Broad-snouted Caiman posted this in #help-forum
Open in Discord
Broad-snouted CaimanOP
i have a next project where i would like to use assetPrefix only for my images, but currently adding assetPrefix to my next config adds prefix to js and css as well

2 Replies

Just put the images in a subfolder of /public with the folder name being the prefix you want
(Although this won't work for images optimised by the Next <Image> component, those are served from a different url, you'll need a differnt solution)