Skip to content

Commit

Permalink
Change the vite chunk filename hash usage (actualbudget#2224)
Browse files Browse the repository at this point in the history
* Change the vite chunk filename hash usage

- Change to more closely match the . syntax we use with webpack
- This should fix some issues with our size compare as well
* Account for chunks being base64
  • Loading branch information
twk3 authored Jan 15, 2024
1 parent df95517 commit d292ad9
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/size-compare.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,11 @@ jobs:

- name: Strip content hashes from stats files
run: |
sed -i -E 's/index\.[0-9a-zA-Z_-]{8,}\./index./g' ./head/web-stats.json
sed -i -E 's/\.[0-9a-zA-Z_-]{8,}\.chunk\././g' ./head/web-stats.json
sed -i -E 's/\.[0-9a-f]{8,}\././g' ./head/*.json
sed -i -E 's/index\.[0-9a-zA-Z_-]{8,}\./index./g' ./base/web-stats.json
sed -i -E 's/\.[0-9a-zA-Z_-]{8,}\.chunk\././g' ./base/web-stats.json
sed -i -E 's/\.[0-9a-f]{8,}\././g' ./base/*.json
- uses: twk3/[email protected]
with:
Expand Down
6 changes: 3 additions & 3 deletions packages/desktop-client/vite.config.mts
Original file line number Diff line number Diff line change
Expand Up @@ -123,10 +123,10 @@ export default defineConfig(async ({ mode }) => {
} else if (/woff|woff2/.test(extType)) {
extType = 'media';
}
return `static/${extType}/[name]-[hash][extname]`;
return `static/${extType}/[name].[hash][extname]`;
},
chunkFileNames: 'static/js/[name]-[hash].js',
entryFileNames: 'static/js/[name]-[hash].js',
chunkFileNames: 'static/js/[name].[hash].chunk.js',
entryFileNames: 'static/js/[name].[hash].js',
},
},
},
Expand Down
6 changes: 6 additions & 0 deletions upcoming-release-notes/2224.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
category: Maintenance
authors: [twk3]
---

Change the vite chunk filename hash to closely match our webpack syntax

0 comments on commit d292ad9

Please sign in to comment.