It seems like the issue is that the font variable is not being set properly when running the production build. One possible solution is to manually set the font variable in your webpack.mix.js file.
You can try adding the following code snippet to your webpack.mix.js file:
mix.webpackConfig({
module: {
rules: [
{
test: /\.(woff(2)?|ttf|eot|svg)(\?v=\d+\.\d+\.\d+)?$/,
use: [
{
loader: 'file-loader',
options: {
name: '[name].[ext]',
outputPath: 'fonts/',
publicPath: '../fonts/'
}
}
]
}
]
}
});
This code snippet adds a rule to handle font files and uses the file-loader to copy the font files to the appropriate location in the production build.
Make sure to install the file-loader package if you haven't already by running the following command:
npm install file-loader --save-dev
After adding the code snippet and installing the file-loader package, try running the production build again and see if the font variable is set properly.
Let me know if this helps!