diff --git a/integrations/utils/src/lib.rs b/integrations/utils/src/lib.rs index 702e18fcc..803960022 100644 --- a/integrations/utils/src/lib.rs +++ b/integrations/utils/src/lib.rs @@ -2,6 +2,7 @@ use futures::{Stream, StreamExt}; use leptos::{nonce::use_nonce, use_context, RuntimeId}; use leptos_config::LeptosOptions; use leptos_meta::MetaContext; +use std::borrow::Cow; extern crate tracing; @@ -55,7 +56,9 @@ pub fn html_parts_separated( options: &LeptosOptions, meta: Option<&MetaContext>, ) -> (String, &'static str) { - let pkg_path = &options.site_pkg_dir; + let pkg_path = option_env!("CDN_PKG_PATH") + .map(Cow::from) + .unwrap_or_else(|| format!("/{}", options.site_pkg_dir).into()); let output_name = &options.output_name; let nonce = use_nonce(); let nonce = nonce @@ -107,8 +110,8 @@ pub fn html_parts_separated( {head} - - + +