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

Use correct file names when writing sourcemaps for multiple outputs using the "dir" option #3440

Merged
merged 1 commit into from Mar 13, 2020

Conversation

lukastaegert
Copy link
Member

This PR contains:

  • bugfix
  • feature
  • refactor
  • documentation
  • other

Are tests included?

  • yes (bugfixes and features will not be merged without tests)
  • no

Breaking Changes?

  • yes (breaking changes will not be merged unless absolutely necessary)
  • no

List any relevant issue numbers:
Resolves #3439

Description

The issue was that Rollup mutates the generated chunk objects when writing multiple outputs, overwriting the chunk ids in the process. When using a config file, writing multiple outputs is interleaved. As the sourcemapfile is using the chunk id and is generated at the end, an overwritten chunk id is used. This is fixed for now by storing the chunk id in a local variable.

@rollup-bot
Copy link
Collaborator

Thank you for your contribution! ❤️

You can try out this pull request locally by installing Rollup via

npm install rollup/rollup#gh-3439-fix-sourcemaps-multiple-outputs

or load it into the REPL:
https://rollupjs.org/repl/?circleci=9903

@codecov
Copy link

codecov bot commented Mar 13, 2020

Codecov Report

Merging #3440 into master will increase coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #3440   +/-   ##
=======================================
  Coverage   95.01%   95.01%           
=======================================
  Files         171      171           
  Lines        5840     5841    +1     
  Branches     1723     1723           
=======================================
+ Hits         5549     5550    +1     
  Misses        157      157           
  Partials      134      134           
Impacted Files Coverage Δ
src/Chunk.ts 99.77% <100.00%> (+<0.01%) ⬆️
src/utils/collapseSourcemaps.ts 90.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 99a9c41...4c5f1bd. Read the comment docs.

@lukastaegert lukastaegert merged commit a6c450e into master Mar 13, 2020
@lukastaegert lukastaegert deleted the gh-3439-fix-sourcemaps-multiple-outputs branch March 13, 2020 05:26
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 this pull request may close these issues.

Broken sourcemaps for two outputs of different entryFileNames in same dir
2 participants