@@ -36,28 +36,7 @@ function inject_svelte_and_compile(m)
3636 -- either add text to start of body (and return nil), or return a rawblock
3737 -- %s: compiled svelte js path
3838 -- %s: obj_name
39- local svelte_js_import_template = [[
40- <script type="module">
41-
42- // when the doc is ready, find quarto's ojs and inject svelte import
43- document.addEventListener("DOMContentLoaded", () => {
44-
45- import("%s").then(svelteModule => {
46-
47- const ojsModule = window._ojs?.ojsConnector?.mainModule
48- if (ojsModule === undefined) {
49- console.error("Quarto OJS module not found")
50- }
51-
52- // TODO - check to see if there's already a variable with that name
53- const quartoSvelteImport = ojsModule?.variable()
54- quartoSvelteImport?.define("%s", svelteModule)
55-
56- })
57-
58- })
59- </script>
60- ]]
39+ local svelte_js_import_template = ' <script src="%s" type="module"></script>'
6140
6241 -- abort if quarto-svelte.use is not a string or a list of MetaInlines
6342 local quarto_svelte_use = util .get_svelte_paths_from_meta (m )
@@ -80,7 +59,7 @@ function inject_svelte_and_compile(m)
8059
8160 -- ... and inject the ojs init code for it
8261 local svelte_insert = string.format (svelte_js_import_template ,
83- web_path , obj_name )
62+ web_path )
8463 quarto .doc .include_text (" before-body" , svelte_insert )
8564
8665 -- finally, if we're rendering a single doc (not in a project),
0 commit comments