when I export the Nextjs files, the fonts, are wrong.
In the console I get the following error:
This is how my global.css file looks:
@tailwind base;
@tailwind components;
@tailwind utilities;
@font-face {
font-family: "HELIOSBOLD";
src: url("/fonts/HeliosAntiqueBold.otf")
}
@font-face {
font-family: "HELIOS";
src: url("/fonts/HeliosAntique-Regular.otf")
}
And this is what I have in next.config.js
/** @type {import('next').NextConfig} */
const nextConfig = {
reactStrictMode: true,
};
module.exports = nextConfig;
module.exports = {
assetPrefix: './',
optimizeFonts: false,
};
The fonts are located in the /public/fonts/ directory.
On export I notice that the path to fonts in the .css file is /fonts/HeliosAntiqueBold.otf
but it should be: ../../../fonts/HeliosAntiqueBold.otf to function corectly.
How can I get this to work without manually editing the file?