且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何组合和使用多个 Next.js 插件

更新时间:2022-12-08 16:07:14

你可以使用next-compose-plugins,组合多个next.js插件如下:

You can use next-compose-plugins and combine multiple next.js plugins as follows:

// next.config.js
const withPlugins = require('next-compose-plugins');
const withSass = require('@zeit/next-sass');
const withCSS = require('@zeit/next-css');

module.exports = withPlugins(
  [
    [withSass, { /* plugin config here ... */ }],
    [withCSS,  { /* plugin config here ... */ }],
  ],
  {
    /* global config here ... */
  },
);