diff options
| author | Adam Johnson <me@adamj.eu> | 2021-01-26 23:10:00 +0000 |
|---|---|---|
| committer | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2021-04-02 12:21:21 +0200 |
| commit | e32722d1606794f0a85d74811e53a0336a1ce305 (patch) | |
| tree | d34bd8cc26240fa5446a30f41ff2fb30f6f5dd96 /docs | |
| parent | 9ee693bd6cf4074f04ec51c6f3cfe87cad392f12 (diff) | |
Fixed #32383 -- Added source map support to ManifestStaticFilesStorage.
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/ref/contrib/staticfiles.txt | 23 | ||||
| -rw-r--r-- | docs/releases/4.0.txt | 4 |
2 files changed, 18 insertions, 9 deletions
diff --git a/docs/ref/contrib/staticfiles.txt b/docs/ref/contrib/staticfiles.txt index 84be7d1c27..f22f32c78d 100644 --- a/docs/ref/contrib/staticfiles.txt +++ b/docs/ref/contrib/staticfiles.txt @@ -291,24 +291,30 @@ The storage backend automatically replaces the paths found in the saved files matching other saved files with the path of the cached copy (using the :meth:`~django.contrib.staticfiles.storage.StaticFilesStorage.post_process` method). The regular expressions used to find those paths -(``django.contrib.staticfiles.storage.HashedFilesMixin.patterns``) -by default covers the `@import`_ rule and `url()`_ statement of `Cascading -Style Sheets`_. For example, the ``'css/styles.css'`` file with the -content +(``django.contrib.staticfiles.storage.HashedFilesMixin.patterns``) cover: + +* The `@import`_ rule and `url()`_ statement of `Cascading Style Sheets`_. +* The `source map`_ comment in JavaScript. + +For example, the ``'css/styles.css'`` file with this content: .. code-block:: css @import url("../admin/css/base.css"); -would be replaced by calling the :meth:`~django.core.files.storage.Storage.url` -method of the ``ManifestStaticFilesStorage`` storage backend, ultimately -saving a ``'css/styles.55e7cbb9ba48.css'`` file with the following -content: +...would be replaced by calling the +:meth:`~django.core.files.storage.Storage.url` method of the +``ManifestStaticFilesStorage`` storage backend, ultimately saving a +``'css/styles.55e7cbb9ba48.css'`` file with the following content: .. code-block:: css @import url("../admin/css/base.27e20196a850.css"); +.. versionchanged:: 4.0 + + Support for finding paths in the source map comments was added. + .. attribute:: storage.ManifestStaticFilesStorage.max_post_process_passes Since static files might reference other static files that need to have their @@ -361,6 +367,7 @@ hashing algorithm. .. _`@import`: https://www.w3.org/TR/CSS2/cascade.html#at-import .. _`url()`: https://www.w3.org/TR/CSS2/syndata.html#uri .. _`Cascading Style Sheets`: https://www.w3.org/Style/CSS/ +.. _`source map`: https://developer.mozilla.org/en-US/docs/Tools/Debugger/How_to/Use_a_source_map ``ManifestFilesMixin`` ---------------------- diff --git a/docs/releases/4.0.txt b/docs/releases/4.0.txt index 516f15b95e..656cf23fa8 100644 --- a/docs/releases/4.0.txt +++ b/docs/releases/4.0.txt @@ -136,7 +136,9 @@ Minor features :mod:`django.contrib.staticfiles` ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -* ... +* :class:`~django.contrib.staticfiles.storage.ManifestStaticFilesStorage` now + replaces paths to JavaScript source map references with their hashed + counterparts. :mod:`django.contrib.syndication` ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
