Skip to main content

bud.template

Configure your app's html wrapper

Usage

This method can be called without passing any options.

bud.config.js
bud.template()

The default template will source a couple variables from .env, you'll probably want to make sure they are set.

.env
PUBLIC_APP_TITLE='My App'
PUBLIC_APP_DESCRIPTION='My App Description'

Using a custom template

bud.config.js
bud.template({
template: 'index.html',
})

Defining template vars

Add template variables using replace.

bud.config.js
bud.template({
replace: {
APP_NAME: name,
APP_DESCRIPTION: description,
PUBLIC_URL: '/app/theme',
},
})

You may use any of these variables in the template by surrounding the variable name with % characters.

public/index.html
<html>
<title>%APP_NAME%</title>
</html>