0

我的 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
4

1 回答 1

3

这是所有可用的选项

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

使用优化器是这样的:

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

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

optimizer.exe --verbose true

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

于 2013-04-16T19:19:57.543 回答