diff --git a/packages/cli/src/tools/config/index.js b/packages/cli/src/tools/config/index.js index f265a2a41..0ba40ecec 100644 --- a/packages/cli/src/tools/config/index.js +++ b/packages/cli/src/tools/config/index.js @@ -124,7 +124,7 @@ function loadConfig(projectRoot: string = process.cwd()): ConfigT { get assets() { return findAssets(projectRoot, userConfig.assets); }, - platforms: {}, + platforms: userConfig.platforms, haste: { providesModuleNodeModules: [], platforms: [], diff --git a/packages/cli/src/tools/config/schema.js b/packages/cli/src/tools/config/schema.js index a46f03776..cd2870afe 100644 --- a/packages/cli/src/tools/config/schema.js +++ b/packages/cli/src/tools/config/schema.js @@ -85,12 +85,13 @@ export const dependencyConfig = t projectConfig: t.func(), linkConfig: t.func(), }), - ).default(), + ).default({}), commands: t .array() .items(command) .default([]), }) + .unknown(true) .default(); /** @@ -170,5 +171,14 @@ export const projectConfig = t .array() .items(command) .default([]), + platforms: map( + t.string(), + t.object({ + dependencyConfig: t.func(), + projectConfig: t.func(), + linkConfig: t.func(), + }), + ).default({}), }) + .unknown(true) .default(); diff --git a/types/index.js b/types/index.js index feef6bcd2..67178942f 100644 --- a/types/index.js +++ b/types/index.js @@ -195,10 +195,10 @@ export type UserDependencyConfigT = { */ export type UserConfigT = { /** - * Shares some structure with ConfigT, except that haste, root, platforms + * Shares some structure with ConfigT, except that haste and root * are calculated and can't be defined */ - ...$Diff, + ...$Diff, reactNativePath: ?string, // Additional project settings