#33237: ManifestStaticFilesStorage doesn't update JavaScript source map references in multiline files -----------------------------------------------+------------------------ Reporter: Joseph Abrahams | Owner: nobody Type: Bug | Status: new Component: contrib.staticfiles | Version: 4.0 Severity: Normal | Keywords: Triage Stage: Unreviewed | Has patch: 0 Needs documentation: 0 | Needs tests: 0 Patch needs improvement: 0 | Easy pickings: 0 UI/UX: 0 | -----------------------------------------------+------------------------ Current implementation of `HashedFilesMixin` relies on regex multiline mode to parse out the sourceMappingURL comment. As is, the filename is only correctly replaced when the comment is the first and only line in the JS file (exception to final single new line at EOF).
Steps to reproduce: - Include static multi-line javascript file that contains a valid sourceMappingURL comment in a project with `STATICFILES_STORAGE = 'django.contrib.staticfiles.storage.ManifestStaticFilesStorage'` - Run `python manage.py collectstatic` - Open the new hashed javascript file and observe the unmodified sourceMappingURL comment See updated, failing test case: [https://joseph.is/3CrvpSW]. More than happy to work on a patch provided some guidance on expected functionality. -- Ticket URL: <https://code.djangoproject.com/ticket/33237> Django <https://code.djangoproject.com/> The Web framework for perfectionists with deadlines. -- You received this message because you are subscribed to the Google Groups "Django updates" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-updates+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/django-updates/057.f74bdb7b53b2e7e65eb53d11dc6fdd64%40djangoproject.com.