优化器不支持路径回退 ("reloaded")

Paths fallback not supported in optimizer ("reloaded")

在使用命令 "activator stage" 构建我的 Play 2.3 应用程序 (sbt 0.13.5) 时出现错误:

Optimizing JavaScript with RequireJS
Error: Error: paths fallback not supported in optimizer. Please provide a build config path override for angular-easyfb

build.sbt:

...
"org.webjars.bower" % "angular-easyfb" % "1.3.1"

main.js:

shim: {
  'angular': {
      deps: ['jquery'],
      exports: 'angular'
  },
  ...
  'angular-easyfb': ['angular']
},
paths: {
    ...
    'angular': ['../lib/angularjs/angular'],
    'angular-easyfb': ['../lib/angular-easyfb/angular-easyfb'],
     ...
}});

在开发模式下一切正常。我的其他基于 webjar 的 js-libs 运行良好,即使在生产模式下也是如此(例如,"org.webjars" % "angular-elastic" % "2.4.2")。

Google 所以给了我很多 "Paths fallback not supported in optimizer" 的结果。 好像有人找到了解决办法,有人没有。

我(作为Java和Java脚本专家)如何系统地分析问题所在?

看看这个 post:

It turns out that RequireJS optimization support does not apply to all Webjars, but rather limited to Classic Webjars.

有一些解释。如果您查看 http://mvnrepository.com/artifact/org.webjars.bower/angular-easyfb/1.3.1 并且它是 jar 文件,您将不会在其中看到任何 webjars-requirejs.js。所以这是你的情况,默认情况下 webjar 与 requirejs 不兼容。

还有一件事:

Remember to have square brackets, otherwise CDN replacement will not happen. For the non-requirejs ready scripts, you should not have square brackets when declaring the paths. Otherwise, rjs will refuse to build with error path fallback not supported.

所以尝试从路径中删除方括号:

'angular-easyfb': '../lib/angular-easyfb/angular-easyfb',