1

I need to use an extra plugin form dayjs librabry and I need to add him to my next.config.js.

The plugin looks like:

var weekday = require('dayjs/plugin/weekday')
dayjs.extend(weekday)

// when Monday is the first day of the week
dayjs().weekday(-7) // last Monday
dayjs().weekday(7) // next Monday

And this is my next.config.js:

module.exports = {
  webpack(config) {
    config.module.rules.push({
      test: /\.svg$/,
      issuer: {
        test: /\.(js|ts)x?$/,
      },
      use: [
        {
          loader: "@svgr/webpack",
          options: {
            svgoConfig: {
              plugins: [
                {
                  removeDimensions: true,
                  removeViewBox: false,
                  addClassesToSVGElement: {
                    className: "w-full h-auto",
                  },
                },
              ],
            },
          },
        },
      ],
    })

    return config
  },
}
4

0 回答 0