Skip to content

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.

The CLI searches for config files with the following names:

  1. launchpad.config.js
  2. launchpad.config.mjs
  3. launchpad.config.ts
  4. launchpad.config.cjs
  5. launchpad.config.mts
  6. launchpad.config.cts

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

js
import { defineConfig } from '@bluecadet/launchpad/cli';

export default defineConfig({
  plugins: [
    // Your plugin configurations here
  ]
});

Configuration Structure

Your config file can include settings for any of Launchpad's main modules:

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 { content } from '@bluecadet/launchpad/content';
import { monitor } from '@bluecadet/launchpad/monitor';
import { jsonSource } from '@bluecadet/launchpad/content/sources/json';

export default defineConfig({
  plugins: [
    content({
      sources: [
        jsonSource({
          id: "api-data",
          files: {
            "data.json": process.env.API_ENDPOINT
          }
        })
      ],
      downloadPath: "./content"
    }),
    monitor({
      apps: [
        {
          pm2: {
            name: "exhibit-app",
            script: "./app.exe"
          }
        }
      ]
    })
  ],
});

Released under the ISC License.