Configuration
The following section is an overview of basic configuration for Weblands.
Most of the options discussed are specific to Weblands, for the rest of the available configuration options please check Vite’s config reference.
Configuring Vite
You can provide a vite
option in weblands.config.ts
with the same options.
Configuring Weblands
You may provide an weblands.config.ts
configuration file to customize settings
related to weblands-specific features.
You can leverage your IDE’s intellisense with jsdoc type hints or use the defineConfig
helper:
ssg.sitemap
- Type:
boolean
- Default:
true
concurrency
- Type:
number
- Default: 1
Max pages rendering in parallel
criticalCss
- Type:
CrittersOptions
- Default:
Critical css inlining options (https://www.npmjs.com/package/critters)
purgeCss
- Type:
CrittersOptions
- Default:
Allow to generate page specific CSS after for each page after it will be rendered
Options passed to https://www.npmjs.com/package/purgecss.
siteUrl
- Type:
string
URL for the site in production, used to generate absolute URLs for the sitemap.
sitemapIgnore
- Type:
string[]
- Default:
['/404']
Array of routes to exclude from sitemap.
capojs
- Type:
boolean
- Default:
false
Sort head elements with capojs
Configure Your App
Weblands will pre-configure a Vue 3 app that will load any [pages] defined in the site.
You may provide additional configuration in src/app.ts
, and leverage
intellisense by using the defineApp
helper.
head
- Type:
HeadObject | (context: AppContext) => HeadObject
Set the page title, meta tags, additional CSS, or scripts using @vueuse/head
.
enhanceApp
- Type:
(context: AppContext) => Promise<void>
A hook where you can add plugins to the Vue app, or do anything else prior to the app being mounted.
router
- Type:
RouterOptions
Configure vue-router
by providing options such as scrollBehavior
and linkActiveClass
.
routesToPrerender
- Type:
string[]
- Default:
[]
Pass an callback that will generate dynamic routes to pre-render and returns an array of them