deno compile command compiles a Deno script into a self-contained executable that can run without the Deno CLI installed.
Usage
Basic Examples
Output Options
Set the output file name
Cross-compilation
Compile for a specific target platform
Including Files
Include additional files in the compiled output
Exclude specific files or patterns
Executable Options
Compile as a GUI application (Windows only)
Set a custom icon for the executable (Windows only)
Advanced Options
Output an .eszip file instead of an executable
Permission Flags
All permissions must be specified at compile time:Configuration
Load configuration from a file
Load import map file
Create a node_modules directory for npm packages
Examples
Simple CLI Tool
Web Server
File Processing Tool
Cross-Platform Compilation
Including Assets
NPM Package Compilation
Platform-Specific Notes
Windows
- Executables automatically get
.exeextension - Use
--no-terminalfor GUI applications - Use
--iconto set custom icon
macOS
- Executables may need to be signed for distribution
- Use
chmod +xto make executable if needed - Different targets for Intel (
x86_64) and Apple Silicon (aarch64)
Linux
- Executables are created without extension
- May need to mark as executable:
chmod +x myapp - Works on most distributions