mirror of
https://github.com/woutdp/live_svelte
synced 2026-05-24 09:28:21 +00:00
Move ssr build from priv/static/assets into priv/svelte
This commit is contained in:
parent
07c14a770c
commit
26cdfb462f
4 changed files with 7 additions and 7 deletions
|
|
@ -34,7 +34,7 @@ let optsServer = {
|
|||
minify: false,
|
||||
target: "node19.6.1",
|
||||
conditions: ["svelte"],
|
||||
outdir: "../priv/static/assets/server",
|
||||
outdir: "../priv/svelte",
|
||||
logLevel: "info",
|
||||
sourcemap: watch ? "inline" : false,
|
||||
watch,
|
||||
|
|
|
|||
3
example_project/.gitignore
vendored
3
example_project/.gitignore
vendored
|
|
@ -28,6 +28,9 @@ example-*.tar
|
|||
# Ignore assets that are produced by build tools.
|
||||
/priv/static/assets/
|
||||
|
||||
# Ignore ssr build for svelte.
|
||||
/priv/svelte/
|
||||
|
||||
# Ignore digested assets cache.
|
||||
/priv/static/cache_manifest.json
|
||||
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@ let optsServer = {
|
|||
minify: false,
|
||||
target: "node19.6.1",
|
||||
conditions: ["svelte"],
|
||||
outdir: "../priv/static/assets/server",
|
||||
outdir: "../priv/svelte",
|
||||
logLevel: "info",
|
||||
sourcemap: watch ? "inline" : false,
|
||||
watch,
|
||||
|
|
|
|||
|
|
@ -11,12 +11,9 @@ defmodule LiveSvelte.SSR do
|
|||
@moduledoc false
|
||||
|
||||
@doc false
|
||||
def render(name, props, slots \\ nil)
|
||||
def render(name, nil, slots), do: render(name, %{}, slots)
|
||||
|
||||
def render(name, props, slots) do
|
||||
try do
|
||||
NodeJS.call!({"server/server", "ssrRenderComponent"}, [name, props, slots])
|
||||
NodeJS.call!({"server", "ssrRenderComponent"}, [name, props, slots])
|
||||
catch
|
||||
:exit, {:noproc, _} -> raise LiveSvelte.SSR.NodeNotConfigured
|
||||
end
|
||||
|
|
@ -24,6 +21,6 @@ defmodule LiveSvelte.SSR do
|
|||
|
||||
def server_path() do
|
||||
{:ok, path} = :application.get_application()
|
||||
Application.app_dir(path, "/priv/static/assets")
|
||||
Application.app_dir(path, "/priv/svelte")
|
||||
end
|
||||
end
|
||||
|
|
|
|||
Loading…
Reference in a new issue