Added support to pass an array of url’s to criticalUrl property. #11
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Added support to pass a config array to the
criticalUrl
property which consists of a URL and an optional ID property.The ID property is used to create different filenames. If it's not passed, files will get overwritten. But I did not make it mandatory to be as backwards compatible as possible.
To come back to the comment I received in the issue this pull requests resolves: The idea for this may come from my usage of Craft CMS, but it does not assume that Craft is being used. Maybe other CMS's or other usage of this critical plugin may require something like this.
It just may come in handy without breaking stuff.
The reason I propose a pull request instead of using my own script is that we wouldn't have to support two separate scripts. And it's just a small change.
Related issues
A (tested) proposition to support issue #3