#34100 closed New feature (duplicate)
Support js import statement with ManifestStaticFilesStorage
Reported by: | blighj | Owned by: | nobody |
---|---|---|---|
Component: | contrib.staticfiles | Version: | dev |
Severity: | Normal | Keywords: | |
Cc: | Triage Stage: | Unreviewed | |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
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";""", ),
Change History (4)
comment:1 by , 2 years ago
Version: | 4.1 → dev |
---|
comment:2 by , 2 years ago
comment:3 by , 2 years ago
Resolution: | → duplicate |
---|---|
Status: | new → closed |
Yes it's a duplicate, closing this ticket.
Note:
See TracTickets
for help on using tickets.
Possibly this is a duplicate of #32319, which had an implementation, but had to be reverted due to #33253.