fix(bridge): handle ssr: false (#489)

This commit is contained in:
Ahad Birang 2021-09-06 16:07:58 +04:30 committed by GitHub
parent 0a8c86c885
commit 3304f75b50
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -66,8 +66,10 @@ export function setupNitroBridge () {
// Set up webpack plugin for node async loading
nuxt.hook('webpack:config', (webpackConfigs) => {
const serverConfig = webpackConfigs.find(config => config.name === 'server')
serverConfig.plugins = serverConfig.plugins || []
serverConfig.plugins.push(new AsyncLoadingPlugin())
if (serverConfig) {
serverConfig.plugins = serverConfig.plugins || []
serverConfig.plugins.push(new AsyncLoadingPlugin())
}
})
// Nitro client plugin