diff --git a/Makefile b/Makefile index 86b9caa60..381952333 100644 --- a/Makefile +++ b/Makefile @@ -43,8 +43,6 @@ check: build: pnpm build - # NOTE: also let's find a better way to do this :D - find ./dist/_astro/ -iname '*.jpg' -delete preview: RELEASES_DIR = $(VPS_PREVIEW_PATH)/$(SAFE_BRANCH)/releases preview: TARGET = $(RELEASES_DIR)/$(TIMESTAMP) diff --git a/astro.config.mjs b/astro.config.mjs index 9d9f9d226..7477cea27 100644 --- a/astro.config.mjs +++ b/astro.config.mjs @@ -11,6 +11,7 @@ import rehypeSlug from "rehype-slug"; import rehypeAutolinkHeadings from "rehype-autolink-headings"; import metaTags from "astro-meta-tags"; import pagefind from "astro-pagefind"; +import deleteUnusedImages from "astro-delete-unused-images"; const __filename = fileURLToPath(import.meta.url); const __dirname = dirname(__filename); // @type-check enabled! @@ -69,6 +70,7 @@ export default defineConfig({ }), metaTags(), pagefind(), + deleteUnusedImages(), ], output: "static", build: { diff --git a/package.json b/package.json index 5487fb797..11b34b982 100644 --- a/package.json +++ b/package.json @@ -22,6 +22,7 @@ "@types/react": "^19.0.12", "@types/react-dom": "^19.0.4", "astro": "^5.1.6", + "astro-delete-unused-images": "^1.0.3", "astro-meta-tags": "^0.3.1", "astro-pagefind": "^1.8.1", "clsx": "^2.1.1", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 8d1fef7fc..b09c10747 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -41,6 +41,9 @@ importers: astro: specifier: ^5.1.6 version: 5.5.2(jiti@1.21.7)(rollup@4.35.0)(typescript@5.8.2)(yaml@2.7.0) + astro-delete-unused-images: + specifier: ^1.0.3 + version: 1.0.3 astro-meta-tags: specifier: ^0.3.1 version: 0.3.1(astro@5.5.2(jiti@1.21.7)(rollup@4.35.0)(typescript@5.8.2)(yaml@2.7.0)) @@ -914,6 +917,9 @@ packages: resolution: {integrity: sha512-LElXdjswlqjWrPpJFg1Fx4wpkOCxj1TDHlSV4PlaRxHGWko024xICaa97ZkMfs6DRKlCguiAI+rbXv5GWwXIkg==} hasBin: true + astro-delete-unused-images@1.0.3: + resolution: {integrity: sha512-PRWirHqeTeJ5IAH0jdy/f2NyfgeclCjjwaz0JcjP/5uFcZqPTeSZQbn2HedV4cBWLCyPAj/ago9nieDGnmvRcQ==} + astro-meta-tags@0.3.1: resolution: {integrity: sha512-6g/SfAVTV7BsGlfWU+s/Kvo6atyn9DpfI7Dq3fE/ck3ppfg30aoeT2Uxu7UH4yla3QXAUWaJIher7fGjewf0ew==} peerDependencies: @@ -3440,6 +3446,8 @@ snapshots: astring@1.9.0: {} + astro-delete-unused-images@1.0.3: {} + astro-meta-tags@0.3.1(astro@5.5.2(jiti@1.21.7)(rollup@4.35.0)(typescript@5.8.2)(yaml@2.7.0)): dependencies: astro: 5.5.2(jiti@1.21.7)(rollup@4.35.0)(typescript@5.8.2)(yaml@2.7.0)