Gathering detailed insights and metrics for gulp-reference-manager
Gathering detailed insights and metrics for gulp-reference-manager
npm install gulp-reference-manager
Typescript
Module System
Node Version
NPM Version
Total Downloads
577
Last Day
1
Last Week
3
Last Month
7
Last Year
78
Minified
Minified + Gzipped
Latest Version
0.0.1
Package Id
gulp-reference-manager@0.0.1
Unpacked Size
30.65 kB
Size
6.53 kB
File Count
12
NPM Version
5.5.1
Node Version
8.9.0
Cumulative downloads
Total Downloads
Last day
0%
1
Compared to previous day
Last week
200%
3
Compared to previous week
Last month
600%
7
Compared to previous month
Last year
-17.9%
78
Compared to previous year
1
Used to automatically rearrange js order by named groups. Reference order between groups depends on specified group order while reference order inside the same group is maintained the same as declared.
script
tag by attribute: data-group
.a.html
1 <script type = "text/javascript" src = "1.js" data-group = "group1"></script> 2 <script type = "text/javascript" src = "m.js"></script> 3 <script type = "text/javascript" src = "a.js" data-group = "group2"></script> 4 5 <div>...</div> 6 7 <script type = "text/javascript" src = "2.js" data-group = "group1"></script> 8 <script type = "text/javascript" src = "n.js" data-group = "default"></script> 9 10 <!-- Tell gulp-reference-manger [do not] manage 'A.js', keep it where it is declared --> 11 <script type = "text/javascript" src = "A.js" data-no-group-manage = ""></script>
a.html
1 <script type = "text/javascript" src = "1.js" data-group = "group1"></script> 2 <script type = "text/javascript" src = "m.js"></script> 3 <script type = "text/javascript" src = "a.js" data-group = "group2"></script> 4 5 <div>...</div> 6 7 <script type = "text/javascript" src = "2.js" data-group = "group1"></script> 8 <script type = "text/javascript" src = "n.js" data-group = "default"></script> 9 10 <!-- Tell gulp-reference-manger [do not] manage 'A.js', keep it where it is declared --> 11 <script type = "text/javascript" src = "A.js" data-no-group-manage = ""></script> 12 13 14 <!-- Tell gulp-reference-manager to inject rearranged script references here and meanwhile remove the following placeholder --> 15 <slot for = "grm:js" group-order = "default, group1, group2"/>
The resulting content for a.html will be like:
1 <div>...</div> 2 3 <!-- Tell gulp-reference-manger [do not] manage 'A.js', keep it where it is declared --> 4 <script type = "text/javascript" src = "A.js" data-no-group-manage = ""></script> 5 6 <script type = "text/javascript" src = "m.js" data-group = "default"></script> 7 <script type = "text/javascript" src = "n.js" data-group = "default"></script> 8 <script type = "text/javascript" src = "1.js" data-group = "group1"></script> 9 <script type = "text/javascript" src = "2.js" data-group = "group1"></script> 10 <script type = "text/javascript" src = "a.js" data-group = "group2"></script>
if specified order is:
1 <slot for = "grm:js" group-order = "group2, default"/>
The resulting content for a.html will be like:
1 <div>...</div> 2 3 <!-- Tell gulp-reference-manger [do not] manage 'A.js', keep it where it is declared --> 4 <script type = "text/javascript" src = "A.js" data-no-group-manage = ""></script> 5 6 <script type = "text/javascript" src = "a.js" data-group = "group2"></script> 7 <script type = "text/javascript" src = "m.js" data-group = "default"></script> 8 <script type = "text/javascript" src = "n.js" data-group = "default"></script> 9 <script type = "text/javascript" src = "1.js" data-group = "group1"></script> 10 <script type = "text/javascript" src = "2.js" data-group = "group1"></script>
Developers can tell this plugin do not manage reference by declaring attribute: data-no-group-manage=''
in the script
tag.
Note that declaration with only attribute name:
data-no-group-manage
without attribute value:=''
will not work.
Script references without data-group
and data-no-group-manage
attribute will also be managed, by being classified to the preset group named default
.
By default, default
group is the first group picked to output js reference.
The final reference output divides into two parts:
- Group order specified part: A;
- Group order not specified part: B;
which means:
Develops may specify only the subset of the entirely groups inferred from
script
tags.
and
- Part A takes precedence over part B.
- Group order in part A is the same sequence as specified by
group-order
attribute.- Group order in part B is the same sequence as the ascent order of group name, while
default
group is always the first picked group.
MIT
No vulnerabilities found.
No security vulnerabilities found.