If I use api.imply in package.js do I have to use api.use for the same package?

扶醉桌前 提交于 2019-12-07 03:25:08

问题


When construction meteor packages you can add files like this:

api.use('fourseven:scss@0.9.4', ['client', 'server']);

You can also tell meteor to give the package user access to other packages like this:

api.imply('fourseven:scss@0.9.4', ['client', 'server']);

In the documentation it's not clear if implying a package also makes it available. For instance, I'm not sure if it is redundant to do this:

api.use('fourseven:scss@0.9.4', ['client', 'server']);
api.imply('fourseven:scss@0.9.4', ['client', 'server']);

回答1:


I've just tested this use case with a couple packages of mine and I can assert that implying a package doesn't make it available automatically in the package source.

So it means that

api.use("foo:bar@x.y.z");
api.imply("foo:bar@x.y.z");

is NOT redundant if you intend to use and reference foo:bar in the current package source.

You can think of api.imply as an api.use for the app context that has no impact on the current package context.

I've heard that some time in the future they plan to integrate a package-like API for the app context, which is going to be useful to address load order among other things.



来源:https://stackoverflow.com/questions/25607825/if-i-use-api-imply-in-package-js-do-i-have-to-use-api-use-for-the-same-package

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!