#34100: Support js import statement with ManifestStaticFilesStorage
-----------------------------------------------+------------------------
Reporter: blighj | Owner: nobody
Type: New feature | Status: new
Component: contrib.staticfiles | Version: 4.1
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 |
-----------------------------------------------+------------------------
Browsers now have good support for the import statement of javascript
https://developer.mozilla.org/en-
US/docs/Web/JavaScript/Reference/Statements/import#syntax
Which is in the form
{{{
import defaultExport from "module-name.js";
import "../module-name2.js";
}}}
Something like the below added to the js patterns of HashedFilesMixin
should cover both use cases
{{{
(
r"""(?P<matched>import(?P<from>[\s\{].*?from)\s*?['"](?P<url>[\w\.\/-]*?)["']\s*?;)""",
"""import%(from)s"%(url)s";""",
),
(
r"""(?P<matched>import\s*?['"](?P<url>[\w\.\/-]*?)["']\s*?;)""",
"""import"%(url)s";""",
),
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/34100>
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 [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/01070183dc800bf5-88b84f8b-b9e4-4e0f-913a-30f45a85ef5d-000000%40eu-central-1.amazonses.com.