Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

linked node_modules source maps are mixed w/ project #2194

Closed
ewingrj opened this issue Oct 24, 2018 · 1 comment
Closed

linked node_modules source maps are mixed w/ project #2194

ewingrj opened this issue Oct 24, 2018 · 1 comment
Labels

Comments

@ewingrj
Copy link

ewingrj commented Oct 24, 2018

🐛 bug report

I am trying to include sourcemaps for a dependency that has been linked. npm link mydep

This is working with the caveat that the sourcemaps appear under the same root src/ in chrome devtools. This is a problem b/c the linked node_module sourcemaps appear mixed with my applications sourcemaps and will be overwritten by my app if any conflicts exist.

possibly related to #1801?

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

{
  "presets": [
    [
      "@babel/preset-env",
      {
        "modules": false,
        "targets": {
          "browsers": [
            "> 1%",
            "last 3 versions",
            "ie >= 9",
            "ios >= 8",
            "android >= 4.2"
          ]
        },
        "useBuiltIns": false
      }
    ]
  ],
  "plugins": [
    ["styled-components", { "displayName": true }],
    "@babel/plugin-proposal-class-properties"
  ]
}

🤔 Expected Behavior

I would expect any sourcemaps found for node_modules would be served at a different root. See next section for an example

😯 Current Behavior

currently they are served from the same /src root.

ex.

app

-- src
  -- index.js

mydep

-- src
  -- index.js
  -- cache
    -- index.js

The source maps in chrome devtools will appear as:

-- src
  -- index.js (this is from app)
  -- cache
    -- index.js (this is from mydep)

I would expect them to appear as:
The source maps in chrome devtools will appear as:

-- mydep (or even as a sub dir of node_modules)
  -- index.js
  -- cache
    -- index.js
-- src
  -- index.js

💁 Possible Solution

🔦 Context

Being able to correctly view sourcemaps for linked dependencies is useful when attempting to debug a package.

💻 Code Sample

just link any node_module w/ built source maps to your app

🌍 Your Environment

Software Version(s)
Parcel 1.10.1
Node v8.11.3
npm 6.4.1
Operating System macos
@mischnic
Copy link
Member

mischnic commented Jan 10, 2019

Current situation:
parcel build index.html (correct):
build
parcel index.html (wrong):
serve

#2489 will fix this remaining problem

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants