webpack icon indicating copy to clipboard operation
webpack copied to clipboard

Incorrect file extension in source map when using eval-source-map

Open sidx1024 opened this issue 3 years ago • 4 comments

Bug report

What is the current behavior?

  • When using "devtool": "eval-source-map", the generated source map contains invalid file extension .js.js instead of just .js. The same behaviour is seen for .jsx files, the extension is .jsx.js.
  • The following is the source map JSON post converting it from the data URI format. See the value of file attribute.
{
  "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

sidx1024 avatar Oct 26 '22 09:10 sidx1024

Thank you for the report, PR welcome

alexander-akait avatar Oct 26 '22 09:10 alexander-akait

I'll try to fix this bug

fromaline avatar Oct 31 '22 11:10 fromaline

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.

webpack-bot avatar Jan 31 '23 01:01 webpack-bot

Issue was closed because of inactivity.

If you think this is still a valid issue, please file a new issue with additional information.

webpack-bot avatar Feb 15 '23 03:02 webpack-bot