Skip to main content
This guide will help you set up Convert to it! for local development using Bun and Vite.

Prerequisites

Before you begin, make sure you have:
  • Git installed on your system
  • Bun runtime installed
  • A terminal or command prompt

Installation

1

Clone the repository with submodules

The project uses Git submodules for some dependencies. Clone the repository with the --recursive flag:
git clone --recursive https://github.com/p2r3/convert
Do not omit the --recursive flag! Submodules contain required dependencies. Without them, the project will not work properly.
If you already cloned without submodules, initialize them:
git submodule update --init --recursive
2

Install Bun

If you haven’t already, install Bun:
curl -fsSL https://bun.sh/install | bash
3

Install dependencies

Navigate to the project directory and install dependencies:
cd convert
bun install
4

Start the development server

Launch the Vite development server:
bun run dev
The application will be available at http://localhost:5173/convert/

Optimizing Performance (Optional)

When you first open the application, it takes time to generate the list of supported formats for each conversion tool. You’ll see warnings in the browser console about missing caches.
1

Generate initial cache

Open the application and wait for the format list to build. You’ll see a message in the console:
Built initial format list
2

Export cache data

Open the browser console and run:
printSupportedFormatCache()
This will output a JSON string with the cache data.
3

Save to cache.json

Copy the JSON output and save it to a file named cache.json in your project root.On subsequent starts, the application will use this cache to skip the loading screen.
The cache optimization is recommended but not required. It significantly improves startup time by avoiding regeneration of format support data.

Available Scripts

Here are the key development scripts from package.json:
ScriptCommandDescription
devbun run devStart Vite development server
buildbun run buildBuild for production
previewbun run previewPreview production build locally
cache:buildbun run cache:buildBuild minified cache file
cache:build:devbun run cache:build:devBuild cache file (non-minified)

Project Structure

The main directories you’ll work with:
  • src/ - Application source code
  • src/handlers/ - File format conversion handlers
  • dist/ - Build output directory
  • docker/ - Docker configuration files

Next Steps

Build docs developers (and LLMs) love