Configuration

YASSB can be run as it is, or it can be fine tuned to your needs.

YASSB configuration is based on config. Below are described the specific configuration options of YASSB. To learn more about config and the many options it supports see config's npm page.

Available options

To edit available options, first create a new config folder in your root project folder.

Inside config create a new default.js file. This file should export one object of type YassbConfig.

Available options that can be set as properties of the YassbConfig object are available as a valueof the enum OptionsKeys.

The available options are the following:

Option Value Default Description
username [string] undefined value to replace the wildcard USERNAME to anonymise values passed to directives
customRenderers [RenderersStore] [] used to pass to YASSB your custom renderers;
customDirectives [CustomDirectivesStore] [] used to pass to YASSB your custom directives;
workingDir [Partial<typeof WORKING_DIR>] see Project structure object to customize the folder names used by the project
skipsStyles [boolean] false whether YASSB should skip parsing styles.
stylesParser [CustomStylesParser] undefined see custom-styles-parsers
postProcessors [Array<(fileContents: string) => string>] [] see post processors
htmlMinificationOptions [MinifyOptions] {} see available options at html-minifier
showdownConverterOptions [ConverterOptions] {tables: true} see available options at showdown
grayMatterOption [GrayMatterOption<string, unknown>] {} see available options at gray-matter
webpackConfig [Configuration] see the default configuration see the configuration options at WebPack.js.org
siteHost [string] undefined Base URL of the website to enable the sitemap.
devServerPort [number] undefined The port on which to open the dev server launched in watch mode.

Example:

module.exports {
  username: 'alex',
  workingDir: {
    src: 'landing',
    out: 'public'
  }
}

TypeScript support

Alternatively, you can provide the configuration file in TypeScript.

To do so, rename the config file to default.ts. In this case please note that typescript must be a dependency of your project.

In this case defaul.ts should look like this:

export default {
  username: ...
  ...
};