Skip to content

Commit 2768233

Browse files
author
James Goldie
committed
Bugfixes
1 parent 458c320 commit 2768233

File tree

3 files changed

+6
-13
lines changed

3 files changed

+6
-13
lines changed

_extensions/sverto/rollup.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ const svelteInputPaths = process.argv
1616
.map(d => d.replace("--svelte-in-paths=", ""))
1717
.join(":")
1818
.split(":")
19+
.filter(d => d != "")
1920

2021
// if no svelte paths, bail out early
2122
if (svelteInputPaths == undefined || svelteInputPaths.length == 0) {
@@ -35,7 +36,6 @@ if (quartoRenderPath == undefined || quartoRenderPath.length != 1) {
3536
quartoRenderPath = quartoRenderPath[0]
3637

3738
/* export an array of rollup configs: one for each input svelte file */
38-
3939
export default svelteInputPaths.map(
4040

4141
svelteFile => ({

_extensions/sverto/sverto-prerender.lua

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -101,19 +101,10 @@ for input_path in input_paths:gmatch("[^\n]+") do
101101

102102
-- add each unique path, resolving relative project location
103103
for _, svelte_path in ipairs(sverto_use) do
104-
105104
local offset_path = offset_svelte_path(
106105
pandoc.utils.stringify(svelte_path),
107106
input_path)
108-
109-
if type(svelte_path) ~= "string" then
110-
print(
111-
"Error: sverto.use entry should be a string, not a " ..
112-
type(svelte_path))
113-
end
114-
115107
svelte_paths[offset_path] = offset_path
116-
117108
end
118109

119110
end
@@ -142,6 +133,7 @@ cmd =
142133
get_cmd_prefix() ..
143134
"npm run build " ..
144135
rollup_config .. " -- " ..
136+
-- "--silent " ..
145137
'--quarto-out-path="' .. os.getenv("QUARTO_PROJECT_OUTPUT_DIR") .. '" ' ..
146138
'--svelte-in-paths="' .. svelte_path_string .. '"'
147139

@@ -150,8 +142,8 @@ print(cmd)
150142

151143
local svelteResult = os.execute(cmd)
152144

153-
if svelteResult == nil then
154-
print("Svelte compiler finished!")
145+
if svelteResult == nil or svelteResult == true then
146+
print("Sverto pre-render finished!")
155147
else
156-
print("Svelte compiler finished with code " .. svelteResult)
148+
print("Svelte compiler finished with code " .. tostring(svelteResult))
157149
end

_extensions/sverto/sverto.lua

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@ function inject_svelte_and_compile(m)
9898
else
9999
local svelteCommand =
100100
"npm run build rollup.config.js -- " ..
101+
-- "--silent " ..
101102
'--quarto-out-path="./" ' ..
102103
'--svelte-in-paths="' .. sveltePaths .. '"'
103104
local svelteResult = os.execute(svelteCommand)

0 commit comments

Comments
 (0)