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

fix: use relative source map paths and add test #1582

Merged
merged 8 commits into from
Aug 15, 2023
Merged

fix: use relative source map paths and add test #1582

merged 8 commits into from
Aug 15, 2023

Conversation

pi0
Copy link
Member

@pi0 pi0 commented Aug 15, 2023

πŸ”— Linked issue

❓ Type of change

  • πŸ“– Documentation (updates to the documentation, readme, or JSdoc annotations)
  • 🐞 Bug fix (a non-breaking change that fixes an issue)
  • πŸ‘Œ Enhancement (improving an existing functionality like performance)
  • ✨ New feature (a non-breaking change that adds functionality)
  • 🧹 Chore (updates to the build process or auxiliary tools and libraries)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

πŸ“š Description

Currently, we were always generating sourcemaps with absolute paths.

This PR makes nitro to follow default rollup behavior (generating relating sourcemap paths). This makes them portable (running in production assuming .output is adjustant to the same expected source structure and also in development mode.

It is worth to note that, we need NODE_OPTIONS=--enable-source-maps flag to lerage sourcemaps (documentation to be improved).

I have added a small test to make sure sourcemap works.

πŸ“ Checklist

  • I have linked an issue or discussion.
  • I have updated the documentation accordingly.

@codecov
Copy link

codecov bot commented Aug 15, 2023

Codecov Report

Merging #1582 (5817160) into main (b8b834f) will decrease coverage by 0.10%.
Report is 2 commits behind head on main.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             main    #1582      +/-   ##
==========================================
- Coverage   76.23%   76.14%   -0.10%     
==========================================
  Files          76       76              
  Lines        7789     7788       -1     
  Branches      776      774       -2     
==========================================
- Hits         5938     5930       -8     
- Misses       1849     1855       +6     
- Partials        2        3       +1     
Files Changed Coverage Ξ”
src/rollup/config.ts 90.68% <100.00%> (-0.87%) ⬇️

... and 2 files with indirect coverage changes

@pi0 pi0 changed the title fix: avoid generating absolute sourcemaps in production bundle fix: use relative source map paths Aug 15, 2023
@pi0 pi0 changed the title fix: use relative source map paths fix: use relative source map paths and add test Aug 15, 2023
@pi0 pi0 marked this pull request as ready for review August 15, 2023 22:53
@pi0 pi0 merged commit b6d679d into main Aug 15, 2023
9 checks passed
@pi0 pi0 deleted the fix/absolute-map branch August 15, 2023 22:53
@pi0 pi0 mentioned this pull request Aug 21, 2023
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.

None yet

1 participant