Webpack Source Map Support

raw JSON →
2.0.1 verified Sat Apr 25 auth: no javascript

A Webpack plugin that automatically adds `source-map-support` to your bundle so errors in Node.js applications built with Webpack include mapped stack traces. Version 2.0.1 is stable and requires Webpack 1.x. It injects the dependency at build time, simplifying configuration compared to manual setup. Lightweight with no runtime overhead beyond the source-map-support library itself.

error Error: Cannot find module 'source-map-support'
cause source-map-support is not installed as a dependency.
fix
Run npm install source-map-support to add it.
error Module not found: Error: Can't resolve 'webpack-source-map-support'
cause Package not installed or path incorrect.
fix
Install via npm install webpack-source-map-support --save-dev.
deprecated Only supports Webpack 1.x; not compatible with Webpack 2+.
fix Use webpack-source-map-support@latest or switch to source-map-support manual integration.
gotcha Plugin injects source-map-support globally; may conflict with other error handling libraries.
fix Ensure no other global error handlers override the behavior.
npm install webpack-source-map-support
yarn add webpack-source-map-support
pnpm add webpack-source-map-support

Shows how to add the plugin to webpack.config.js for Node.js target with source-map devtool.

// webpack.config.js
const WebpackSourceMapSupport = require('webpack-source-map-support');
module.exports = {
  entry: './src/index.js',
  output: {
    path: __dirname + '/dist',
    filename: 'bundle.js'
  },
  target: 'node',
  devtool: 'source-map',
  plugins: [
    new WebpackSourceMapSupport()
  ]
};