如何查看durandal优化器中的错误?

时间:2013-04-16 18:26:11

标签: requirejs durandal

我的durandal项目的优化器停止了工作。我在cmd.exe中运行它。关于我可以去哪里查看任何错误的任何想法?它会打印出它正在做的事情,但没有错误。然后它无法生成我的main-built.js文件。 (好吧,它产生一个空白的)。

这是输出的内容:

出于本示例的目的,我的项目被称为“myapp”,它位于c:\ projects

C:\Projects\myapp\App\durandal\amd>c:\projects\myapp\App\durandal\amd\optimizer.exe --source c:\projects\myapp\app\

Using default base configuration.
Configuring for deploy with almond (custom).
{
  "name": "durandal/amd/almond-custom",
  "inlineText": true,
  "stubModules": [
    "durandal/amd/text"
  ],
  "paths": {
    "text": "durandal/amd/text"
  },
  "baseUrl": "c:\\projects\\myapp\\app\\",
  "mainConfigFile": "c:\\projects\\myapp\\app\\main.js",
  "include": [
    "c:/projects/myapp/app/customViewEngine",
    "c:/projects/myapp/app/main-built",
    "c:/projects/myapp/app/main",
    "c:/projects/myapp/app/durandal/app",
    "c:/projects/myapp/app/durandal/composition",
    "c:/projects/myapp/app/durandal/events",
    "c:/projects/myapp/app/durandal/http",
    "text!c:/projects/myapp/app/durandal/messageBox.html",
    "c:/projects/myapp/app/durandal/messageBox",
    "c:/projects/myapp/app/durandal/modalDialog",
    "c:/projects/myapp/app/durandal/system",
    "c:/projects/myapp/app/durandal/viewEngine",
    "c:/projects/myapp/app/durandal/viewLocator",
    "c:/projects/myapp/app/durandal/viewModel",
    "c:/projects/myapp/app/durandal/viewModelBinder",
    "c:/projects/myapp/app/durandal/widget",
    "c:/projects/myapp/app/durandal/bindings/datePicker",
    "c:/projects/myapp/app/durandal/plugins/router",
    "c:/projects/myapp/app/durandal/transitions/entrance",
    "c:/projects/myapp/app/viewmodels/batchsubmissions",
    "c:/projects/myapp/app/viewmodels/customers",
    "c:/projects/myapp/app/viewmodels/dashboard",
    "c:/projects/myapp/app/viewmodels/emailtitles",
    "c:/projects/myapp/app/viewmodels/entersubmissions",
    "c:/projects/myapp/app/viewmodels/flickr",
    "c:/projects/myapp/app/viewmodels/help",
    "c:/projects/myapp/app/viewmodels/programdetails",
    "c:/projects/myapp/app/viewmodels/shell",
    "c:/projects/myapp/app/viewmodels/titlesetup",
    "c:/projects/myapp/app/viewmodels/welcome",
    "text!c:/projects/myapp/app/views/batchsubmissions.html",
    "text!c:/projects/myapp/app/views/customers.html",
    "text!c:/projects/myapp/app/views/dashboard.html",
    "text!c:/projects/myapp/app/views/detail.html",
    "text!c:/projects/myapp/app/views/emailtitles.html",
    "text!c:/projects/myapp/app/views/entersubmissions.html",
    "text!c:/projects/myapp/app/views/flickr.html",
    "text!c:/projects/myapp/app/views/help.html",
    "text!c:/projects/myapp/app/views/programdetails.html",
    "text!c:/projects/myapp/app/views/shell.html",
    "text!c:/projects/myapp/app/views/titlesetup.html",
    "text!c:/projects/myapp/app/views/welcome.html"
  ],
  "exclude": [],
  "keepBuildDir": true,
  "optimize": "uglify2",
  "out": "c:\\projects\\myapp\\app\\main-built.js",
  "pragmas": {
    "build": true
  },
  "wrap": true,
  "insertRequire": [
    "main"
  ]
}
Deleting old output file.

Tracing dependencies for: durandal/amd/almond-custom

1 个答案:

答案 0 :(得分:3)

以下是所有可用选项

  1. - mode 指示优化器是否应该“生成”r.js配置或实际“构建”优化的JS应用程序。默认值构建
  2. - source 包含应用程序源的文件夹的路径。
  3. - config 自定义r.js配置文件的路径,用作生成配置的基础。
  4. - 详细表示应使用详细的控制台日志记录。默认值false
  5. - loader 指示要为'almond'或'require'优化哪个脚本加载器。默认值杏仁
  6. - plugin 用于优化最终构建文件视图的视图插件。默认值文本
  7. - pluginExtension 视图文件扩展名。默认值.html
  8. 使用优化器就像这样:

    optimizer.exe --source c:\project1\app\ --mode generate
    

    所以,也许你应该试试这个:

    optimizer.exe --verbose true
    

    如果这不起作用..那么你总是可以下拉源并尝试在本地调试它。