这是我目前的设置。
// next.config.js
const withImages = require("next-images");
module.exports = withImages({
webpack(config, options) {
return config;
},
});我希望添加此代码以允许来自域localhost:3001的图像。
images: {
domains: ['localhost:3001'],
},发布于 2021-04-01 11:42:57
您只需将images对象添加到传递给withImages的配置对象。
// next.config.js
const withImages = require("next-images");
module.exports = withImages({
images: {
domains: ['localhost:3001']
},
webpack(config, options) {
return config;
}
});发布于 2021-04-01 00:07:19
我认为你应该设置assetPrefix,阅读文档中的选项
// next.config.js
const withImages = require('next-images')
module.exports = withImages({
assetPrefix: 'https://example.com',
dynamicAssetPrefix: true,
webpack(config, options) {
return config
}
}https://stackoverflow.com/questions/66896774
复制相似问题