Configuration Reference
Coralite is configured using a coralite.config.js file in the root of your project. This file exports a configuration object that defines input paths, output directories, plugins, and build options.
If you prefer TypeScript or type hinting, you can use the defineConfig helper from coralite-scripts.
// coralite.config.js
import { defineConfig } from 'coralite-scripts';
import myPlugin from './plugins/my-plugin.js';
export default defineConfig({
components: 'src/components',
pages: 'src/pages',
output: 'dist',
plugins: [myPlugin]
});
Configuration Options #
The CoraliteConfig object accepts the following properties:
| Property | Type | Default | Description |
|---|---|---|---|
components |
string |
"src/components" (via CLI) |
The path to the directory containing Coralite templates. |
pages |
string |
"src/pages" (via CLI) |
The path to the directory containing pages that will be rendered using the provided templates. |
output |
string |
"dist" (via CLI) |
The base directory path where generated HTML files will be saved. |
plugins |
Array<CoralitePluginInstance> |
[] |
An array of plugin instances to extend Coralite's functionality (e.g., loaded via createPlugin). |
standaloneOutput |
string (optional) |
"components" (relative to output) |
The directory path (relative to output) where compiled standalone client-side web components will be placed. |
ignoreByAttribute |
Array<{name: string, value: string} | string> (optional) |
[] |
An array of attribute names and values used to filter out elements during processing. |
skipRenderByAttribute |
Array<{name: string, value: string} | string> (optional) |
[] |
An array of attribute names and values used to skip rendering of specific elements during processing. |
Environment Considerations #
When running Coralite using the coralite-scripts development mode (e.g., npm run dev or mode === 'dev'), the output directory is automatically overridden to a temporary .coralite/build folder to isolate build artifacts from production outputs. This directory is automatically cleaned up on server startup and graceful exit.