Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions frontend/asset_mapper.rst
Original file line number Diff line number Diff line change
Expand Up @@ -476,10 +476,14 @@ the page as ``link`` tags in the order they were imported.
.. note::

Importing a CSS file is *not* something that is natively supported by
JavaScript modules. AssetMapper makes this work by adding a special importmap
entry for each CSS file. These special entries are valid, but do nothing.
JavaScript modules. AssetMapper makes this work by adding an empty importmap
entry for each CSS file, e.g. ``"/assets/app.css": "data:application/javascript,",``.
These special entries are valid, but do nothing.
AssetMapper adds a ``<link>`` tag for each CSS file, but when JavaScript
executes the ``import`` statement, nothing additional happens.
When using a **Content-Security-Policy** with ``script-src 'self'``, this
will trigger an error because of the ``data:`` URL. You can either just
ignore the error, or lower the rule to ``script-src 'strict-dynamic'``.
Copy link
Preview

Copilot AI Sep 9, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] The phrase 'lower the rule' is unclear and potentially confusing. Using 'strict-dynamic' is not necessarily 'lowering' security - it's a different security model. Consider rephrasing to 'change the rule to' or 'use' instead of 'lower the rule to'.

Suggested change
ignore the error, or lower the rule to ``script-src 'strict-dynamic'``.
ignore the error, or change the rule to ``script-src 'strict-dynamic'``.

Copilot uses AI. Check for mistakes.


.. _asset-mapper-3rd-party-css:

Expand Down