-
Notifications
You must be signed in to change notification settings - Fork 8
Add support for manifest configuration with advanced asset options #66
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for manifest configuration with advanced asset options #66
Conversation
- Refactored `WebpackManifestLoader` and `AbstractWebpackLoader` to handle array-based manifest entries with custom configuration. - Updated `AssetFactory` to support type-safe configurations combining `AssetConfig` and `AssetExtensionConfig`. - Introduced new test cases for custom manifest configurations. - Enhanced documentation to detail alternative manifest formats and examples.
…ackManifestLoader` for improved asset handling - Renamed `sanitizeHandle` to `normalizeHandle` for clarity. - Adjusted `handleAsArray` to streamline configuration processing and include exception handling. - Updated `AssetFactory` usage to a static call for better readability.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #66 +/- ##
============================================
+ Coverage 86.79% 87.22% +0.43%
- Complexity 315 334 +19
============================================
Files 27 27
Lines 901 955 +54
============================================
+ Hits 782 833 +51
- Misses 119 122 +3
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
Hi @Chrico |
…consistency with static-based asset resolution
…for consistency with instance-based asset resolution - Updated `AbstractWebpackLoader` and `WebpackManifestLoader` to use the instance method `resolveClassByExtension`.
Please check if the PR fulfills these requirements
What kind of change does this PR introduce? (Bug fix, feature, docs update, ...)
Allow to have a predefined configuration for each asset created and registered through the WebPack Manifest Loader
What is the current behavior? (You can also link to an open issue here)
When we want to use the WebPack Manifest Loader, we luckly have to refine the asset configuration in some manner, e.g. to set multiple locations, to set a version, to disable the enqueue and so on...
What is the new behavior (if this is a feature change)?
We can take advantage of the Manifest Plugin
generatecallback, a callback giving us the possibility to customize the output generated by the WebPack plugin. Thanks to that, we can generate a manifest where the handle value isn't just a file path, but an object holding the configuration later on we'll serve to theAssetFactory.This permit us to avoid to manipulate the asset before the registration happen, delegating to the
WebpackManifestLoaderthis task.Does this PR introduce a breaking change? (What changes might users need to make in their application due to this PR?)
No, the implementation is still supporting the previous manifest structure, but add support for the new object configuration.
Other information
WebpackManifestLoaderandAbstractWebpackLoaderto handle array-based manifest entries with custom configuration.AssetFactoryto support type-safe configurations combiningAssetConfigandAssetExtensionConfig.