Skip to content

Commit

Permalink
Add support for es modules, fixes #1413 (#1414)
Browse files Browse the repository at this point in the history
* Add support for es modules, fixes #1413

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
timkpaine and pre-commit-ci[bot] authored Nov 6, 2023
1 parent 6418e25 commit c642b78
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions voila/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -264,8 +264,11 @@ 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:
type = 'type="module"' if module else ""
code = f'<script src="{make_url(template_name, base_url, name)}" {type}></script>'
return Markup(code)


Expand Down

0 comments on commit c642b78

Please sign in to comment.