我在我的next.config.js中使用了重写来向我的请求添加代理,但我也想使用next-images来加载svg文件,但是我不确定如何在next.config.js中使用它和重写一起使用
const API_SERVER_ENDPOINT = 'http://localhost:5000';
const withImages = require("next-images");
module.exports = {
async rewrites() {
return [
{
source: "/api/:path*",
destination: `${API_SERVER_ENDPOINT}/api/:path*`,
},
];
},
};在这里我不知道如何在module.exports中添加withImages,请帮助
发布于 2021-07-28 01:01:23
您可以简单地使用withImages包装配置
const API_SERVER_ENDPOINT = 'http://localhost:5000';
const withImages = require("next-images");
module.exports = withImages({
async rewrites() {
return [
{
source: "/api/:path*",
destination: `${API_SERVER_ENDPOINT}/api/:path*`,
},
];
},
});https://stackoverflow.com/questions/68540781
复制相似问题