JSPM

@roots/bud

4.0.1
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 6119
  • Score
    100M100P100Q138111F
  • License MIT

A friendly build tool to help manage your project assets.

Package Exports

  • @roots/bud

Readme

Bud

MIT License Follow Roots

@roots/bud

A friendly build tool to help manage your project assets.

Installation

Install @roots/bud and @roots/bud-cli to your project

yarn add @roots/bud @roots/bud-cli --dev

Getting started

Bud can either be configured with a static config file (json/yml) or a builder module (js/ts).

Dead simple bud.config.js example

module.exports = (bud) => bud.entry("app", ["app.js"]);

Or, as bud.config.yml

entry:
  app: "app.js"

A more advanced configuration might look like

import { Bud } from "@roots/bud";

export default (bud: Bud) =>
  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.

Running a build

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 urlectory of your project.

Running in production mode

yarn bud build:production

Running in development mode

yarn bud build:development

Example implementations

There are example implementations available.

Extending

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.

First-party extensions

There are a number of Roots maintained extensions available to kickstart your project

Name Project home Extension docs Latest
@roots/bud-babel @babel/babel 📚 README npm
@roots/bud-compress @webpack-contrib/compression-webpack-plugin 📚 README npm
@roots/bud-criticalcss @addyosmani/critical 📚 README npm
@roots/bud-emotion @emotion/emotion-css 📚 README npm
@roots/bud-entrypoints @roots/entrypoints-webpack-plugin 📚 README npm
@roots/bud-esbuild @roots/esbuild-loader 📚 README npm
@roots/bud-eslint @webpack-contrib/eslint-webpack-plugin 📚 README npm
@roots/bud-imagemin @webpack-contrib/image-minimizer-webpack-plugin 📚 README npm
@roots/bud-library @asfktz/autodll-webpack-plugin 📚 README npm
@roots/bud-mdx @mdx-js/mdx 📚 README npm
@roots/bud-postcss @postcss/postcss 📚 README npm
@roots/bud-prettier @prettier/prettier 📚 README npm
@roots/bud-purgecss @FullHuman/purgecss 📚 README npm
@roots/bud-react @facebook/react 📚 README npm
@roots/bud-sass @sass/sass 📚 README npm
@roots/bud-stylelint @stylelint/stylelint 📚 README npm
@roots/bud-tailwindcss @tailwindlabs/tailwindcss 📚 README npm
@roots/bud-terser @terser/terser 📚 README npm
@roots/bud-typescript @TypeStrong/ts-loader 📚 README npm
@roots/bud-vue @vue/vue 📚 README npm
@roots/bud-wordpress-dependencies @roots/wordpress-dependencies-webpack-plugin 📚 README npm
@roots/bud-wordpress-externals @roots/wordpress-externals-webpack-plugin 📚 README npm
@roots/bud-wordpress-manifests @roots/merged-manifest-webpack-plugin 📚 README npm

Third-party extensions

Have you produced a Bud extension and want to share it here? Please, create an issue sharing information about your project.

Documentation and details

Contributing

Contributions are welcome from everyone.

We have contributing guidelines to help you get started.

Bud sponsors

Help support our open-source development efforts by becoming a patron.

Kinsta KM Digital Carrot C21 Redwood Realty WordPress.com Icons8 Harness Software Coders Clan Genero Motto

Community

Keep track of development and community news.