sanity
Version:
Sanity is a real-time content infrastructure with a scalable, hosted backend featuring a Graph Oriented Query Language (GROQ), asset pipelines and fast edge caches
28 lines (26 loc) • 459 B
JavaScript
const fileExtensions = [
'.css',
'.eot',
'.gif',
'.jpeg',
'.jpg',
'.otf',
'.png',
'.sass',
'.scss',
'.svg',
'.ttf',
'.webp',
'.woff',
'.woff2',
]
export async function load(url, context, nextLoad) {
if (fileExtensions.some((extension) => url.endsWith(extension))) {
return {
format: 'module',
source: `export default ${JSON.stringify(url)}`,
shortCircuit: true,
}
}
return nextLoad(url, context)
}