add_action('wp_enqueue_scripts', function () {
bundle('app')->enqueue();
if (is_account_page() || is_cart() || is_checkout()) {
bundle('woocommerce')->enqueueCss();
}
}, 100);
If I use enqueue() it works apparently but generates a reload on Chrome because no woocommerce.js was found and thus loading the same app.js twice. If I use enqueueCss() it doesn’t work while yarn dev but it does work when yarn build.
I guess there is a bug in acorn and another one in bud.
FWIW I also had this issue previously but at some point this year the original bug seems to have been fixed because I can now use enqueueCss() without any issues locally. Now if I use enqueue() for bundles that don’t also have a JS file it breaks hot reloading locally. This makes sense, though, and isn’t a problem for me now that enqueueCss() is working.