We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
In my understanding, this is how my next.config.js should look:
next.config.js
const withPlugins = require('next-compose-plugins'); const nextImages = require('next-images'); const bundleAnalyzer = require('@next/bundle-analyzer')({ enabled: process.env.ANALYZE === 'true', }); const nextConfig = { async rewrites() { return [ { source: '/sitemap.xml', destination: '/api/sitemap', }, ]; }, webpack: (config, options) => { config.module.rules.push({ test: [/\.jpe?g$/, /\.png$/, /\.svg$/], use: [ options.defaultLoaders.babel, { loader: 'sizeof-loader', options: { limit: 5000, publicPath: '/_next/static/images/', outputPath: 'static/images/', name: '[name].[hash:8].[ext]', }, }, ], }); return config; }, images: { domains: ['<private domain>'], imageSizes: [16, 32, 48, 64, 96, 128, 256, 384, 400, 500], deviceSizes: [640, 750, 828, 960, 1080, 1200, 1920, 2048, 3840], }, }; module.exports = withPlugins([ [bundleAnalyzer], [nextImages], ], nextConfig);
This however break the usage of the next/Image tag.
next/Image
If found a fix/hack by changing my module.exports:
module.exports = withPlugins([ [bundleAnalyzer], [nextImages], nextConfig ]);
This works, but doesn't follow the usage example form the README. This somehow also breaks the bundleAnalyzer.
bundleAnalyzer
Am I missing something here? Happy to provide any additional information.
The text was updated successfully, but these errors were encountered:
I noticed the same issue, and I was able to fix it with the above solution.
Sorry, something went wrong.
Simply, add image config to nextConfig live below and try to re-run yarn dev. It works for me.
yarn dev
const nextConfig = { some: <config>, images: { domains: ['example.com'], }, webpack: (config, options) => { <webpack configs> } } module.exports = withPlugins([ [bundleAnalyzer], ], nextConfig),
No need to add next-images plugin.
next-images
No branches or pull requests
In my understanding, this is how my
next.config.js
should look:This however break the usage of the
next/Image
tag.If found a fix/hack by changing my module.exports:
This works, but doesn't follow the usage example form the README. This somehow also breaks the
bundleAnalyzer
.Am I missing something here? Happy to provide any additional information.
The text was updated successfully, but these errors were encountered: