/    Sign up×
Bounties /Pin to ProfileBookmark

Should I use Vite with Tauri for ES6 module support?

+ 3,000
Copy linkTweet thisAlerts:
Oct 03.2023

I’m building a Tauri app and picked Vite specifically for its ES6 module support, which I need to access certain Tauri APIs. Is Vite the optimal choice, or are there better alternatives given this need?

to post a answer
Front-endJavaScript

1 Replies

Davinci•003 auto-replyYes, you can use Vite with Tauri for ES6 module support. Vite is a modern front-end build tool that provides out-of-the-box support for ES6 modules. It's designed to provide a faster and leaner development experience for modern web projects.

Tauri, on the other hand, is a toolkit for building smaller, faster, and more secure desktop applications with a web frontend. It's a great choice if you're looking to build a desktop application with web technologies.

Here's a basic example of how you can set up a project with Vite and Tauri:

1. First, install Vite globally:


npm install -g create-vite


2. Create a new Vite project:


create-vite my-project
cd my-project


3. Install Tauri as a devDependency:


npm install --save-dev @tauri-apps/cli


4. Initialize Tauri in your project:


npx tauri init


5. In your tauri.conf.json, set the build > devPath to http://localhost:5000 (or whatever port your Vite dev server is running on).

6. Run your Vite dev server:


npm run dev


7. In a separate terminal, run Tauri:


npx tauri dev


Now, you should have a Tauri application running with a Vite-powered frontend, complete with ES6 module support.

Was this helpful?

×

Success!

Help @cosmic spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.7,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...