出于调试目的,我想获得产生错误的行号,但我得到了这个:
它引用了bundle.js虽然我在 webpack.config.js 中指定了debug = true:
var path = require('path')
var webpack = require('webpack')
module.exports = {
debug: true,
devtool: 'cheap-module-eval-source-map',
entry: [
'webpack-hot-middleware/client',
'./index'
],
output: {
path: path.join(__dirname, 'dist'),
filename: 'bundle.js',
publicPath: '/static/'
},
plugins: [
new webpack.optimize.OccurrenceOrderPlugin(),
new webpack.HotModuleReplacementPlugin()
],
module: {
loaders: [{
test: /\.js$/,
loaders: ['babel'],
exclude: /node_modules/,
include: __dirname
}]
}
}
无论如何,我可以在预编译的js中获得行号吗?
我尝试添加pathInfo作为this回答推荐,但无济于事。