Using Acorn asset middleware Bud/Vite

With the upgrade to Sage 11 and replacing Bud with Vite, this means any reusable code (e.g. Composer packages) that relies on \Roots\bundle no longer works.

Is there anything available to support bundling/enqueueing assets supporting sites using Bud and Vite?

I can see there is asset middleware, but I am unsure how to use them: acorn/src/Roots/Acorn/Assets/Middleware at main · roots/acorn · GitHub

Thanks

Now you’d just enqueue normally in WordPress and use the Vite facade (e.g. Vite::asset()) for fetching the asset from the manifest.

Hi @Log1x thanks for the response.

I understand this regarding writing new code within Sage 11.

But how can we write backwards compatible code in an acorn package to ensure assets are enqueued in functions when the main application could be using Vite or Bud?

Something like checking function exists for \Roots\bundle\ isn’t ideal since it still exists in v5 of acorn. I can see that bundle does load the Vote manifest, just doesn’t enqueue anything.

Hope that makes sense.