Follows #1186. The extra_body_script() plugin hook should provide a mechanism for specifying that the script should use <script type="module">.
Relevant docs: https://docs.datasette.io/en/stable/plugin_hooks.html#extra-body-script-template-database-table-columns-view-name-request-datasette