UNPKG

next-optimized-images

Version:

Automatically optimize images used in next.js projects (jpeg, png, gif, svg).

22 lines (19 loc) 508 B
const { getFileLoaderOptions, getFileLoaderPath } = require('./file-loader'); /** * Build options for the webpack url loader * * @param {object} nextConfig - next.js configuration * @param {boolean} isServer - if the build is for the server * @returns {object} */ const getUrlLoaderOptions = ({ inlineImageLimit, ...config }, isServer) => ({ ...getFileLoaderOptions(config, isServer), limit: inlineImageLimit, fallback: getFileLoaderPath(), }); module.exports = { getUrlLoaderOptions, };