Bundle analysis: `normalizePath` replaces everything after the first `-` in a file name, so different assets collide
まだ誰も着手していません。
評価
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 72/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- javascript, node.js
- 領域
- backend
調査の方向性
まず、@codecov/bundler-plugin-core の normalizePath と、その Vite ファイル名パターンのテストを調べます。issue にある 2 つの maplibre パスで衝突を再現し、正規化によってハッシュより前のアセット名全体が保持されることを確認します。これらのパスが異なる形に正規化され、変更されていないアセットで誤ったサイズ変更が発生しなくなれば完了です。
索引モデルが issue の本文から書いたものです。
説明
Describe the bug
normalizePath in @codecov/bundler-plugin-core replaces everything from the first - in a file name up to the extension with *, not only the hash. If two assets share the text before their first -, they get the same normalized path, and the bundle comparison matches the wrong files against each other.
On https://github.com/kristof-mattei/endless-ssh-rs-with-web/pull/3817#issuecomment-6641294034 (the rows are in the comment's edit history), the bundle report contained these two rows:
| Asset Name | Size Change | Total Size | Change (%) |
|---|---|---|---|
assets/maplibre-*.js |
-517.19kB | 1.85kB | -99.64% |
assets/maplibre-*.js |
517.19kB | 519.04kB | 27926.19% ⚠️ |
Both rows come from two unchanged files matched against each other: maplibre-gl-worker-Br3j0JGE.js (519.04 kB) and maplibre-gl-AxBTEyzg.js (1.85 kB). The size changes cancel out exactly. The bundle totals in the same comment are correct.
Environment
@codecov/vite-plugin2.0.1 and@codecov/bundler-plugin-core2.0.1 (the latest release of both)- Vite 8.3.5 with Rolldown 1.2.16, default
chunkFileNamesandassetFileNames - CI on GitHub Actions. Reproduced locally on Node.js 26.13.0
To Reproduce
import { normalizePath } from "@codecov/bundler-plugin-core";
normalizePath("assets/maplibre-gl-AxBTEyzg.js", "assets/[name]-[hash].js", "vite");
// "assets/maplibre-*.js"
normalizePath("assets/maplibre-gl-worker-Br3j0JGE.js", "assets/[name]-[hash][extname]", "vite");
// "assets/maplibre-*.js"
normalizePath("assets/preload-helper-BRbzi6Nc.js", "assets/[name]-[hash].js", "vite");
// "assets/preload-*.js"
Expected behavior
normalizePath replaces only the hash: assets/maplibre-gl-*.js, assets/maplibre-gl-worker-*.js, assets/preload-helper-*.js. If an asset is unchanged, the bundle report lists no size change for it.
Additional context
None at the moment
- 主要言語
- 言語のデータがありません
- スター
- 52
- フォーク
- 26
- PR マージ指標
- 30日以内にマージされた PR はありません
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
codecov/feedback のほかの issue
-
Docs Waiting for: Product Owner
難易度 1/5 1時間未満 初心者へのやさしさ 65/100
-
Feature Requestオープン
難易度 5/5 1週間以上 初心者へのやさしさ 5/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 54/100
-
難易度 4/5 3〜5日 初心者へのやさしさ 48/100
-
難易度 5/5 1週間以上 初心者へのやさしさ 8/100
codecov/feedback の issue をすべて見る
似ている issue
-
Type: Bug
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 77/100
eyalgolan/statecraft-israel#2732 ·
メンテナーはふだん 1 日以内に返信
-
Create Noise Latents ignores randomize_seed and produces the same noise every run対応中かも @griptapeops が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
griptape-ai/griptape-nodes-library-diffusers#127 ·
メンテナーはふだん 1 日以内に返信
-
Jenkins capacity report: metrics history is lost when archiving a month fails対応中かも @RaphaelFakhri が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
adoptium/infrastructure#4568 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
SAP/crossplane-provider-btp#1175 ·
メンテナーはふだん 1 日以内に返信