Closed aleclarson closed 6 years ago
It's easy enough to track which packages have had their configuration loaded by using a WeakMap
object. Closing this for now.
Update: Packages are now created once per bundle, so loading a package's config files every time a bundle uses a package is unavoidable. And it's really no biggie. 😁
The virtual filesystem (
Package
objects and file objects) is owned by the bundler (not the bundles). In other words, all bundles use the same objects.We need an API that lets "bundle plugins" hook into the filesystem when at least one bundle is using them. The main use case I have in mind is for loading plugin-specific configuration for each new
Package
object.The
hookPackages
method does not fulfill this need in its current form, because it creates a function for everyBundle
object. Package configuration would be loaded once per bundle that uses the plugin, which is undesirable.