-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathfoundation-sites-scripts.loader.js
50 lines (46 loc) · 1.37 KB
/
foundation-sites-scripts.loader.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
42
43
44
45
46
47
48
49
50
var scripts = [
'foundation.core',
'foundation.abide',
'foundation.accordion',
'foundation.accordionMenu',
'foundation.drilldown',
'foundation.dropdown',
'foundation.dropdownMenu',
'foundation.equalizer',
'foundation.interchange',
'foundation.magellan',
'foundation.offcanvas',
'foundation.orbit',
'foundation.responsiveMenu',
'foundation.responsiveToggle',
'foundation.reveal',
'foundation.slider',
'foundation.sticky',
'foundation.tabs',
'foundation.toggler',
'foundation.tooltip',
'foundation.util.box',
'foundation.util.keyboard',
'foundation.util.mediaQuery',
'foundation.util.motion',
'foundation.util.nest',
'foundation.util.timerAndImageLoader',
'foundation.util.touch',
'foundation.util.triggers'
];
var foundationSitesPath = require('./foundationSitesPath');
var path = require('path');
module.exports = function() {
};
// Create a list of require('path/to/foundation.js');
module.exports.pitch = function(configPath) {
var pathToFoundationSites = foundationSitesPath.getPath(this.context);
var config = require(configPath);
this.cacheable(true);
return scripts.filter(function(script) {
return config.scripts[script];
}).map(function(script) {
var pathToBootstrapJsFile = JSON.stringify(path.join(pathToFoundationSites, 'js', script));
return 'require(' + pathToBootstrapJsFile + ');';
}).join('\n');
};