fix: check for server webpack config (#91)

This commit is contained in:
Daniel Roe 2021-01-30 22:05:40 +00:00 committed by GitHub
parent 5aa31613bd
commit 97efab4270

View File

@ -40,7 +40,7 @@ export default function nuxt2CompatModule () {
// Disable server sourceMap, esbuild will generate for it.
nuxt.hook('webpack:config', (webpackConfigs) => {
const serverConfig = webpackConfigs[2] || webpackConfigs[2]
const serverConfig = webpackConfigs.find(config => config.name === 'server')
serverConfig.devtool = false
})