I have an extra css set up (without js) for woocommerce (woocommerce.css).
In bud.config
.entry({
app: ["@scripts/app", "@styles/app"],
editor: ["@scripts/editor", "@styles/editor"],
woocommerce: ["@styles/woocommerce"],
})
Then, in setup.php:
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.