我试图在我的软件包中添加弱依赖项。但它似乎没有奏效。这是回购https://github.com/arunhedcet/meteor-weak-dependency-test
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')
})
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
我无法找出错误是什么。