Output sass and js files to their own subdirectories in the public folder

bud.config.js:

    .entry('app', ['@scripts/app', '@styles/app'])
    .entry('editor', ['@scripts/editor', '@styles/editor'])
	
    .entry('custom-block', ['@scripts/custom-block', '@styles/custom-block'])

(e.g. setup.php)

add_action('wp_enqueue_scripts', function () {
    if (!has_block('themenamespace/custom-block')) {
        return; // skip
    }

    bundle('custom-block')->enqueue();
}, 100);
1 Like