我试图使用Grunt作为我的网络应用程序的构建工具。
我想至少有两个设置:
I.开发设置-从单独的文件加载脚本,没有串联,
所以我的index.html看起来是这样的:
<!DOCTYPE html>
<html>
<head>
<script src="js/module1.js" />
<script src="js/module2.js" />
<script src="js/module3.js" />
...
</head>
<body></body>
</html>
2生产设置-加载我的脚本缩小和连接在一个文件,
根据index.html:
<!DOCTYPE html>
<html>
<head>
<script src="js/MyApp-all.min.js" />
</head>
<body></body>
</html>
问题是,当我运行grunt dev或grunt prod时,我如何让grunt根据配置创建这些index.html ?
或者也许我在错误的方向上挖掘,它会更容易总是生成MyApp-all.min.js,但把它里面要么我所有的脚本(连接)或加载器脚本异步加载这些脚本从单独的文件?
你们是怎么做到的,伙计们?