A library for generating native app code from JavaScript config through Expo config plugins
A helper that applies a list of config plugins (module strings or inline definitions) with run-once protection and a record of which plugins ran.
{ name: "MyApp" } and plugins [module plugin at "./plugins/append.js" that appends "-native" to the name, inline plugin named "inline" that appends "-inline"], the pipeline resolves the module relative to projectRoot, runs the module then the inline plugin, and returns appliedPlugins as ["./plugins/append.js", "inline"] plus final name MyApp-native-inline. @testonceKey, running the pipeline twice with the same onceKey triggers that default plugin only on the first call while still applying other plugins on every call. @testprojectRoot, the pipeline rejects with an error that names the missing plugin entry. @test@generates
export type PluginEntry =
| string
| {
name: string;
apply(
config: Record<string, any>
): Record<string, any> | Promise<Record<string, any>>;
};
export interface PipelineOptions {
projectRoot: string;
onceKey: string;
}
export interface PipelineResult {
config: Record<string, any>;
appliedPlugins: string[];
}
export async function applyPluginPipeline(
baseConfig: Record<string, any>,
plugins: PluginEntry[],
options: PipelineOptions
): Promise<PipelineResult>;Utilities for orchestrating config plugins, resolving plugin modules, and preventing duplicate execution. @satisfied-by
tessl i tessl/npm-expo--config-plugins@11.0.0docs
evals
scenario-1
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9
scenario-10