【发布时间】:2014-06-20 22:34:51
【问题描述】:
我使用 Yeoman 来初始化我的 AngularJS 项目(我遵循本指南:http://www.sitepoint.com/kickstart-your-angularjs-development-with-yeoman-grunt-and-bower/),但在阅读了有关最佳实践的更多信息后,我决定重新组织我的代码。
发件人:
app/
styles/
views/
submit.html
search.html
scripts/
app.js
controllers/
submit.js
search.js
index.hmtl
到这个基于模块的结构:
app/
styles/
myApp/
app.js
home/
search/
search.js
search.html
submit/
submit.js
submit.html
index.html
但显然,我不能只更改“app.js”的路径。当我将 index.html 中 app.js 的来源更改为:
<!-- build:js({.tmp,app}) scripts/scripts.js -->
<script src="myApp/app.js"></script>
<!-- endbuild -->
它失败了,网站无法正常加载,但我没有从 grunt 得到任何错误。
如何在不搞砸的情况下进行重组?我是否必须更改 grunt 文件中的某些内容?
【问题讨论】: