Skip to content

Furnace

Furnace provides the developer with an easy way to build assets for the frontend, by passing them through esbuild, a high-performance asset builder written Go. It supports many different content types, including, but not limited to, JavaScript, TypeScript, CSS, JSX and more. It also has a well-developed plugin ecosystem, allowing for even more functionality.

Out of the box, the Furnace installer allows you to pick some extra plugins to install, including:

Installation

Furnace can be installed via Composer:

Terminal window
composer require brickhouse/furnace

After which, you can install it to setup the default configuration:

Terminal window
php brickhouse install:furnace

This command will prompt for multiple selections, such as which plugins to include, whether to use TypeScript, etc. After finished, Furnace will have created some initial assets, configuration file(s) and other elements to create a seamless development experience.

By default, Furnace will have created an esbuild build script in assets/build.mjs. This file defines how esbuild should build you assets, where they should be stored after building, and so on.

Lastly, you can build all the assets in your project:

Terminal window
php brickhouse build

Third-party plugins

Since Furnace is based on esbuild, all plugins will work as they would with esbuild. Esbuild has it’s own index of plugins at esbuild/community-plugins.

To install an esbuild plugin:

  1. Install the package via your package manager:

    Terminal window
    npm install --save-dev [PLUGIN-NAME]
  2. Import the plugin and add it to your build script:

    assets/build.mjs
    import * as esbuild from 'esbuild'
    import pluginName from "PLUGIN-NAME"
    await esbuild.build({
    // ...
    plugins: [
    // ...
    pluginName({
    // plugins options...
    })
    ]
    });