From ce29990ce62ac32eb6c305c3421b9105fdc61b41 Mon Sep 17 00:00:00 2001 From: Jared Henderson Date: Mon, 7 Feb 2022 09:15:43 -0500 Subject: [PATCH] prevent warnings about missing content prop in tw config --- src/create.ts | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/create.ts b/src/create.ts index 636c341..b52a3f2 100644 --- a/src/create.ts +++ b/src/create.ts @@ -19,7 +19,7 @@ import { getAddedUtilities } from './plugin'; import { removeOpacityHelpers } from './resolve/color'; export function create(customConfig: TwConfig, platform: Platform): TailwindFn { - const config = resolveConfig(customConfig as any) as TwConfig; + const config = resolveConfig(withContent(customConfig) as any) as TwConfig; const device: DeviceContext = {}; const pluginUtils = getAddedUtilities(config.plugins); @@ -207,3 +207,13 @@ export function create(customConfig: TwConfig, platform: Platform): TailwindFn { } export default create; + +function withContent(config: TwConfig): TwConfig & { content: string[] } { + return { + ...config, + // prevent warnings from tailwind about not having a `content` prop + // we don't need one because we have our own jit parser which + // does not rely on knowing content paths to search + content: [`_no_warnings_please`], + }; +}