Welcome toVigges Developer Community-Open, Learning,Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.2k views
in Technique[技术] by (71.8m points)

reactjs - Next.js and multiple module.exports options in next.config.js

I'm having trouble getting the syntax right for combining:

module.exports = withImages()

and

trailingSlash: true

within next.config.js.

My current file works:

const withImages = require('next-images')

module.exports = withImages()

... but when I try to add the trailingSlash key/value it throws up errors on building because obviously I'm not getting the syntax right.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

Figured it out as I wrote ... d'oh ... will leave answer in case it hurts someone else's brain:

module.exports = withImages({
  trailingSlash: true
})

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to Vigges Developer Community for programmer and developer-Open, Learning and Share
...