Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/backbone.js/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/spring/12.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Backbone.js yeoman主干网生成器-grunt服务器做什么?_Backbone.js_Yeoman_Yeoman Generator - Fatal编程技术网

Backbone.js yeoman主干网生成器-grunt服务器做什么?

Backbone.js yeoman主干网生成器-grunt服务器做什么?,backbone.js,yeoman,yeoman-generator,Backbone.js,Yeoman,Yeoman Generator,使用时,我不清楚grunt任务是如何工作的 grunt服务器从哪里运行应用程序?它似乎是从.tmp文件夹运行的 grunt服务器:dist从哪里运行应用程序?它似乎是从dist文件夹运行的,但在我的情况下,应用程序无法正确启动。它正试图要求HomePage.js,但找不到 grunt服务器:测试从哪里运行?它运行“watch:livereload”,然后不启动浏览器 当您使用grunt服务器时,您可以从app/dir运行应用程序。app/是纯的、未编译的、未精简的源代码所在。您不需要在.tmp中

使用时,我不清楚grunt任务是如何工作的

  • grunt服务器从哪里运行应用程序?它似乎是从.tmp文件夹运行的
  • grunt服务器:dist
    从哪里运行应用程序?它似乎是从dist文件夹运行的,但在我的情况下,应用程序无法正确启动。它正试图
    要求
    HomePage.js,但找不到
  • grunt服务器:测试从哪里运行?它运行“watch:livereload”,然后不启动浏览器
  • 当您使用grunt服务器时,您可以从app/dir运行应用程序。app/是纯的、未编译的、未精简的源代码所在。您不需要在.tmp中更改任何内容/

  • 当您使用
    grunt server:dist
    时,您可以从app/到dist/构建应用程序,并从dist/运行它。dist/是您的可分发应用程序。 如果您在
    grunt服务器:dist
    和非
    grunt服务器
    中出现js错误,请确保将js链接放在

    <!-- build:js({.tmp,app}) scripts/main.js -->
    <script src="scripts/main.js"></script>
    <script src="scripts/templates.js"></script>
    <script src="scripts/HomePage.js"></script>
    <!-- endbuild -->
    
    
    
    因为构建过程将合并所有这些文件并构建一个新文件(scripts/main.js),而无需将app/scripts的内容复制到dist/scripts中

  • grunt服务器:测试从应用程序运行,基本上足以为测试框架Mocha创建和服务应用程序,以执行测试。这不会启动浏览器,因为它只为测试框架的应用程序提供服务


  • 来源:

    感谢您的见解。关于第二点,我正在主干生成器中使用RequireJS选项。因此,在构建中只有一行:js注释:
    。因此,肯定还有其他问题。