Skip to content

Commit d91cc36

Browse files
feat(web): make assets cachable (immich-app#1724)
1 parent 74cd3d6 commit d91cc36

38 files changed

+91
-82
lines changed

web/jest.config.mjs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,8 @@ export default {
8686

8787
// A map from regular expressions to module names or to arrays of module names that allow to stub out resources with a single module
8888
moduleNameMapper: {
89+
'\\.(jpg|ico|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$':
90+
'identity-obj-proxy',
8991
'^\\$lib(.*)$': '<rootDir>/src/lib$1',
9092
'^\\@api(.*)$': '<rootDir>/src/api$1',
9193
'^\\@test-data(.*)$': '<rootDir>/src/test-data$1'

web/package-lock.json

Lines changed: 34 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

web/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@
4343
"eslint-config-prettier": "^8.3.0",
4444
"eslint-plugin-svelte3": "^4.0.0",
4545
"factory.ts": "^1.2.0",
46+
"identity-obj-proxy": "^3.0.0",
4647
"jest": "^29.0.2",
4748
"jest-environment-jsdom": "^29.0.2",
4849
"postcss": "^8.4.13",

web/src/app.css

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@
44

55
@font-face {
66
font-family: 'Work Sans';
7-
src: url('/fonts/WorkSans-VariableFont_wght.ttf') format('truetype-variations');
7+
src: url('$lib/assets/fonts/WorkSans-VariableFont_wght.ttf') format('truetype-variations');
88
font-weight: 1 999;
99
}
1010

1111
@font-face {
1212
font-family: 'Snowburst One';
13-
src: url('/fonts/SnowburstOne-Regular.ttf') format('truetype');
13+
src: url('$lib/assets/fonts/SnowburstOne-Regular.ttf') format('truetype');
1414
}
1515

1616
:root {

web/src/app.html

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
<html lang="en" class="dark">
33
<head>
44
<meta charset="utf-8" />
5-
<link rel="icon" href="%sveltekit.assets%/favicon.png" />
65
<meta name="viewport" content="width=device-width, initial-scale=1" />
76
%sveltekit.head%
87
</head>
File renamed without changes.

0 commit comments

Comments
 (0)