From a3b74f3760e26d3cb25678805fe2e97399b6e6f4 Mon Sep 17 00:00:00 2001 From: MellowCo <799478052@qq.com> Date: Mon, 8 May 2023 16:51:40 +0800 Subject: [PATCH] feat: add option preflight #58 --- src/index.ts | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/index.ts b/src/index.ts index 2b871ad..6b7e56c 100644 --- a/src/index.ts +++ b/src/index.ts @@ -56,6 +56,13 @@ export interface PresetWeappOptions extends PresetOptions { */ prefix?: string | string[] + /** + * Generate preflight + * + * @default true + */ + preflight?: boolean + /** * 是否转换微信class * @@ -127,6 +134,8 @@ export interface PresetWeappOptions extends PresetOptions { export const presetWeapp = (options: PresetWeappOptions = {}): Preset => { options.dark = options.dark ?? 'class' options.attributifyPseudo = options.attributifyPseudo ?? false + options.preflight = options.preflight ?? true + options.transform = options.transform ?? true options.isH5 = options.isH5 ?? false options.designWidth = options.designWidth ?? 750 @@ -177,7 +186,7 @@ export const presetWeapp = (options: PresetWeappOptions = {}): Preset => if (options.platform === 'uniapp' && options.isH5) uniAppVue2CssRpxTransform(css) }, - preflights: preflights(options.isH5, options.platform), + preflights: options.preflight ? preflights(options.isH5, options.platform) : [], prefix: options.prefix, } }