Skip to content

Commit 38c2557

Browse files
committed
SRI support
1 parent 4f4701d commit 38c2557

File tree

3 files changed

+30
-0
lines changed

3 files changed

+30
-0
lines changed

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@
5454
"typescript-eslint": "^8.46.1",
5555
"vite": "npm:rolldown-vite@latest",
5656
"vite-plugin-pwa": "^1.1.0",
57+
"vite-plugin-sri-gen": "^1.2.2",
5758
"vite-plugin-static-copy": "^3.1.3",
5859
"vitest": "^3.2.4",
5960
"workbox-window": "^7.3.0"

pnpm-lock.yaml

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

vite.config.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { defineConfig } from "vite";
33
import react from "@vitejs/plugin-react";
44
import tailwindcss from "@tailwindcss/vite";
55
import { VitePWA, type VitePWAOptions } from "vite-plugin-pwa";
6+
import sri from "vite-plugin-sri-gen";
67
import { viteStaticCopy } from "vite-plugin-static-copy";
78
import { lingui } from "@lingui/vite-plugin";
89

@@ -82,6 +83,13 @@ export default defineConfig({
8283
},
8384
],
8485
}),
86+
sri({
87+
algorithm: "sha384",
88+
crossorigin: "anonymous",
89+
fetchCache: true,
90+
fetchTimeoutMs: 5000,
91+
skipResources: [],
92+
}),
8593
],
8694
optimizeDeps: {
8795
exclude: ["mediainfo.js"],

0 commit comments

Comments
 (0)