Added support for JS-Only loader (fragment) #10
Closed
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.
Hi, thanks for this nice library and here is my proposal for an enhancement:
Reasons for the Update:
I've altered the
Iconizr.prototype._renderLoaderFragment
method, so that it enables the following changes/features without disabling any existing ones or default behaviours. So, if the following configurations/options are not set at all, iconizr will just behave the expected way.Changes:
options.loader
options.loader.type
(String) Valid values:"html"
or"js"
. Default:"html"
Specifies the type of loader file to generate. Set to
.html
if<noscript>
fallback is required.options.loader.minify
(Boolean) Default:true
Specifies whether to minify the JS loader code.
options.loader.dest
(String) Default:""
(empty)Indicates the directory for the generated loader file (relative to the output directory).
I couldn’t see any contributing guidelines but, still tried to keep up with your coding style (tabs, indents, etc)... Also tested with
grunt-iconizr
.Note: I might optimize this further (also update the readme) once accepted.
Best,
Onur Y.