Skip to content
Discussion options

You must be logged in to vote

Let's fix your example:

  • main.js is wrong: there are no "f" function exported, only the default function
import f from "./lib.js";

f();
  • dependencies.lua

Both scripts need to have the module type:

function Meta(m)
  quarto.doc.add_html_dependency({
    name = "minimal",
    version = "1.0.0",
    scripts = {
      { path = "../static/main.js", attribs = {type = "module"} },
      { path = "../static/lib.js", attribs = {type = "module"} }
    }
  })
end
  • resources should be removed.

And it works:

The HTML is:

<html><head>
<script src="site_libs/quarto-contrib/minimal-1.0.0/main.js" type="module"></script>
<script src="site_libs/quarto-contrib/minimal-1.0.0/lib.js" type="module"></script>

Replies: 2 comments 5 replies

Comment options

You must be logged in to vote
5 replies
@mcanouil
Comment options

mcanouil Sep 1, 2025
Collaborator

@rgaiacs
Comment options

@mcanouil
Comment options

mcanouil Sep 2, 2025
Collaborator

@mcanouil
Comment options

mcanouil Sep 2, 2025
Collaborator

Answer selected by rgaiacs
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
extensions relates to Quarto extensions mechanism html Issues with HTML and related web technology (html/css/scss/js)
2 participants