Assets
config/assets.php
The assets configuration file contains all settings related to the theme assets.
The default config enqueues the site.js file on every page.
This file is located in the assets/src/js directory.
For more advanced topics checkout Advanced/Vite.
Adding a new entry
Section titled “Adding a new entry”Entrypoints are defined in config/entrypoints.json — this is the single source of truth shared with vite.config.ts. Adding an entry here is all that’s needed for Vite to pick it up.
{ "lumbermill": "assets/src/js/site.js", "my-custom-js": "assets/src/js/my-custom.js"}To add WordPress-specific options for an entry (such as dependencies or admin-only loading), add it to the entrypoints array in config/assets.php. Entries without any options do not need an entry here.
<?php
return [ 'vite' => [ 'entrypoints' => [ 'my-custom-js' => [ 'dependencies' => ['jquery'], ], ], ],]Helpers
Section titled “Helpers”Some libraries need extra scripts to work properly, for example React.
To make it easier to add these scripts, you can use the helpers array.
<?php
return [ 'vite' => [ 'entrypoints' => [], 'helpers' => [ 'react' ], ],]Available helpers
Section titled “Available helpers”- react
Entrypoint options
Section titled “Entrypoint options”All options that can be used in the entrypoints array in config/assets.php.
| Option | Type | Description | Default |
|---|---|---|---|
| dependencies | array | The dependencies of the entry. | [] |
| is_admin | boolean | Enqueue only in the WordPress admin area. | false |
| template | string | Enqueue only on pages using this page template. | null |
Admin entrypoints
Section titled “Admin entrypoints”To enqueue an entry only in the WordPress admin area, set is_admin to true.
<?php
return [ 'vite' => [ 'entrypoints' => [ 'my-admin-js' => [ 'is_admin' => true, ], ], ],]Template entrypoints
Section titled “Template entrypoints”To enqueue an entry only on pages that use a specific page template, set template to the template path relative to the theme root. The entry is checked with is_page_template(), so it only applies to posts/pages with that template selected, not to archives or other routes.
<?php
return [ 'vite' => [ 'entrypoints' => [ 'my-agenda-js' => [ 'template' => 'templates/agenda.php', ], ], ],]template is ignored when is_admin is true.
assets
Section titled “assets”These settings allow you to add extra assets to the theme, without using Vite.
Note: These assets will not be processed by Vite, so minification/optimisations will not be applied.
Check out the example below to see how to add assets.
<?php
return [ 'assets' => [ 'css' => [ 'my-custom-style' => [ 'path' => 'assets/src/scss/vendor/my-custom-style.css', ], ], 'js' => [ 'my-custom-script' => [ 'path' => 'assets/src/js/vendor/my-custom-script.js', ], ], ],];All options
Section titled “All options”All options that can be used in the css and js arrays.
| CSS | JS | Option | Type | Description | Required | Default |
|---|---|---|---|---|---|---|
| x | x | path | string | The relative file location based on the theme root. | Y | null |
| x | x | dependencies | array | The dependencies of the asset. | N | [] |
| x | x | version | string | The version of the asset. | N | null |
| - | x | in_footer | boolean | Whether or not to enqueue the asset in the footer. | N | false |
| - | x | is_admin | boolean | Enqueue only in the WordPress admin area. | N | false |
| - | x | strategy | string | Loading strategy: async or defer. | N | null |
| x | - | media | string | The media type of the asset. | N | all |
strategy
Section titled “strategy”Adds an async or defer attribute to the script tag. Omit it for a blocking script.
'js' => [ 'instant-pages' => [ 'path' => 'assets/dist/vendor/instant-page.js', 'in_footer' => true, 'strategy' => 'async', ],],WordPress only applies the attribute when the dependency graph allows it — a script with dependencies that are not themselves deferred, or one that other scripts depend on, silently falls back to blocking. Self-contained scripts are the safe candidates.
update_scripts
Section titled “update_scripts”Is basically the same as the assets array, but is used for updating WordPress scripts.
optimisations
Section titled “optimisations”These settings allow you to enable/disable certain optimisations.
The boilerplate comes with the following optimisations enabled:
- Remove emoji styles

