Bud v6.9.0 released

bud v6.9.0 released

An easy helper for dealing with uncompiled modules, dot notation getters and setters for extension options, and a bugfix for the typescript+vue support introduced in 6.8.0

:adhesive_bandage: fix: vue/typescript #2082

Moves css, scss,ts rules out of oneOf and into the top-level module.rules array.

Fixes:

:sparkles: feature(@roots/bud): bud.compilePaths #2083

bud.compilePaths is used to specify directories which should be treated as source directories. This serves as a simple replacement for the instructions found in the compiler sources guide.

If you have errors which say something along the lines of You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file., this is probably the function you want to use to fix that.

Example adding support for the swiper lib:

export default async bud => {
  bud.compilePaths([
    bud.path(`@src`),
    bud.path(`@modules/swiper`),
  ])
}

:sparkles: improve(@roots/bud): options api #2078

A small change but a good one. Backwards compatible but it will let us remove a lot of extension methods in bud@7.0.

export default async bud => {
    bud.wpjson
      .set(`settings.color.customDuotone`, false)
      .set(`settings.color.customGradient`, false)
      .set(`settings.color.defaultDuotone`, false)
      .set(`settings.color.defaultGradients`, false)
      .set(`settings.color.defaultPalette`, false)
      .set(`settings.color.duotone`, [])
      .enable()

    bud.tailwind.set(`generateImports`, true)

    bud.typescript
      .set(`appendTsSuffixTo`, [/\.vue$/])
      .typecheck.enable()

    bud.terser
      .set(`extractComments`, false)
      .set(`terserOptions.mangle.safari10`, false)

    bud.vue.set(`runtimeOnly`, false)

    bud.imagemin.sharp
      .set(`encodeOptions.png.quality`, 60)
      .set(`encodeOptions.webp.quality`, 60)
}

Can also retrieve options with get:

bud.vue.get(`runtimeOnly`)

Right now these dot props are not type safe and you may get feedback in your IDE that the option name doesn’t exist. More work is roadmapped to address this, but it’s very complicated to do dot notation type transformations on generics with recursive or very deeply nested properties.

If this is a problem for you you can do the prop drilling yourself with extension.getOptions() and extension.setOptions().

1 Like