Skip to content

Input source maps are ignored in v7.6.0 and up #10534

@dkamyshov

Description

@dkamyshov

Bug Report

Current Behavior
Babel ignores input source maps.

Input Code
https://github.com/dkamyshov/babel-input-source-map-reproduction

  • run yarn, you should see {"version":3,"sources":["../lib-tmp/index.js"],... in the console - this is incorrect

  • run yarn add -D @babel/core@7.5.5. you should see {"version":3,"sources":["../src/index.tsx"],... - this is correct

Expected behavior/code
Babel should consume input source maps and reference original source files in the resulting source maps.

Babel Configuration (.babelrc, package.json, cli command)

{
  "sourceMaps": true,
  "inputSourceMap": true,
  "presets": ["@babel/preset-env"]
}
babel lib-tmp --out-dir lib --extensions .js --source-maps

Environment

  • Babel version(s): 7.6.3 (@babel/core 7.6.3)
  • Node/npm version: v10.16.0, 6.9.0
  • OS: OSX 10.14.6
  • Monorepo: no
  • How you are using Babel: cli

Possible Solution
Downgrade to v7.5.5 or earlier.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Has PRi: regressionoutdatedA closed issue/PR that is archived due to age. Recommended to make a new issue

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions