簡體   English   中英

如何以正確的方式配置 next.config.js 文件

[英]How to configure next.config.js file on right way

在我的next.config.js我有以下配置:

const withCSS = require('@zeit/next-css');
const withSass = require('@zeit/next-sass');
const withImages = require('next-images');
const withFonts = require('next-fonts');

module.exports = withCSS(
  withSass(
    withFonts(),  // <=== this is wrong? 
    withImages({
      distDir: '../_next',
      webpack(config) {
        return config;
      }
    })
  )
);

我需要在這里添加的最后一件事是next-fonts插件。

我不確定如何以正確的方式導出withFounts

我需要 next-fonts 插件才能使用'fonts' icons

你可以這樣做:

module.exports = withCSS(withFonts(withSass(
    withImages({
        distDir: '../_next',
        webpack(config) {
            return config;
        }
    })
)))

您可以嘗試使用next-compose

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM