引用插件时,RequireJS优化失败(xstyle / css)

时间:2014-04-30 13:44:38

标签: dojo requirejs-optimizer

我遵循了http://requirejs.org/docs/optimization.html中描述的示例文件结构,并获得了有效的构建。然后我修改了two.js看起来像这样:

define(["xstyle/css!app/css/main.css"], function () {
    console.log("two");
});

并将xstyle / css添加到build.js:

({
    baseUrl: "./scripts",
    paths: {
        dojo: "empty:",
        xstyle: "empty:"
    },
    name: "main",
    out: "main-built.js"
})

添加再次运行构建:

  

r.js.cmd -o build.js optimize = none

现在我看到了这个错误:

Tracing dependencies for: main
TypeError: Cannot read property 'normalize' of undefined
In module tree:
    main
      two

Error: TypeError: Cannot read property 'normalize' of undefined
In module tree:
    main
      two

    at Object.<anonymous> (bin\r.js:1187:35)

有许多对此同样错误的引用,但没有解决此特定问题(例如):

Requirejs can't compile my dojo-dependent module

RequireJs optimizer ignore plugin

https://github.com/odoe/AGSModularDemo

是否可以使用requirejs优化dojo应用程序?

0 个答案:

没有答案