Skip to content
This repository was archived by the owner on May 25, 2019. It is now read-only.

Commit ec4721a

Browse files
committed
feat(gh-pages): overwrite the js dependancies
Add the possibility to overwrite the main page js dependancies by passing a function on the js key.
1 parent 944e81a commit ec4721a

File tree

3 files changed

+20
-10
lines changed

3 files changed

+20
-10
lines changed

README.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -177,8 +177,11 @@ This config object can content the following key:
177177
inlineJS : String,
178178
// The javascript to inline at the end of the index.html file in the gh-pages
179179

180-
js : Array.of(String),
181-
// The css files to use in the gh-pages (ex: ['dist/ui-utils.js'])
180+
js : Array.of(String) | Function,
181+
// The js files to use in the gh-pages, loaded after angular by default (ex: ['dist/ui-utils.js'])
182+
// or
183+
// function that returns the final array of files to load
184+
// (ex: function(defaultJsFiles) { return ['beforeFile.js'].concat(defaultJsFiles); })
182185

183186
css : Array.of(String),
184187
// The css files to use in the gh-pages

branch/gh-pages/index.tmp.html

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -112,16 +112,23 @@ <h1><%= public.humaName %></h1>
112112

113113
<!-- Le javascript
114114
================================================== -->
115-
<script src="assets/vendor/prettify.js"></script>
116-
117-
<script src="assets/vendor/angular.min.js"></script>
118-
<script src="assets/vendor/ui-bootstrap-tpls.min.js"></script>
119-
<script src="core/prettifyDirective.js"></script>
120-
<script src="core/plunker.js"></script>
121-
122115
<%
116+
var defaultjs = [
117+
'assets/vendor/prettify.js',
118+
'assets/vendor/angular.min.js',
119+
'assets/vendor/ui-bootstrap-tpls.min.js',
120+
'core/prettifyDirective.js',
121+
'core/plunker.js',
122+
];
123+
123124
var jsFiles = public.js || [];
124125

126+
if(typeof jsFiles === 'function'){
127+
jsFiles = public.js(defaultjs);
128+
}else {
129+
jsFiles = defaultjs.concat(jsFiles);
130+
}
131+
125132
for(var i = 0, len = jsFiles.length; i < len; i++) {
126133
print('<script src="' + jsFiles[i] + '"></script>\n');
127134
}

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "angular-ui-publisher",
3-
"version": "1.2.2",
3+
"version": "1.2.3",
44
"description": "Helper component for building and publishing your angular modules as bower components",
55
"main": "Gulpfile.js",
66
"dependencies": {

0 commit comments

Comments
 (0)