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

WIP - Warn if transformer does not update source-map #247

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

yamadapc
Copy link
Contributor

@yamadapc yamadapc commented Dec 3, 2024

This adds a warning if a transformer changes the asset source but does not update its source-map.


WIP because I'll update this to remove non JS/TS warnings and to log only a reasonable amount.

This adds a warning if a transformer changes the asset source but does
not update its source-map.
@yamadapc yamadapc requested a review from a team December 3, 2024 03:51
let results = await normalizeAssets(this.options, transfomerResult);
const results = await normalizeAssets(this.options, transfomerResult);

if (mutableAsset.hasUpdatedSource && !mutableAsset.hasUpdatedSourceMap) {
Copy link
Contributor

@MonicaOlejniczak MonicaOlejniczak Dec 3, 2024

Choose a reason for hiding this comment

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

Consider modifying this to check if a sourcemap exists yet. For example, some transformers rely on babel / swc to add the source map later and this will have correct mappings. You'd probably need to also add a check at the end to make sure a sourcemap exists after all pipelines run.

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.

2 participants