【发布时间】:2013-10-30 09:46:58
【问题描述】:
我的网站有以下简单结构:
src
js
core.js
main.js
lib
jquery-1.8.2.js
require-2.1.1.js
require-text.js
templates
1.html
2.html
index.html
build
我希望将所有 js+lib 文件编译成一个 build/js/main.js 文件,而将其他文件复制到 build 文件夹中。如何为此任务编写 grunt.js 配置?看来我应该使用 grunt-contrib-require..
第二个问题是如何将 1.html 和 2.html(我使用 require text!插件)分别编译成一行,并将这些行包含到 build/js/main.js 中?在这种情况下,构建文件夹中应该只有两个文件 - index.html 和 main.js。
【问题讨论】:
标签: javascript node.js compilation requirejs gruntjs