6.14.0
Top-level await, lazy compilation of async modules, CLI improvements, performance enhancements, and more.
There are patches available for this release. Please update to 6.14.3.
🚨 Potentially breaking changes
- deprecated:
@roots/merged-manifest-webpack-plugin
- deprecated:
@roots/bud-wordpress-manifests
bud.console
: removed. old methods consolidated withbud.dashboard
.bud.context.files
: interface has changed. Themodule
property for each value inbud.context.files
is now an async function that returns the module. This is an undocumented internal, but some people might be using it.
Key changes
- ✨ feature: top level await (enabled for ESM projects only)
- ✨ feature: creates aliases from
imports
field of package.json - ✨ feature: dynamic modules now compiled lazily in development
- 🏎️ performance: multi-config builds are now built in parallel
- ✨ improve: config files now lazy loaded
- ✨ improve(
@roots/wordpress-theme-json-webpack-plugin
):theme.json
included in compilation module graph - ✨ improve(
@roots/bud-tailwindcss-theme-json
): Edits totailwind.config.js
now result in rebuild oftheme.json
- ✨ improve(
@roots/entrypoints-webpack-plugin
):entrypoints.json
included in compilation module graph - ✨ improve(
@roots/bud-dashboard
): improved UI - ✨ add flag:
--entrypoints.html
(same as callingbud.entrypoints.set('emitHtml', true)
; emits partials containing<script>
and<style>
tags) - ✨ add flag:
--dashboard
(use dashboard stats vs. simple stats output) - ✨ add flag:
--dashboard.assets
(show/hide presentation of assets) - ✨ add flag:
--dashboard.compact
(truncated build summary) - ✨ add flag:
--dashboard.entrypoints
(show/hide presentation of entrypoints) - ✨ add flag:
--dashboard.server
(show/hide server info) - ✨ feature: for multi-compiler builds
1
-9
will show stats isolated by compiler.0
shows all compilers. - ✨ feature:
d
when viewing the dashboard will show detailed debug stats - ✨ feature:
c
when viewing the dashboard will present output with compact formatting - 🩹 fix: issues with bud.js cli error output
- 🩹 fix: issues with bud.js internal module resolution cache
- 📦 pkg(
@roots/wordpress-transforms
): small utility for translating@wordpress/*
signifiers towp-*
enqueue handles andwp.*
window references - 🗂️ typings(
@roots/bud-framework
): flatten organization of typings
Additional Notes
bud.js module resolution cache is now self-healing
The bud.js module resolution cache is now self-healing. If a build dependency was previously available at some path but is now unresolvable its entry will be updated while still preserving the rest of the cache. There should now be limited reason to use --force
to manually flush the cache; it will probably only serve to make your next build slower.
--no-clean
will be a future default
You can get a surprising performance boost by using the --no-clean
flag (some test projects are >15% faster). Why delete and rewrite modules which have not been modified? This will be default in the next major release of bud.js.
You might not want to make a vendor chunk
If you are doing a lot of code splitting with imports, try disabling chunking and see if it improves initial page load (bud.splitChunks(false)
or --no-splitChunks
). The extra runtime code might not be worth it if you are already importing modules conditionally.
--ci
will soon mean more than "run this without fanciness"
If you are using --ci
solely to not display stats consider switching to --no-dashboard
. There may be changes in the future to the behavior of this flag which are focused on CI environments specifically.
bud.js instance is now importable
The bud.js instance is now available as a named import from @roots/bud (import {bud} from '@roots/bud'
). This allows for a bunch of stuff you couldn't do before. Like, as an example, configuring bud.js without an exported callback:
import {bud} from '@roots/bud'
bud.entry('app', ['app.js', 'app.css'])
You can also import the instance into other config modules or custom scripts. Not all tools will play nicely. Tailwindcss, for example, will try to bundle bud.js along with your tailwind config using jiti. It won't succeed (jiti can't handle import.meta).
Full Changelog
- 🩹 fix: bud upgrade by @kellymears in https://github.com/roots/bud/pull/2323
- ✨ improve: bud error handling by @kellymears in https://github.com/roots/bud/pull/2326
- ✨ improve: error handling by @kellymears in https://github.com/roots/bud/pull/2327
- ✨ improve: dashboard by @kellymears in https://github.com/roots/bud/pull/2329
- 📦 deps(deps): bump @types/eslint from 8.40.1 to 8.40.2 by @dependabot in https://github.com/roots/bud/pull/2318
- 📦 deps(deps): bump @swc/plugin-emotion from 2.5.51 to 2.5.68 by @dependabot in https://github.com/roots/bud/pull/2320
- 📦 deps(deps): bump @swc/core from 1.3.42 to 1.3.66 by @dependabot in https://github.com/roots/bud/pull/2333
- 📦 deps(deps): bump semver from 7.5.1 to 7.5.3 by @dependabot in https://github.com/roots/bud/pull/2337
- 📦 deps(deps-dev): bump @aws-sdk/client-s3 from 3.348.0 to 3.357.0 by @dependabot in https://github.com/roots/bud/pull/2334
- ✨ improve: config module handling by @kellymears in https://github.com/roots/bud/pull/2336
- 📦 deps: upgrade packages by @kellymears in https://github.com/roots/bud/pull/2342
- 🧹 cleanup: streamline lifecycle/cli init by @kellymears in https://github.com/roots/bud/pull/2347
- 🧪 test: cli flags by @kellymears in https://github.com/roots/bud/pull/2348
- 📕 docs: update readme by @kellymears in https://github.com/roots/bud/pull/2354
- 🩹 fix: config.after by @kellymears in https://github.com/roots/bud/pull/2359
- 🧪 test: improve integration by @kellymears in https://github.com/roots/bud/pull/2361
- 🗂️ typings: @roots/bud/instance by @kellymears in https://github.com/roots/bud/pull/2360