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

Disable MakePathsRelative when generating SourceMaps #133

Conversation

nikolajlauridsen
Copy link

We got a bug report over on the Umbraco repo about some javascript assets loading super slowly, in testing I managed to hit 10 second load times reliably. A community member did some great digging and found that the cause of it is when the source maps are generated in this comment.

It fails in Nuglify because it will try and make the path relative, even though it's already relative, leading to an exception being thrown for every segment it tries to process making it super slow.

This PR disables the feature making paths relative in Nuglify across the board since as far as I've been able to gather the paths will always be relative when using Smidge, so it shouldn't be needed. If it's not the case and the feature needs to be enabled in certain scenarios it should of course be configurable instead.

After disabling MakePathsRelative the time improved from 9-10 seconds down to less than one second.

This will always fail in nuglify, because we pass it relative path, leading to an exception being thrown for every segment, making the operation very very slow.
@Shazwazza
Copy link
Owner

Great stuff, I'll check it out tomorrow hopefully 🙌

@Shazwazza Shazwazza added the bug label Nov 25, 2021
@Shazwazza Shazwazza added this to the 4.0.3 milestone Nov 25, 2021
@Shazwazza Shazwazza merged commit 0204943 into Shazwazza:master Nov 25, 2021
@Shazwazza
Copy link
Owner

@nikolajlauridsen this is released now https://github.com/Shazwazza/Smidge/releases/tag/v4.0.3

@nikolajlauridsen
Copy link
Author

Amazing, thanks, I'll go and get the reference updated in the CMS then 🎉 🙌

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

Successfully merging this pull request may close these issues.

None yet

2 participants