我正在用Webpack和Babel構建應用程序。當應用程序遇到錯誤時,它會正確列出第一個錯誤的行號,但會爲每個後續步驟顯示縮小代碼的行號。堆棧跟蹤中的Webpack + Babel錯誤行數
我的WebPack配置如下,
const webpack = require('webpack');
const path = require('path');
module.exports = {
module: {
loaders: [
{
loader: "babel-loader",
exclude: [
/(node_modules)/,
],
query: {
presets: ['es2015','react'],
plugins: ['transform-object-rest-spread']
}
},
{
test:/\.less$/,
exclude:'/node_modules',
loader:"style!css!less"
}
]
},
entry: {
"index": ["./src/main"]
},
output: {
path: path.resolve(__dirname, "public"),
publicPath: "/assets",
filename: "[name].bundle.js"
},
resolve: {
extensions: ['', '.js', '.jsx'],
},
devServer: { inline: true },
devtool: 'source-map'
};
AFAIU,你正在調試縮小版本,不是嗎?你究竟在問什麼幫助?請具體說明。 – gca