Source maps will not be generated when run the " webpack -p" command.
See original GitHub issueDo you want to request a feature or report a bug?
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=http://192.168.32.5:8080/[url]’, moduleFilenameTemplate:‘[absolute-resource-path]’, }), devtool: false, …
package.json:
“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:
https://github.com/yincu/srcMapPlugin.git
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.
Issue Analytics
- State:
- Created 6 years ago
- Comments:8 (3 by maintainers)
When using the
SourceMapDevToolPlugin
you have to use theUglifyJsPlugin
withsourceMap: true
manually.@yincu You can pass options to configure
SourceMapDevToolPlugin
fornosources-source-map
orhidden-source-map
.