You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I really like this crate but I'm facing a problem: I have some static files that get minified and packed using vite / rollup which itself gets called in a build.rs buildscript. One useful environment variable in such a build.rs script is OUT_DIR where I can store the build artifacts of npm build.
I want to include those build artifacts with memory_serve. However, you're just turning the input TokenStream in your proc Macro into a String so macros like env!("OUT_DIR") won't get resolved. In fact, as far as I know resolving TokenStreams is unstable at the moment.
Maybe we can add another macro load_assets_from_out_dir! or something similar. I'm going to preare a PR for that that you might consider.
The text was updated successfully, but these errors were encountered:
Thank you @BeneSim, and sorry for my late response.
That seems reasonable, but I would prefer not introducing a new macro. Would it be an option for you if I added a MEMORY_SERVE_ROOT environment variable that would have priority over CARGO_MANIFEST_DIR when resolving a relative path? See #5
Hey,
I really like this crate but I'm facing a problem: I have some static files that get minified and packed using vite / rollup which itself gets called in a
build.rs
buildscript. One useful environment variable in such a build.rs script isOUT_DIR
where I can store the build artifacts of npm build.I want to include those build artifacts with memory_serve. However, you're just turning the input
TokenStream
in your proc Macro into a String so macros likeenv!("OUT_DIR")
won't get resolved. In fact, as far as I know resolvingTokenStream
s is unstable at the moment.Maybe we can add another macro
load_assets_from_out_dir!
or something similar. I'm going to preare a PR for that that you might consider.The text was updated successfully, but these errors were encountered: