fix(compat): disable webpack sourcemap (#84)

This commit is contained in:
Xin Du (Clark) 2021-01-24 20:30:20 +00:00 committed by GitHub
parent 67a82a7ab9
commit 1b142148eb

View File

@ -38,6 +38,14 @@ export default function nuxt2CompatModule () {
nuxt.server = createNuxt2DevServer(nitroDevContext)
}
// Disable server sourceMap, esbuild will generate for it.
if (nitroContext.sourceMap !== false) {
nuxt.hook('webpack:config', (webpackConfigs) => {
const serverConfig = webpackConfigs[2] || webpackConfigs[2]
serverConfig.devtool = false
})
}
// Nitro client plugin
this.addPlugin({
fileName: 'nitro.client.js',