rohanray / next-fonts

Import fonts in Next.js (supports woff, woff2, eot, ttf, otf & svg)
179 stars 12 forks source link

AssetPrefix option not working #22

Closed YagoQuinoy closed 4 years ago

YagoQuinoy commented 4 years ago

Hi. I'm using next-fonts local fonts example to check how it works the plugin with assetPrefix but sadly seems to not work.

Configured an ngrok that points to localhost through public url and configured assetPrefix.

image

Seems to work for next.js assets but not for fonts

image

This is the next.config.js file

// next.config.js
const withFonts = require("next-fonts");
module.exports = withFonts({
  assetPrefix: "http://f6c62383.ngrok.io/",
  webpack(config, options) {
    return config;
  }
});
YagoQuinoy commented 4 years ago

Finally managed to make it work.

sudheeshcm commented 3 years ago

@YagoQuinoy How did you fix this? I'm having the same issue

YagoQuinoy commented 3 years ago

@sudheeshcm Let next-sass plugin handle urls.

Check this line https://github.com/rohanray/next-fonts/blob/6e4b168d39c04b7e3833721312bb3302643a69ee/index.js#L27