fix: Legacy Vite build hashes not being normalized#247
fix: Legacy Vite build hashes not being normalized#247nicholas-codecov merged 13 commits intomainfrom
Conversation
Bundle ReportChanges will increase total bundle size by 109.45kB (1.7%) ⬆️. This is within the configured threshold ✅ Detailed changes
Affected Assets, Files, and Routes:view changes for bundle: @codecov/sveltekit-plugin-esmAssets Changed:
Files in
view changes for bundle: @codecov/astro-plugin-cjsAssets Changed:
Files in
view changes for bundle: @codecov/solidstart-plugin-cjsAssets Changed:
Files in
view changes for bundle: @codecov/rollup-plugin-cjsAssets Changed:
Files in
view changes for bundle: @codecov/webpack-plugin-esmAssets Changed:
Files in
view changes for bundle: @codecov/astro-plugin-esmAssets Changed:
Files in
view changes for bundle: @codecov/rollup-plugin-esmAssets Changed:
Files in
view changes for bundle: @codecov/nuxt-plugin-esmAssets Changed:
Files in
view changes for bundle: @codecov/webpack-plugin-cjsAssets Changed:
Files in
view changes for bundle: @codecov/nextjs-webpack-plugin-cjsAssets Changed:
Files in
view changes for bundle: @codecov/bundler-plugin-core-esmAssets Changed:
Files in
view changes for bundle: @codecov/example-next-15-app-client-array-pushAssets Changed:
view changes for bundle: @codecov/example-next-app-client-array-pushAssets Changed:
view changes for bundle: @codecov/sveltekit-plugin-cjsAssets Changed:
Files in
view changes for bundle: @codecov/nuxt-plugin-cjsAssets Changed:
Files in
view changes for bundle: @codecov/bundle-analyzer-cjsAssets Changed:
Files in
view changes for bundle: @codecov/solidstart-plugin-esmAssets Changed:
Files in
view changes for bundle: @codecov/vite-plugin-esmAssets Changed:
Files in
view changes for bundle: @codecov/vite-plugin-cjsAssets Changed:
Files in
view changes for bundle: @codecov/remix-vite-plugin-esmAssets Changed:
Files in
view changes for bundle: @codecov/remix-vite-plugin-cjsAssets Changed:
Files in
view changes for bundle: @codecov/bundler-plugin-core-cjsAssets Changed:
Files in
view changes for bundle: @codecov/nextjs-webpack-plugin-esmAssets Changed:
Files in
view changes for bundle: @codecov/bundle-analyzer-esmAssets Changed:
Files in
|
Bundle ReportChanges will increase total bundle size by 106.36kB (1.69%) ⬆️. This is within the configured threshold ✅ Detailed changes
Affected Assets, Files, and Routes:view changes for bundle: @codecov/bundle-analyzer-cjsAssets Changed:
Files in
view changes for bundle: @codecov/bundler-plugin-core-esmAssets Changed:
Files in
view changes for bundle: @codecov/rollup-plugin-esmAssets Changed:
Files in
view changes for bundle: @codecov/rollup-plugin-cjsAssets Changed:
Files in
view changes for bundle: @codecov/example-sveltekit-app-client-esmAssets Changed:
view changes for bundle: @codecov/remix-vite-plugin-cjsAssets Changed:
Files in
view changes for bundle: @codecov/example-sveltekit-app-server-esmAssets Changed:
view changes for bundle: @codecov/webpack-plugin-esmAssets Changed:
Files in
view changes for bundle: @codecov/nuxt-plugin-cjsAssets Changed:
Files in
view changes for bundle: @codecov/solidstart-plugin-esmAssets Changed:
Files in
view changes for bundle: @codecov/nextjs-webpack-plugin-cjsAssets Changed:
Files in
view changes for bundle: @codecov/nuxt-plugin-esmAssets Changed:
Files in
view changes for bundle: @codecov/example-next-15-app-client-array-pushAssets Changed:
view changes for bundle: @codecov/bundler-plugin-core-cjsAssets Changed:
Files in
view changes for bundle: @codecov/sveltekit-plugin-esmAssets Changed:
Files in
view changes for bundle: @codecov/astro-plugin-esmAssets Changed:
Files in
view changes for bundle: @codecov/astro-plugin-cjsAssets Changed:
Files in
view changes for bundle: @codecov/nextjs-webpack-plugin-esmAssets Changed:
Files in
view changes for bundle: @codecov/webpack-plugin-cjsAssets Changed:
Files in
view changes for bundle: @codecov/solidstart-plugin-cjsAssets Changed:
Files in
view changes for bundle: @codecov/remix-vite-plugin-esmAssets Changed:
Files in
view changes for bundle: @codecov/example-next-app-client-array-pushAssets Changed:
view changes for bundle: @codecov/bundle-analyzer-esmAssets Changed:
Files in
view changes for bundle: @codecov/vite-plugin-cjsAssets Changed:
Files in
view changes for bundle: @codecov/sveltekit-plugin-cjsAssets Changed:
Files in
|
Codecov ReportAttention: Patch coverage is ✅ All tests successful. No failed tests found.
📢 Thoughts on this report? Let us know! |
suejung-sentry
left a comment
There was a problem hiding this comment.
Approved this as seems we are looking for a fast solution, but ideally there can be another way to identify that we are in a vite legacy build
| } | ||
|
|
||
| // handle vite legacy builds | ||
| if (normalizedPath === path && path.includes("legacy")) { |
There was a problem hiding this comment.
I am probably missing something but seems a little brittle to try to identify the vite legacy build just by looking for the word "legacy" in the path? As in any other bundler technology can have a name containing "legacy" and this may behave incorrectly.
Are there other ways to identify that this is a vite legacy build and only apply this regex in those cases?
There was a problem hiding this comment.
Okay, updated things to make sure it's Vite that's doing the bundling
There was a problem hiding this comment.
Thoooo it may have increased the size of the PR by a lot (mainly tests)
packages/bundler-plugin-core/src/utils/__tests__/Output.test.ts
Dismissed
Show dismissed
Hide dismissed
packages/bundler-plugin-core/src/utils/__tests__/Output.test.ts
Dismissed
Show dismissed
Hide dismissed
packages/bundler-plugin-core/src/utils/__tests__/Output.test.ts
Dismissed
Show dismissed
Hide dismissed
packages/bundler-plugin-core/src/utils/__tests__/Output.test.ts
Dismissed
Show dismissed
Hide dismissed
packages/bundler-plugin-core/src/utils/__tests__/Output.test.ts
Dismissed
Show dismissed
Hide dismissed
packages/bundler-plugin-core/src/utils/__tests__/Output.test.ts
Dismissed
Show dismissed
Hide dismissed
packages/bundler-plugin-core/src/utils/__tests__/Output.test.ts
Dismissed
Show dismissed
Hide dismissed
packages/bundler-plugin-core/src/utils/__tests__/Output.test.ts
Dismissed
Show dismissed
Hide dismissed
packages/bundler-plugin-core/src/utils/__tests__/Output.test.ts
Dismissed
Show dismissed
Hide dismissed
packages/bundler-plugin-core/src/utils/__tests__/Output.test.ts
Dismissed
Show dismissed
Hide dismissed
suejung-sentry
left a comment
There was a problem hiding this comment.
I like this solution! And it seems useful to have this param available at that level for any future extensions of the product, as well. Thanks for all the work on it!
Description
This PR fixes an issue where if you're using the
@vitejs/plugin-legacyin your Vite application, it is not currently normalizing the asset path names, this PR updates thenormalizePathfunction to handle those cases.As well, this PR includes and update to bring Vitest up to date.
Notable Changes
normalizePathto handle Vite legacy builds