@vitbokisch/next-optimized-images
Version:
Automatically optimize images used in next.js projects (jpeg, png, gif, svg).
17 lines (14 loc) • 486 B
JavaScript
import { getFileLoaderOptions, getFileLoaderPath } from './file-loader.js'
/**
* 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(),
})
export { getUrlLoaderOptions }