Main Options #
These are the main Vituum options that can be used. If you want to add vite options, do so inside the vite
option - any option here overrides Vituum options.
input #
- Type:
string[]
- Default:
['./src/views/**/*.html', './src/emails/*.html', './src/styles/*.{css,pcss,scss,sass,less,styl,stylus}', './src/scripts/*.{js,ts,mjs}']
Project files for build synced with FastGlob
that are included in Vite as build.rollupOptions.input
output #
- Type:
string[]
- Default:
resolve(process.cwd(), 'public')
Specify the output directory for build
root #
- Type:
string
- Default:
resolve(process.cwd(), 'src')
Project root directory (where source files are located). Can be an absolute path, or a path relative to the current working directory.
See Vite Project Root for more details.
plugins #
- Type:
(Plugin | Plugin[] | Promise<Plugin | Plugin[]>)[]
Array of plugins to use. Falsy plugins are ignored and arrays of plugins are flattened. If a promise is returned, it would be resolved before running. See Vite Plugin API for more details on Vite plugins.
postcss #
- Type:
string | (postcss.ProcessOptions & { plugins?: postcss.AcceptedPlugin[] })
Inline PostCSS config or a custom directory to search PostCSS config from (default is project root).
Extends the default PostCSS plugins already included in Vituum. If you want to use your own then use vite.css.postcss
option.
build.log #
- Type:
boolean
- Default:
false
Whenever to show detailed log in vituum build
command
build.mode #
- Type:
string
- Default:
null || p
rocess.env.VITUUM_BUILD_MODE
Build mode to use, possible options are:
headless
- to build all files, but without.html
server.open #
- Type:
boolean | string
Automatically open the app in the browser on server start. See Vite server.open for more details.
server.https #
- Type:
boolean
- Default:
false
Whenever to use https, if you set true
and you have cert file located in ~/.ssh
directory with the name localhost-key.pem
and localhost.pem
then https works out of the box.
You can use mkcert to easily generate a valid local certificate file.
server.cert #
- Type:
string
- Default:
localhost
Certificate filename to use with server.https
server.reload #
- Type:
function
- Default:
null
You can add a custom filename filter to perform a full page refresh while you are running vite dev
on any file you filter in the function
imports.paths #
- Type:
string[]
- Default:
['./src/styles/**', './src/scripts/**']
Paths where auto-imports should be resolved.
imports.extnamePattern.styles #
- Type:
RegExp
- Default:
/.(css|less|scss|pcss)$/
Types of files that should be resolved as styles
imports.extnamePattern.scripts #
- Type:
RegExp
- Default:
/.(js|mjs|ts)$/
Types of files that should be resolved as scripts
imports.filenamePattern #
- Type:
object
- Default:
{'+.css': 'src/styles', '+.js': 'src/scripts'}
Filename for file with imports and the paths where it should be processed. Path can be also array of paths.
middleware.viewsDir #
- Type:
string
- Default:
views
Directory where your .html
or template engine page files are located. Requests are auto-redirected in this directory.
middleware.viewsIgnored #
- Type:
string[]
- Default:
['emails']
Use this option if you want to access .html
or template engine page files also in different directory relative to root
that is outside the views
directory.
templates.format #
- Type:
string
- Default:
null
Specify template engine name if you want to use .json
files as pages for the template engines. Supported template engines are listed in templates.formats
templates.formats #
- Type:
string[]
- Default:
['json', 'latte', 'twig', 'liquid', 'njk', 'hbs', 'pug']
Supported template engines that will be resolved in middleware with dev server or in build.