Assets.absoluteFilePath()
is undocumented and doesn't work in build plugins
#6552
Milestone
Assets.absoluteFilePath()
is undocumented and doesn't work in build plugins
#6552
CF: 134707b#commitcomment-16742686
In the above commit,
Assets.absoluteFilePath
was implemented intools/static-assets/server/boot.js
. However the documentation for the otherAssets
APIs is intools/isobuild/bundler.js
, where theAssets
APIs are duplicated.This was confusing. It turns out the reason for this is when you are using the asset API from a build plugin. The only way you can do this is:
X
, that depends on packageY
.X
callsY.foo()
Y.foo()
callsAssets.Z()
-- this version ofAssets.Z()
is thebundler.js
version.Note that if
Y.foo()
is called from application code (possibly via some other package), it will use the version inboot.js
.The issue is that in
bundler.js
, we have the contents of the asset but not the on-disk path. This makes implementingAssets.absoluteFilePath
difficult there.Options from here:
Assets.absoluteFilePath()
undocumented.Assets.absoluteFilePath()
inboot.js
and explain the limitation there (it's probably unlikely anyone will ever even try to use in the above way.Assets.absoluteFilePath()
in thebundler.js
context (if this is even possible.The text was updated successfully, but these errors were encountered: