mirror of
https://github.com/Terncode/pixel.horse.git
synced 2026-09-24 21:55:52 +02:00
Archive commit
This commit is contained in:
@@ -0,0 +1,12 @@
|
||||
import { REV } from '../generated/rev';
|
||||
|
||||
/* istanbul ignore next */
|
||||
export function getUrl(name: string): string {
|
||||
if (DEVELOPMENT)
|
||||
return `/assets/${name}`;
|
||||
|
||||
if (!REV[name])
|
||||
throw new Error(`Cannot find file url (${name})`);
|
||||
|
||||
return `/assets/${name.replace(/(\.\S+)$/, `-${REV[name]}$1`)}`;
|
||||
}
|
||||
Reference in New Issue
Block a user