webpack
webpack copied to clipboard
Incorrect file extension in source map when using eval-source-map
Bug report
What is the current behavior?
- When using
"devtool": "eval-source-map", the generated source map contains invalid file extension.js.jsinstead of just.js. The same behaviour is seen for.jsxfiles, the extension is.jsx.js. - The following is the source map JSON post converting it from the data URI format. See the value of
fileattribute.
{
"version": 3,
"file": "./index.js.js",
"mappings": "AAAA;AACA;AACA;AACA;AACA;AACA",
"sources": ["webpack://source-map/./index.js?41f5"],
"sourcesContent": [
"// Sum of two numbers\nfunction sum(a, b) {\n return a + b;\n}\n\nconsole.log(sum(7, 8));\n"
],
"names": [],
"sourceRoot": ""
}
If the current behavior is a bug, please provide the steps to reproduce. Code and instructions in this sample repo: https://github.com/sidx1024/eval-source-map-webpack-bug-repro
What is the expected behavior?
- When using
"devtool": "eval-source-map", the generated source map should have the correct file extension.js.
Other relevant information: webpack version: v5.74.0 Node.js version: v14.18.3 Operating System: MacOS Additional tools: N/A
Thank you for the report, PR welcome
I'll try to fix this bug
This issue had no activity for at least three months.
It's subject to automatic issue closing if there is no activity in the next 15 days.
Issue was closed because of inactivity.
If you think this is still a valid issue, please file a new issue with additional information.