fix: avoid using spread for client code

pull/384/head
Evan You 3 years ago
parent 034c7375ad
commit 03abee7f7c

@ -66,20 +66,18 @@ export function resolveSiteDataByRoute(
route route
) )
return { // avoid object rest spread since this is going to run in the browser
...siteData, // and spread is going to result in polyfill code
...localeData, return Object.assign({}, siteData, localeData, {
themeConfig: { themeConfig: Object.assign({}, siteData.themeConfig, localeThemeConfig, {
...siteData.themeConfig,
...localeThemeConfig,
// clean the locales to reduce the bundle size // clean the locales to reduce the bundle size
locales: {} locales: {}
}, }),
lang: (localeData || siteData).lang, lang: (localeData || siteData).lang,
// clean the locales to reduce the bundle size // clean the locales to reduce the bundle size
locales: {}, locales: {},
langs: createLangDictionary(siteData) langs: createLangDictionary(siteData)
} })
} }
/** /**

Loading…
Cancel
Save