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

Wrongly source duplication in source map #611

Closed
lahmatiy opened this issue Dec 19, 2020 · 1 comment
Closed

Wrongly source duplication in source map #611

lahmatiy opened this issue Dec 19, 2020 · 1 comment

Comments

@lahmatiy
Copy link

The minimal code I found to reproduce the problem:

// a.js
import * as t from './b';
export default t;

// b.js
export const x = 1;

Build config:

require('esbuild').build({
    entryPoints: ['a.js'],
    bundle: true,
    sourcemap: true,
    outdir: 'out'
});

esbuild produces a source map:

{
  "version": 3,
  "sources": ["../b.js", "../b.js", "../a.js"],
  "sourcesContent": ["export const x = 1;\n", "export const x = 1;\n", "import * as t from './b';\nexport default t;\n"],
  "mappings": ";;;;;;;;;;AAAA,MAAA;AAAA;AAAA;AAAA;ACAO,MAAM,IAAI;;;ACCjB,MAAO,YAAQ;",
  "names": []
}

The problem is that the source map contains source of b.js twice but should not.

@evanw
Copy link
Owner

evanw commented Dec 20, 2020

Thanks for reporting this issue. I suspect this is a regression from version 0.7.9 which allows a file to be split into discontiguous pieces (issue #421).

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

Successfully merging a pull request may close this issue.

2 participants