2016-10-01 51 views
0

剛下載Foundation 6.2.3準備從5.5遷移項目。有關如何創建自定義foundation.css文件以包含我需要的組件的說明非常簡單明瞭,但創建自定義foundation.js文件也是如此。 dists/方向包含所有基礎JavaScript代碼,即使我沒有使用給定的組件。如何創建最小的foundation.js文件

起初我還以爲是在plugins/目錄中的各種小Javascript文件的簡單串聯,但似乎並不如此。例如,在dists/foundation.js的頂部是看起來像plugins/foundation.core.js的內容可疑的東西,但有差異。例如,foundation.js的版本是6.2.3,而foundation.core.js的版本是6.2.2。刪除似乎已插入foundation.js然後對foundation.core.js進行差異的主要空白會產生一些差異。很顯然,構建foundation.js所需的組件不包含在默認源中。

我真的很想能夠建立一個最小的foundation.js伴隨我最小的foundation.css文件。任何幫助不勝感激。謝謝。

回答

0

我使用基金會6.2.4 各種javascript文件的正確加載順序應該是:

foundation.core.js    
foundation.util.box.js  
foundation.util.keyboard.js  
foundation.util.mediaQuery.js      
foundation.util.motion.js        
foundation.util.nest.js   
foundation.util.timerAndImageLoader.js  
foundation.util.touch.js  
foundation.util.triggers.js               
foundation.abide.js  
foundation.accordion.js  
foundation.accordionMenu.js    
foundation.drilldown.js  
foundation.dropdown.js  
foundation.dropdownMenu.js    
foundation.equalizer.js  
foundation.interchange.js  
foundation.magellan.js  
foundation.offcanvas.js  
foundation.orbit.js  
foundation.responsiveMenu.js  
foundation.responsiveToggle.js  
foundation.reveal.js  
foundation.slider.js  
foundation.sticky.js    
foundation.tabs.js  
foundation.toggler.js   
foundation.tooltip.js 

這些都是需要的各種功能(依賴)的文件:

accordion: 
    foundation.util.keyboard.js 
    foundation.util.motion.js 

accordionMenu: 
    foundation.util.keyboard.js  
    foundation.util.motion.js  
    foundation.util.nest.js 

drilldown: 
     foundation.util.keyboard.js  
     foundation.util.motion.js  
     foundation.util.nest.js 

dropdownMenu: 
     foundation.util.keyboard.js  
     foundation.util.motion.js  
     foundation.util.box.js  
     foundation.util.nest.js 

dropdown: 
     foundation.util.keyboard.js  
     foundation.util.box.js  
     foundation.util.triggers.js 

interchange: 
     foundation.util.triggers.js  
     foundation.util.timerAndImageLoader.js 

magellan: 
     foundation.util.motion.js 

offcanvas: 
     foundation.util.motion.js  
     foundation.util.triggers.js 

orbit: 
     foundation.util.motion.js  
     foundation.util.timerAndImageLoader.js  
     foundation.util.keyboard.js  
     foundation.util.touch.js 

responsiveMenu: 
     foundation.util.triggers.js  
     foundation.util.mediaQuery.js  
     foundation.accordionMenu.js  
     foundation.drilldown.js  
     foundation.dropdownMenu.js  
     foundation.util.nest.js 

responsiveToggle: 
     foundation.util.mediaQuery.js 

reveal: 
     foundation.util.box.js  
     foundation.util.motion.js  
     foundation.util.triggers.js  
     foundation.util.mediaQuery.js 

slider: 
     foundation.util.triggers.js  
     foundation.util.motion.js  
     foundation.util.keyboard.js  
     foundation.util.touch.js 

sticky: 
     foundation.util.triggers.js  
     foundation.util.mediaQuery.js 

tabs: 
     foundation.util.keyboard.js  
     foundation.util.timerAndImageLoader.js 

toggler: 
     foundation.util.motion.js 

tooltip: 
     foundation.util.box.js  
     foundation.util.triggers.js  
     foundation.util.mediaQuery.js  
     foundation.util.motion.js 

motion-ui: 
     foundation.util.motion.js 

請注意,爲了使最終文件的工作,你必須:

1)連接它們

2)使用巴別 「編譯」 連結文件(預置值:ES2015)

3)醜化它