The project configuration lives in a file named uiengine.config.js.
Defaults to name and version from your package.json file.
Here you can overwrite it and add more custom properties.
{
name: 'ACME Design System',
version: '1.0.0'
}Optionally you can provide an analyticsId (from Google Analytics UA-XXX-X) to track the site.
The base directories for the input, your raw source files:
componentsis the root of the directory containing the componentstemplatescontains the variant preview and application templatespagesis the directory of the UIengine's site structure and page markdown filesdatacontains sample data that can be referenced in variants and pagesentitiescontains the optional entity definitions for the components
{
source: {
components: './src/components',
templates: './src/templates',
pages: './src/uiengine/pages',
data: './src/uiengine/data',
entities: './src/uiengine/entities'
}
}Destination paths for the generated output.
{
target: './dist'
}Adapters are used for templating/rendering. You configure the adapters using the file extension of the template file as the adapter key. Each adapter is a module that gets required, for details see the adapters documentation.
There are two slightly different ways to configure the value: The first way is to directly reference the module or path that will get required:
{
adapters: {
pug: '@uiengine/adapter-pug',
hbs: '@uiengine/adapter-handlebars',
jsx: '@uiengine/adapter-react'
}
}In case you need to provide additional options that will be passed to the adapter, you need to explicitely reference the module and its options:
{
adapters: {
pug: {
module: '@uiengine/adapter-pug',
options: {
pretty: true,
basedir: './src/components'
}
},
hbs: {
module: '@uiengine/adapter-handlebars',
options: {
namespace: 'my-project'
}
}
}
}In either way the adapter module can be …
- the path to a directory inside this project that contains the adapter (case: you use the adapter just for this project)
- the name of the npm package that is the adapter (case: you use an existing adapter or want to share yours across projects)
This is the template the previews gets rendered into. It should contain references to your styles and scripts, so that the rendered markup has the asset context it needs.
{
template: 'uiengine.html'
}It must also include the <!-- uiengine:content --> comment, which will be replaced with the rendered markup.
See the UI docs for details.
The uiengine build command (see the getting started guide supports modes for serving and watching files.
Here you can pass in the corresponding BrowserSync configuration:
{
// either directly
browserSync: {
open: false
},
// or by referencing an external file:
browserSync: require('./bs-config.js')
}