Config Loading ​
The Launchpad CLI uses a flexible configuration system that automatically searches for and loads your project configuration. The CLI supports Javascript config files.
Config File Search ​
The CLI searches for config files in the following order:
launchpad.config.js
launchpad.config.mjs
The search starts in the current working directory and recursively searches up parent directories (up to 64 levels) until a config file is found.
Config File Format ​
JavaScript/TypeScript Config (Recommended) ​
js
import { defineConfig } from '@bluecadet/launchpad-cli';
export default defineConfig({
content: {
// Content management configuration
},
monitor: {
// Process monitoring configuration
},
});
Configuration Structure ​
Your config file can include settings for any of Launchpad's main modules:
content
- Content management settings (Content Config Reference)monitor
- Process monitoring settings (Monitor Config Reference)
Environment Variables ​
Config files can reference environment variables using the process.env
object in JavaScript configs. For managing environment variables, see the Environment Variables documentation.
Type Safety ​
When using TypeScript or an editor with TypeScript support (like VS Code), the defineConfig
helper provides:
- Full IntelliSense for all configuration options
- Type checking for configuration values
- Auto-completion suggestions
- Documentation hints
Example ​
js
import { defineConfig } from '@bluecadet/launchpad-cli';
import { jsonSource } from '@bluecadet/launchpad-content';
export default defineConfig({
content: {
sources: [
jsonSource({
id: "api-data",
files: {
"data.json": process.env.API_ENDPOINT
}
})
],
downloadPath: "./content"
},
monitor: {
apps: [
{
pm2: {
name: "exhibit-app",
script: "./app.exe"
}
}
]
}
});