找到一個很好的教程後約requirejs and backbonejshere和更新腳本here。在本文中,他將所有腳本文件構建爲包含視圖和模型的單個JavaScript。像這樣,我需要將我的angularjs and requirejs應用程序構建爲使用this post和this script編寫的單個js文件。 任何人都可以幫助我做到這一點?
我有一個多頁/多功能應用程序minifcation我正在努力工作。 的結構如下 common/
--main config file that defines the common libs
common/build
--app.build.js (see example below)
application1/
--application
--milion other files
因此,我使用grunt-require構建了我的RequireJS應用程序,我相信在後臺使用r.js。然而,在運行的應用程序,我每次都是這樣得到: Uncaught Error: Module name "underscore" has not been loaded yet for context: _. Use require([])
http://requirejs.org/docs/er