vike
Version:
The Framework *You* Control - Next.js & Nuxt alternative for unprecedented flexibility and dependability.
41 lines (40 loc) • 837 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.isAsset = isAsset;
function isAsset(filename) {
return assetFileExtensions.some((ext) => filename.endsWith('.' + ext));
}
// Copied from Vite: https://github.com/vitejs/vite/blob/9d28ffd3410a3ea2b739cce31e845f59cebd3cc6/packages/vite/src/node/constants.ts#L83-L121
// Alternatively: check sirv's source code (it needs to send the right Content-Type header)
const assetFileExtensions = [
// images
'png',
'jpg',
'jpeg',
'jfif',
'pjpeg',
'pjp',
'gif',
'svg',
'ico',
'webp',
'avif',
// media
'mp4',
'webm',
'ogg',
'mp3',
'wav',
'flac',
'aac',
// fonts
'woff2',
'woff',
'eot',
'ttf',
'otf',
// other
'webmanifest',
'pdf',
'txt',
];