Skip to content
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 directory in executable #26939

Merged
merged 3 commits into from
Nov 19, 2024

Conversation

dsherret
Copy link
Member

@dsherret dsherret commented Nov 19, 2024

deno compile --allow-read=data --include data --output main main.js
// main.js
const dataDir = import.meta.dirname + "/data";
const fileNames = Deno.readDirSync(dataDir).map((entry) => dataDir + "/" + entry.name);

for (const fileName of fileNames) {
  console.log("Reading", fileName);
  console.log(Deno.readTextFileSync(fileName));
}

Ref #20885

@dsherret dsherret added this to the 2.1.0 milestone Nov 19, 2024
@dsherret dsherret requested a review from bartlomieju November 19, 2024 21:52
@dsherret dsherret enabled auto-merge (squash) November 19, 2024 22:02
@dsherret dsherret merged commit 6b478cd into denoland:main Nov 19, 2024
17 checks passed
@dsherret dsherret deleted the feat_compile_include_directory branch November 20, 2024 15:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants