流星弱依赖不起作用

时间:2016-02-25 13:29:16

标签: javascript meteor

我试图在我的软件包中添加弱依赖项。但它似乎没有奏效。这是回购https://github.com/arunhedcet/meteor-weak-dependency-test

package.js

Package.describe({
  summary: "Test of Meteor's weak dependency resolution"
})

Package.on_use(function (api) {
  api.use('iron:router', ['client', 'server'], {weak: true})

  api.add_files('weak-test.js', 'server')
})

weak-test.js

var router = Package['iron_router'];

console.log("[weak-test] iron-router package found?", !!router);
console.log(router);

在这些情况下看起来它正常工作

https://github.com/meteor/meteor/tree/dc3cd6eb92f2bdd1bb44000cdd6abd1e5d0285b1/packages/facts

https://github.com/meteor/meteor/tree/dc3cd6eb92f2bdd1bb44000cdd6abd1e5d0285b1/packages/markdown

我无法找出错误是什么。

0 个答案:

没有答案