forked from angular-ui/ui-sortable
-
Notifications
You must be signed in to change notification settings - Fork 0
/
publish.js
41 lines (33 loc) · 1.21 KB
/
publish.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
/* jshint node:true */
'use strict';
var fs = require('fs');
var path = require('path');
module.exports = function() {
var wiredep = require('wiredep');
var bower_dependencies = wiredep({ cwd: __dirname });
var js_dependencies = []
.concat(bower_dependencies.packages['jquery'].main)
.concat(bower_dependencies.packages['jquery-ui'].main)
.map(function(p) {
return p.replace(path.join(__dirname, '/'), '');
});
var css_dependencies = [
'bower_components/jquery-ui/themes/smoothness/jquery-ui.css'
];
function putThemInVendorDir (filepath) {
return 'vendor/' + path.basename(filepath);
}
return {
humaName : 'UI.Sortable',
repoName : 'ui-sortable',
inlineHTML : fs.readFileSync(__dirname + '/demo/demo.html'),
inlineJS : fs.readFileSync(__dirname + '/demo/demo.js'),
css: css_dependencies.map(putThemInVendorDir).concat(['demo/demo.css']),
js : function(defaultJsFiles){
// HACK TO LOAD JQUERY BEFORE ANGULAR
return ['vendor/jquery.js'].concat(defaultJsFiles, js_dependencies.slice(1).map(putThemInVendorDir).concat(['dist/sortable.js']));
},
bowerData: { main : './sortable.js' },
tocopy : css_dependencies.concat(js_dependencies)
};
};