Next.js에서 sourcemap을 생성하는 방법
// next.config.js
module.exports = {
productionBrowserSourceMaps: true,
}
devtool
옵션을 줘야하는 지 모르고 sourceMapFilename
옵션만 수정하다가 시간을 많이 보냈다. sourceMapFilename
은 따로 수정할 필요가 없다.[file].map[query]
가 기본 설정이다.const prod = process.env.NODE_ENV === 'production'
module.exports = {
productionBrowserSourceMaps: true,
..
webpack: config => {
return {
...config,
devtool: prod ? 'hidden-source-map' : 'inline-source-map',
}
},
}