Skip to content

Conversation

@mgol
Copy link
Member

@mgol mgol commented Jul 6, 2023

Summary

Also, as part of this, fix the file & sources properties of the source map file.

Fixes gh-5285
Ref gh-5258

-18 bytes

Checklist

Also, as part of this, fix the `file` & `sources` properties of the source map
file.

Fixes jquerygh-5285
Ref jquerygh-5258
@mgol mgol added Needs review Build Discuss in Meeting Reserved for Issues and PRs that anyone would like to discuss in the weekly meeting. labels Jul 6, 2023
@mgol mgol added this to the 4.0.0 milestone Jul 6, 2023
@mgol mgol self-assigned this Jul 6, 2023
Comment on lines +41 to +47
// Apply map overrides if needed. See the task config description
// for more details.
const mapObject = {
...JSON.parse( incompleteMap ),
...sourceMapOverrides
};
const map = JSON.stringify( mapObject );
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wish we could avoid this parse + fix + stringify back behavior, but it's still quick enough (I actually cannot measure a meaningful time difference with & without this code) and there's not much we can do until the issues are fixed or I learn which parameters to use to get what we need out of the box.

Copy link
Member

@timmywil timmywil left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I forget now why we were reticent to switch to swc, but this looks good.

@mgol
Copy link
Member Author

mgol commented Jul 10, 2023

I forget now why we were reticent to switch to swc, but this looks good.

It used to not support the preamble option - and inserting it manually would require source map adjustments which is not something I'd like to do on our end. They added support after my report in swc-project/swc#7475.

@timmywil timmywil removed the Discuss in Meeting Reserved for Issues and PRs that anyone would like to discuss in the weekly meeting. label Jul 10, 2023
@mgol mgol removed the Needs review label Jul 10, 2023
@mgol mgol merged commit e242187 into jquery:main Jul 10, 2023
@mgol mgol deleted the swc branch July 10, 2023 16:23
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 24, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Development

Successfully merging this pull request may close these issues.

The map file incorrectly contains the dist/ prefix in & file sources fields

2 participants