我如何添加debugging到我的webpackconfiguration

我把我的项目之一从browserify移到了webpack,我只是想知道如何将debugging添加到configuration文件中,类似于browserify --debug以提供源映射。

这是我的webpack.config文件:

 module.exports = { entry: './src/js/main.js', output: { filename: 'bundle.js', path: './src/public/', publicPath: 'public' }, module: { loaders: [ { test: /\.js$/, loader: 'babel-loader' } ] } }; 

看起来我只需要添加源映射: devtool: 'source-map'

 module.exports = { devtool: 'source-map', entry: './src/js/main.js', output: { filename: 'bundle.js', path: './src/public/', publicPath: 'public' }, module: { loaders: [ { test: /\.js$/, loader: 'babel-loader' } ] } };