Skip to content

Commit

Permalink
Add support for es modules, fixes #1413
Browse files Browse the repository at this point in the history
  • Loading branch information
timkpaine committed Oct 31, 2023
1 parent 6418e25 commit b1ed265
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions voila/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -264,8 +264,8 @@ def include_css(template_name: str, base_url: str, name: str) -> str:
return Markup(code)


def include_js(template_name: str, base_url: str, name: str) -> str:
code = f'<script src="{make_url(template_name, base_url, name)}"></script>'
def include_js(template_name: str, base_url: str, name: str, module: bool = False) -> str:
code = f'<script src="{make_url(template_name, base_url, name)}" {'type="module"' if module else ""}></script>'
return Markup(code)


Expand Down

0 comments on commit b1ed265

Please sign in to comment.