You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When Manganis processes an asset like logo.png it will change the name by adding a hash of the file contents to help with caching. If, however, a CSS file refers to this asset with its original name, it will not work correctly after the build process. For example
background-image:url('/assets/logo.png');
Same issue happens also with JS or JSON files referring to assets. Common case would be providing a manifest JSON for multiple icon files
CSS files may also import other CSS files. Although this might be already be handled by the minification process by combining them all in one file?
/* more styles */@importurl("my-imported-styles.css");
In all these cases, Manganis should fix these filenames to the new generated name and update the respective textual asset files.
This is something that JS tools like Webpack already do, at least to some extent.
Implement Suggestion
Add an asset option for fixing the affected names when encountered in a text file. When processing assets, identify files containing references to other assets, build a dependency graph, process the assets in correct order generating new names, update new asset names into files.
The text was updated successfully, but these errors were encountered:
Related to DioxusLabs#3325
Add functionality to update asset references in CSS, JS, and JSON files during the build process.
* **CSS Changes:**
- Add `update_asset_references` function to update asset references in CSS files.
- Modify `process_css` to call the new function.
* **JSON Changes:**
- Add `update_asset_references` function to update asset references in JSON files.
- Modify `process_json` to call the new function.
* **JS Changes:**
- Add `update_asset_references` function to update asset references in JS files.
- Modify `process_js` to call the new function.
Feature Request
When Manganis processes an asset like
logo.png
it will change the name by adding a hash of the file contents to help with caching. If, however, a CSS file refers to this asset with its original name, it will not work correctly after the build process. For exampleSame issue happens also with JS or JSON files referring to assets. Common case would be providing a manifest JSON for multiple icon files
CSS files may also import other CSS files. Although this might be already be handled by the minification process by combining them all in one file?
In all these cases, Manganis should fix these filenames to the new generated name and update the respective textual asset files.
This is something that JS tools like Webpack already do, at least to some extent.
Implement Suggestion
Add an asset option for fixing the affected names when encountered in a text file. When processing assets, identify files containing references to other assets, build a dependency graph, process the assets in correct order generating new names, update new asset names into files.
The text was updated successfully, but these errors were encountered: