vue2 配置sourcemap
时间: 2024-01-26 13:01:53 浏览: 127
要在Vue2中配置sourcemap,您需要在webpack配置文件中设置devtool选项。例如,如果您正在使用vue-cli创建项目,则可以在vue.config.js文件中添加以下内容:
module.exports = {
configureWebpack: {
devtool: 'source-map'
}
}
这将告诉Webpack生成sourcemap,并将其嵌入到生成的文件中。您还可以将devtool选项设置为其他值,例如'cheap-module-eval-source-map'或'cheap-module-source-map',具体取决于您需要的精度和性能。
阅读全文