2023-04-24 22:50:53 -06:00
|
|
|
'use strict';
|
|
|
|
|
|
|
|
const path = require('path').posix;
|
|
|
|
|
2023-04-26 16:04:49 -06:00
|
|
|
let _faviconAssetUrls;
|
|
|
|
function getFaviconAssetUrls() {
|
|
|
|
// Probably not that much overhead but only calculate this once
|
|
|
|
if (_faviconAssetUrls) {
|
|
|
|
return _faviconAssetUrls;
|
2023-04-24 22:50:53 -06:00
|
|
|
}
|
2023-04-26 16:04:49 -06:00
|
|
|
|
|
|
|
// Lazy-load the manifest so we only require it on first call hopefully after the Vite
|
|
|
|
// client build completes. `require(...)` calls are cached so it should be fine to
|
|
|
|
// look this up over and over.
|
|
|
|
//
|
2023-04-24 22:50:53 -06:00
|
|
|
// We have to disable this because it's built via the Vite client build.
|
2023-04-24 23:39:59 -06:00
|
|
|
// eslint-disable-next-line n/no-missing-require, n/no-unpublished-require
|
2023-04-26 16:04:49 -06:00
|
|
|
const manifest = require('../../dist/manifest.json');
|
2023-04-24 22:50:53 -06:00
|
|
|
|
|
|
|
const icoAssetPath = path.join('/', manifest['client/img/favicon.ico'].file);
|
|
|
|
const svgAssetFile = path.join('/', manifest['client/img/favicon.svg'].file);
|
|
|
|
|
2023-04-26 16:04:49 -06:00
|
|
|
_faviconAssetUrls = {
|
2023-04-24 22:50:53 -06:00
|
|
|
ico: icoAssetPath,
|
|
|
|
svg: svgAssetFile,
|
|
|
|
};
|
2023-04-26 16:04:49 -06:00
|
|
|
return _faviconAssetUrls;
|
2023-04-24 22:50:53 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
module.exports = getFaviconAssetUrls;
|