A friendly build tool to help manage your project assets.
- Installation
- Getting started
- Running a build
- Example implementations
- Extending
- Documentation and details
- Contributing
- Bud sponsors
- Community
Install @roots/bud and @roots/bud-cli to your project
yarn add @roots/bud @roots/bud-cli --dev
Bud can either be configured with a static config file (json
/yml
) or a builder module (js
/ts
).
Dead simple example
/**
* bud.config.js
*/
module.exports = (bud) => bud.entry("app", ["app.js"]);
Or, as yml
# bud.config.yml
entry:
app: "app.js"
A more advanced configuration might look like
/**
* bud.config.ts
*/
import { Framework } from "@roots/bud";
export default (bud: Framework) =>
bud
.use([
require("@roots/bud-babel"),
require("@roots/bud-postcss"),
require("@roots/bud-react"),
])
.library(["react", "react-dom"])
.entry({ app: ["app.{js,css}"] })
.when(
bud.isProduction,
({ minimize }) => minimize(),
({ devtool }) => devtool("eval-source-map")
);
Which could also be expressed in a set of yml
files
# bud.config.yml
extensions:
- "@roots/bud-babel"
- "@roots/bud-postcss"
- "@roots/bud-react"
library:
- "react"
- "react-dom"
entry:
app: "app.{js,css}"
# bud.production.config.yml
minimize: true
# bud.development.config.yml
devtool: "eval-source-map"
For more on configuring @roots/bud check out the dedicated documentation.
Once you've set up your configuration file the following command will run the build:
yarn bud build
You should see your built assets in the dist
directory of your project.
yarn bud build:production
yarn bud build:development
There are example implementations available.
Bud provides an intentionally sparse set of out-of-the-box features.
In fact, much of the core of Bud is actually made up of extensions. This is to make it easy for devs to swap out parts of the framework as needed.
That said, you will likely want to utilize extensions in your project.
If you're unsure where to start or what you need you can try the @roots/bud-preset-recommend preset. Most require zero configuration.
There are a number of Roots maintained extensions available to kickstart your project
Have you produced a Bud extension and want to share it here? Please, create an issue sharing information about your project.
Contributions are welcome from everyone.
We have contributing guidelines to help you get started.
Help support our open-source development efforts by becoming a patron.
Keep track of development and community news.
- Participate on the Roots Discourse
- Follow @rootswp on Twitter
- Read and subscribe to the Roots Blog
- Subscribe to the Roots Newsletter
- Listen to the Roots Radio podcast