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

🚀 Feature: Support Vite as build tool (opt-in Block) #1917

Open
birkskyum opened this issue Jan 27, 2025 · 5 comments
Open

🚀 Feature: Support Vite as build tool (opt-in Block) #1917

birkskyum opened this issue Jan 27, 2025 · 5 comments
Labels
status: accepting prs Please, send a pull request to resolve this! type: feature New enhancement or request

Comments

@birkskyum
Copy link

birkskyum commented Jan 27, 2025

Overview

Looking at the Bundler options, I see only tsup (esbuild)

I'd like to use Vite as the build tool.

@birkskyum birkskyum added the type: feature New enhancement or request label Jan 27, 2025
@JoshuaKGoldberg
Copy link
Owner

Indeed - I've been slowly getting more dissatisfied with how tsup has been behaving. See #1910 for a deep dive tracking rethinking the default builder/bundler/transpiler.

@birkskyum do you have examples you can share of Vite configs and how they're run? I'd love to add a block/option for Vite as a build tool, even if it's not enabled by default.


For reference, in v2, you can omit tsup:

npx create typescript-app@beta --exclude-tsup

...and then add in whatever builders/bundlers/etc on your own manually.

@JoshuaKGoldberg JoshuaKGoldberg added the status: waiting for author Needs an action taken by the original poster label Jan 27, 2025
@birkskyum
Copy link
Author

birkskyum commented Jan 27, 2025

Here an example of this "Library mode" with a vite config that's used in all the packages of e.g. the Tanstack Router

https://github.com/TanStack/config/blob/main/packages/config/src/vite/index.js

Or just basic rollup config like in the Tanstack Table

@JoshuaKGoldberg JoshuaKGoldberg added status: in discussion Not yet ready for implementation or a pull request and removed status: waiting for author Needs an action taken by the original poster labels Jan 27, 2025
@JoshuaKGoldberg JoshuaKGoldberg added status: accepting prs Please, send a pull request to resolve this! and removed status: in discussion Not yet ready for implementation or a pull request labels Apr 4, 2025
@JoshuaKGoldberg
Copy link
Owner

Another straightforward example is https://github.com/JoshuaKGoldberg/stoptalking: it uses Vite for a local dev server.

Marking as accepting PRs - thanks for the idea!

The way this would work in create-typescript-app is as an "opt-in Block". As in, it wouldn't be part of the standard presets folks use, but they'd be able to opt into using Vite instead of TSup with:

npx create-typescript-app --add-vite --exclude-tsup

A couple of recent alternate builders are:

@JoshuaKGoldberg JoshuaKGoldberg changed the title 🚀 Feature: Support Vite as build tool 🚀 Feature: Support Vite as build tool (opt-in Block) Apr 4, 2025
@JoshuaKGoldberg
Copy link
Owner

@all-contributors please add @birkskyum for ideas.

🤖 Beep boop! This comment was added automatically by all-contributors-auto-action.
Not all contributions can be detected from Git & GitHub alone. Please comment any missing contribution types this bot missed.
...and of course, thank you for contributing! 💙

Copy link
Contributor

@JoshuaKGoldberg

I've put up a pull request to add @birkskyum! 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: accepting prs Please, send a pull request to resolve this! type: feature New enhancement or request
Projects
None yet
Development

No branches or pull requests

2 participants