2014-09-18 119 views
0

我有一個head.html文件,其中包括我所有的軟件包組成:Grunt + usemin,如何在一個HTML文件中包含另一個?

<!-- build.js(.) scripts/scripts.js --> 
<script src="scripts/script1.js"></script> 
<script src="scripts/script2.js"></script> 
<!-- endbuild --> 

我需要這個文件是分開的,因爲我想用生成的標籤是不屬於我的網站上的遺留部分束我正在建設的應用程序。

然後,我會像我的index.html做這樣的事情:

<head> 
    <!-- include:head.html --> 
</head> 

咕嚕-usemin似乎並不支持此指令。關於如何讓這種情況發生的任何想法?

回答

0

想通了。使用grunt-includes,這增加了Gruntfile:

includes: { 
    files: { 
     src: ['<%= yeoman.dist %>/{,*/}*.html'], 
     dest: '.' 
    } 
}, 

然後copy一步構建任務後添加一個'includes'一步。

相關問題