Skip to content

Repository files navigation

🚀 Minimal Vite

Vite TypeScript License npm Node

A lightweight and modern starter template for TypeScript projects using Vite, now with an easy-to-use CLI tool.

✨ Features

  • ⚡️ Fast development with Vite
  • 🔵 TypeScript support out of the box
  • 📦 Minimal dependencies
  • 🧩 Simple and clean project structure
  • 🛠️ Easy scaffolding with CLI tool
  • 🔄 Support for npm and Bun

🚦 Getting Started

💫 Create a New Project (Easiest)

Create a new project with a single command using bunx:

bunx @mrbrunowolff/minimal-vite my-project

The interactive CLI will:

  1. Ask for your project name (or use the provided one)
  2. Let you choose between npm or bun as package manager
  3. Set up everything for immediate development

🚀 Development Workflow

After creating your project:

# Navigate to your project
cd my-project

# Start the development server
bun start

Your app will be available at http://localhost:3000 with hot module replacement enabled.

📦 Build for Production

bun run build

The optimized production build will be in the dist directory, ready for deployment.

👀 Preview Production Build

bun run preview

📁 Project Structure

minimal-vite/
├── src/
│   ├── main.ts        # Application entry point
│   ├── style.css      # Global styles
│   └── vite-env.d.ts  # TypeScript declarations for Vite
├── index.html         # HTML template
├── tsconfig.json      # TypeScript configuration
├── package.json       # Project dependencies and scripts
└── vite.config.ts     # Vite configuration

🔧 Customization

This template is intentionally minimal to serve as a clean starting point. You can easily extend it with:

  • 🔄 Frontend frameworks like React, Vue, or Svelte
  • 🎨 CSS preprocessors like SASS or LESS
  • 🧪 Testing libraries
  • 🔍 Linting and formatting tools

Example: Adding React

# Install React
bun add react react-dom
bun add -D @types/react @types/react-dom

# Add JSX support to vite.config.ts
# and start building React components!

🔍 Advanced Usage

Manual Setup (Alternative)

If you prefer to manually set up your project:

  1. Clone the repository:
git clone https://github.com/MrBrunoWolff/minimal-vite.git my-project
cd my-project
  1. Remove git history and initialize a new repository:
rm -rf .git
git init
git add .
git commit -m "Initial commit"
  1. Install dependencies:
bun install
  1. Start building!

Configuration

The template includes a pre-configured vite.config.ts with:

  • Development server on port 3000 with auto-open browser
  • Source maps for debugging
  • Terser for optimal production builds
  • Proper base path configuration

You can customize this configuration to fit your specific needs.

🤝 Contributing

Contributions to improve this template are welcome!

  1. Fork the repository
  2. Create your feature branch: git checkout -b my-feature
  3. Commit your changes: git commit -am 'Add some feature'
  4. Push to the branch: git push origin my-feature
  5. Submit a pull request

📄 License

This project is licensed under the MIT License - see the LICENSE file for details.

About

A minimal starting structure using Vite and TypeScript

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages