diff --git a/packages/plugin-analytics/src/index.ts b/packages/plugin-analytics/src/index.ts index df7aef4fd..bfa280493 100644 --- a/packages/plugin-analytics/src/index.ts +++ b/packages/plugin-analytics/src/index.ts @@ -12,7 +12,7 @@ export default (api: IApi) => { }, }, }); - const { analytics } = api.userConfig; + const { analytics = {} } = api.userConfig; const { baidu, ga = GA_KEY } = analytics; api.logger.log('insert analytics');