RCompiler
VSCode extension for compiling web2 project pages with right-click context menu
Features
- Right-click compilation: Compile any folder under
views/ with a single click
- Two compilation modes:
- Incremental: Compile only modified pages (faster, for development)
- Force: Compile all pages (complete rebuild, for production)
- Configurable paths: Support different project structures via VSCode settings
- Real-time feedback: Progress indicator and detailed compilation logs
- Output channel: View compilation output in dedicated "RCompiler" panel
Installation
From Marketplace (coming soon)
- Open VSCode Extensions panel (Ctrl+Shift+X)
- Search for "RCompiler"
- Click Install
From VSIX
- Download the latest
.vsix file from [Releases]
- In VSCode, press F1 and select "Extensions: Install from VSIX..."
- Select the downloaded file
From Source
# Clone the repository
git clone https://github.com/yourusername/RCompiler.git
cd RCompiler
# Install dependencies
npm install
# Build
npm run compile
# Install in VSCode
# Press F5 in VSCode to open Extension Development Host
Configuration
RCompiler uses VSCode settings. Open settings (Ctrl+,) and search for "RCompiler":
| Setting |
Default |
Description |
rcompiler.compileScript |
scripts/compile.ts |
Path to compile script (relative to workspace root) |
rcompiler.compileWorkingDirectory |
"" |
Working directory for compilation (empty = workspace root) |
rcompiler.compileTimeout |
300 |
Compilation timeout in seconds (10-3600) |
Example Configuration
For a custom project structure:
{
"rcompiler.compileScript": "tools/build/compile.js",
"rcompiler.compileWorkingDirectory": "frontend",
"rcompiler.compileTimeout": 600
}
Usage
Basic Workflow
- Open your web2 project in VSCode
- In the Explorer, find a folder under
views/ (e.g., views/Home/)
- Right-click the folder
- Select compilation mode from "RCompiler" menu:
- 增量编译(仅修改页面) - Incremental compile
- 强制编译(全部页面) - Force compile
- View progress in status bar and output in "RCompiler" panel
Viewing Output
To view compilation details:
- Open Output Channel: Press
Ctrl+Shift+U and select "RCompiler"
- From Error Notification: Click "Open Output" button in error messages
Requirements
- VSCode: version 1.74.0 or higher
- Node.js: For running the compile script (tsx/ts-node)
- Project: web2 project with
compile.ts script
Troubleshooting
"Compile script not found"
Cause: The configured script path doesn't exist in your workspace.
Solution:
- Open VSCode settings (Ctrl+,)
- Search for "rcompiler.compileScript"
- Update the path to match your project structure
"No workspace folder found"
Cause: No folder is open in VSCode.
Solution: Open your project folder in VSCode (File → Open Folder).
Compilation timeout
Cause: Compilation takes longer than configured timeout.
Solution:
- Open VSCode settings (Ctrl+,)
- Search for "rcompiler.compileTimeout"
- Increase the timeout value (in seconds)
FAQ
Q: Can I compile multiple folders at once?
A: Currently, RCompiler compiles one folder at a time. The compile script determines which pages are included.
Q: Does this work with file symbols (remote workspaces)?
A: Yes, as long as the compile script is accessible via the file system.
Q: Can I customize the compilation arguments?
A: Currently, RCompiler passes --prod and optionally --force to the compile script. Custom args may be added in future versions.
Changelog
See CHANGELOG.md for version history.
License
MIT License - see LICENSE for details.
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
Support
Screenshots

Progress Indicator

Output Channel
