fix: use optional chain syntax as the property might not be set

This commit is contained in:
Derrick Hammer 2023-07-02 11:34:41 -04:00
parent 30554e2dfe
commit 2077d4e70d
Signed by: pcfreak30
GPG Key ID: C997C339BE476FF2
1 changed files with 1 additions and 1 deletions

View File

@ -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,
);