refactor(assets): align dist filenames with webpack manifest#488
refactor(assets): align dist filenames with webpack manifest#488firestar300 wants to merge 3 commits intomasterfrom
Conversation
- Use stable output names in production (app.js, [name].css) and same MiniCssExtract + WebpackManifestPlugin in all modes. - Register theme JS/CSS from assets.json only; remove is_minified() and SCRIPT_DEBUG-based branching. - Fix get_asset_data() static cache to key by the requested filename. - Update PHPDoc and inline comments to match the new flow.
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit cb08f43. Configure here.
| * | ||
| * @return bool | ||
| * @author Nicolas JUEN | ||
| */ |
There was a problem hiding this comment.
Login stylesheet returns invalid path without empty guard
Medium Severity
login_stylesheet_uri() blindly returns 'dist/' . $this->get_min_file('login') with no guard for an empty result. When get_min_file() returns '' (e.g., assets.json missing or lacking the key), this produces the invalid path 'dist/', which gets used as the login page CSS URL. The sibling method stylesheet_uri() in the same file correctly guards with ! empty($file) checks and multiple fallbacks — login_stylesheet_uri() lost its only fallback ('dist/login.css') during this refactor without gaining equivalent protection.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit cb08f43. Configure here.


Note
Medium Risk
Medium risk because it changes production build output names and removes
SCRIPT_DEBUG/minified branching, which can break asset loading ifdist/assets.jsonor expected compiled files are missing or out of sync.Overview
Build outputs are standardized: production now emits stable filenames (
[name].js,[name].css) and always writesdist/assets.jsonviaWebpackManifestPlugin, withMiniCssExtractPluginenabled in all modes.Theme asset registration is refactored to always resolve JS/CSS/editor/login filenames via
assets.json(droppingSCRIPT_DEBUG/is_minified()branching) and to use theme versioning consistently for styles.get_asset_data()caching is fixed to key by the requested filename, and related comments/docs are updated.Reviewed by Cursor Bugbot for commit cb08f43. Bugbot is set up for automated code reviews on this repo. Configure here.