Updating Bud to 6.14.x adds all 'wp-includes' scripts to front-end

I’m running a brand new Radicle (1.2.0) project and updated all @roots/xxx dependencies to 6.14.3. However, it seems that this causes all vendor js files to be included in the app bundle resulting in a long list of added scripts in the front-end.

The public/dist/js folder now includes a bundle/vendor.js file, probably added because of this list with app dependencies in the entrypoints.json.

{
  "app": {
    "js": [
      "js/runtime.29298f.js",
      "js/bundle/vendor.js",
      "js/app.cd989a.js"
    ],
    "css": [
      "css/app.c456e0.css"
    ],
    "dependencies": [
      "react",
      "wp-blocks",
      "wp-data",
      "wp-rich-text",
      "wp-plugins",
      "wp-hooks"
    ]
  },
  "editor": {
    "js": [
      "js/runtime.29298f.js",
      "js/bundle/vendor.js",
      "js/editor.ca1ad2.js"
    ],
    "css": [
      "css/editor.e8a460.css"
    ],
    "dependencies": [
      "react",
      "wp-blocks",
      "wp-data",
      "wp-rich-text",
      "wp-plugins",
      "wp-hooks",
      "wp-i18n",
      "wp-block-editor",
      "wp-components"
    ]
  }
}

Any help would be appreciated!

Hi there! I haven’t had a chance to test this out yet, but are things at least working for you as expected with the bundled version (6.13.1)?

Hi Ben, thanks for your reply. Yes, 6.13.1 works as expected.

Also, setting bud.splitChunks(false) seems to work with 6.14.3. Initially I expected this would just reduce the entire list of scripts to one big chunk, but from what I can see now it doesn’t include previously loaded scripts either.

1 Like

6.15.0 fixes this.

bud.splitChunks(false) is exactly what @roots/sage uses by default now :+1:

1 Like

Thanks for all the hard work @kellymears!

Im getting:

BudError 

✘ Cannot read properties of undefined (reading 'fromMap')

 ERR_PNPM_RECURSIVE_EXEC_FIRST_FAIL  Command "bud" not found

On any bud command after updating to 6.15.0. Any idea what that might be?

I can reproduce this if I install using pnpm without the --public-hoist-pattern flag. This flag is required for bud to work correctly.

Try installing with pnpm install --public-hoist-pattern="*"

Despite what the docs say you should not need the .pnpmfile.cjs compatibility shim.