Flagship Code Configuration
The primary objective of flagship-code.config.ts is to provide developers with the freedom to scaffold their configurations according to their preferences. We refrain from making assumptions regarding how developers wish to structure their apps, aiming instead to empower them with flexibility in configuration setup…
…except for the location of the flagship-code.config.ts 😉.
Configure the flagship-code.config.ts
Section titled “Configure the flagship-code.config.ts”Create the flagship-code.config.ts in the root of your project directory.
touch flagship-code.config.tsHere is an illustrative representation of the configuration structure, including sample paths and plugins for contextual understanding. Please feel free to adjust the paths and plugins according to your project’s requirements.
import { defineConfig } from "@brandingbrand/code-cli-kit";
export default defineConfig({ buildPath: "./coderc/build", envPath: "./coderc/env", pluginPath: "./coderc/plugins", preset: "@brandingbrand/code-preset-react-native", plugins: [ "@brandingbrand/code-plugin-native-navigation", "@brandingbrand/code-plugin-splash-screen", "@brandingbrand/code-plugin-app-icon", ],});Configuration Options
Section titled “Configuration Options”You can pass the following options to the flagship-code configuration.
buildPath
Section titled “buildPath”type: string
required
The relative path from the root of your project to the location to where your build configurations are defined.
envPath
Section titled “envPath”type: string
required
The relative path from the root of your project to the location where your environment configurations are defined.
pluginPath
Section titled “pluginPath”type: string
required
The relative path from the root of your project to the location where your local plugin packages are defined.
preset
Section titled “preset”type: string
required
The package name of the preset that Flagship Code will utilize - this corresponds to the package name listed under devDependencies in your package.json.
It is highly recommended to use the @brandingbrand/code-preset-react-native preset for React Native applications, as it provides a comprehensive set of default configurations and plugins tailored for React Native development.
plugins
Section titled “plugins”type: string
required
A prioritized list of the plugins that Flagship Code will invoke - these correspond to the package names listed under devDependencies in your package.json.