django-planet
Jan. 9, 2025

Django: render JavaScript import maps in templates

published by Adam Johnson
in blog Adam Johnson
original entry Django: render JavaScript import maps in templates

JavaScript’s import statement lets module scripts import objects from other scripts. For example, you can define a script as a module in HTML:

<script type=module src="/static/js/index.js"></script>

Then that file can import from another, like:

import { BigBlueButton } from "/static/js/lib/buttons.js";

// ...

This …