From 2077d4e70d37e7cf7f23a3db8e2d93ca414b1e2d Mon Sep 17 00:00:00 2001 From: Derrick Hammer Date: Sun, 2 Jul 2023 11:34:41 -0400 Subject: [PATCH] fix: use optional chain syntax as the property might not be set --- source/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/index.ts b/source/index.ts index 1953ed0..5dfd003 100644 --- a/source/index.ts +++ b/source/index.ts @@ -77,7 +77,7 @@ export default function (): PresetAsset { 'gitignore': ['/rollup.config.ts'], 'rollup': (context) => { const content = loadFile(resolve(CONFIGS, 'rollup.yaml')) as any; - if (context.custom.config.browser) { + if (context.custom?.config?.browser) { let plugins = content.plugins.map((item) => Array.isArray(item) ? item[0] : item, );