rohanray / next-fonts

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

next.config.js #29

Closed ekkis closed 4 years ago

ekkis commented 4 years ago

the README suggests I do:

const withFonts = require('next-fonts');
module.exports = withFonts({
  webpack(config, options) {
    return config;
  }
});

but my next.config.js already contains:

const withPlugins = require("next-compose-plugins")
const withImages = require("next-images")
const withSass = require("@zeit/next-sass")
const webpack = require("webpack")
const path = require("path")

module.exports = withPlugins([[withSass], [withImages]], {
  webpack(config, options) {
    config.resolve.modules.push(path.resolve("./"))
    return config
  }
})

sorry, but how do I integrate your module into that?

chrishrtmn commented 4 years ago

Not the author, but likely like this @ekkis:

const withPlugins = require("next-compose-plugins")
const withImages = require("next-images")
const withFonts = require("next-fonts")
const withSass = require("@zeit/next-sass")
const webpack = require("webpack")
const path = require("path")

module.exports = withPlugins([[withSass], [withImages], [withFonts]] {
  webpack(config, options) {
    config.resolve.modules.push(path.resolve("./"))
    return config
  }
})
rohanray commented 4 years ago

Thanks @chrishrtmn for helping out! @ekkis : Did it help?

ekkis commented 4 years ago

it did thank you

rohanray commented 4 years ago

Thanks @chrishrtmn for helping out! @ekkis : Glad to have this issue resolved and closed with help from @chrishrtmn