Source maps will not be generated when run the ” webpack -p” command.

Do you want to request a feature or report a bug?


What is the current behavior?
With nothing to be changed, run the command webpack or webpack -p,I get source maps only when I execute the webpack command. The webpack -p will not generate the source map.
If the current behavior is a bug, please provide the steps to reproduce.
npm install => npm run cd => NO source maps.
npm install => npm run cc => Yes.
The webpack.config.js:

new webpack.SourceMapDevToolPlugin({
filename: ‘srcMapPlugin/[file].map’,
include: [‘js/test1.js’],
append: ‘\n//#sourceMappingURL=[url]‘,
devtool: false,


“scripts”: {
“test”: “echo “Error: no test specified” && exit 1″,
“v”: “webpack -version”,
“cc”: “.\node_modules\.bin\webpack “,
“cd”: “.\node_modules\.bin\webpack -p”,
“cp”: “cross-env NODE_ENV=production PLATFORM=web .\node_modules\.bin\webpack –optimize-minimize”

The sample is:

What is the expected behavior?
Source maps will be generated.

If this is a feature request, what is motivation or use case for changing the behavior?

Please mention other relevant information such as the browser version, Node.js version, webpack version and Operating System.

Author: Fantashit

1 thought on “Source maps will not be generated when run the ” webpack -p” command.

  1. When using the SourceMapDevToolPlugin you have to use the UglifyJsPlugin with sourceMap: true manually.

Comments are closed.