-
Notifications
You must be signed in to change notification settings - Fork 5.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(compile): ability to embed local data files #26934
feat(compile): ability to embed local data files #26934
Conversation
vfs | ||
.add_file_at_path(&path) | ||
.with_context(|| format!("Including {}", path.display()))?; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Files are included here.
@@ -212,6 +214,48 @@ fn validate_output_path(output_path: &Path) -> Result<(), AnyError> { | |||
Ok(()) | |||
} | |||
|
|||
fn get_module_roots_and_include_files( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Files are parsed out here. Only local files work.
I agree about that. Any way we can fix it before landing? I guess we'd have to pass additional permissions when embedding metadata into the binary. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, could you open a nascent PR to docs repo to mention this?
Opened denoland/docs#1164 |
This is now trivial to implement due to recent changes.
Then to read:
Slightly annoying to have to give read permissions. I feel like we should allow reading files in the binary by default.
This only applies to files on the filesystem. For remote modules, that's going to have to wait for
import ... from "./data.txt" with { "type": "bytes" }
or whatever it will be.Closes #20885