javascript - 使用 NodeJS 构建 Dojo - 无法生成图层

标签 javascript node.js build dojo

我在为我的网络应用构建图层时遇到问题。我安装了 Node,我可以使用 packages 指令来压缩我的所有文件,但是尽管我尝试了几天我能想到的所有可能的路径和指令组合,但我无法构建一个层。

这是我认为应该有效的配置文件:

var profile = {
    // point basePath to ~/dev
    basePath: "/Users/ferg/Dropbox/webdev/x-wing_squadron_builder/www/js/",

    // point releaseDir to ~/dev/myapp-deploy
    releaseDir: "./",

    action:"release",
    optimize:"shrinksafe",
    stripConsole: "normal",
    async: 1,

    layers: {   
        "squad_builder_deploy/squad_builder_all": {
            include: [
                "squad_builder/SquadList.js",
                "squad_builder/SquadPane.js" // there are actually many more files, this is just for testing...
            ]
        }
    },

    resourceTags: {
         amd: function(filename, mid) {
             return /\.js$/.test(filename);
         }
     }
}

我的目录结构是:

www
    - js
        - dojo_toolkit
            - dojo
            - dijit
            - dojox
        - squad_builder (my app)
        - squad_builder_deploy (where I want to generate my layer)

在终端中运行:

buildscripts ferg$ ./build.sh load=build profile=../../../squad_builder/squad_builder  -r 

给我:

processing profile resource /Users/ferg/Dropbox/webdev/x-wing_squadron_builder/www/js/squad_builder/squad_builder.profile.js
discovering resources...
starting reading resources...
starting processing raw resource content...
starting tokenizing resource...
starting processing resource tokens...
starting parsing resource...
starting processing resource AST...
starting executing global optimizations...
starting writing resources...
error(303) Missing include module for layer. missing: squad_builder/SquadList.js; layer: squad_builder_deploy/squad_builder_all
error(303) Missing include module for layer. missing: squad_builder/SquadPane.js; layer: squad_builder_deploy/squad_builder_all
starting cleaning up...
waiting for the optimizer runner to finish...
starting reporting...
Report written to /Users/ferg/Dropbox/webdev/x-wing_squadron_builder/www/js/build-report.txt
Process finished normally.
    errors: 2
    warnings: 0
    build time: 1.734 seconds

我做错了什么?

最佳答案

模块 ID 不是文件名。您不应该在 SquadList 或 SquadPane 上有扩展。您也不应该生成应用程序中不存在的文件层。一个层只是一个现有的模块文件,其中包含许多额外的模块以提高效率。

关于javascript - 使用 NodeJS 构建 Dojo - 无法生成图层,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18716435/

相关文章:

javascript - ASP.NET初学者关于悬停效果的问题

javascript - 未调用创建事件处理程序。扩展 jQueryUI 对话框

javascript - 如何使用 jquery 将 DOM 中的所有输入值与特定数据属性相加

java - 在 Eclipse 中排除库类

git - TFS Git 项目中的依赖项目 VNEXT 构建

linux - 如何将命令应用于 GNU Make 中所有已更改的依赖项?

javascript - Cheerio爬虫 : How do I ensure a page is fully loaded before extracting the data?

javascript - Node 调度触发问题

node.js - 如何将 process.stdin 的输入与字符串进行比较? Node.js

javascript - Array.prototype.slice.call 返回空数组