Testing Tauri with Vite, React, Typescript
By ZikXewen. Inspired by elibro.
-
Clone or Follow the instructions in Template branch.
-
Make some changes to
src-tauri/tauri.config.json
to minimize the size of our bundle."allowlist": { "notification": { "all": true } }
-
Add tailwind and tailwind-scrollbar plugin.
yarn add -D tailwindcss postcss autoprefixer tailwind-scrollbar npx tailwindcss init -p
-
Configure
tailwind.config.js
module.exports = { content: ['index.html', './src/**/*.tsx'], theme: { extend: {}, }, plugins: [require('tailwind-scrollbar')], }
-
Reformat the whole
src
directory. Apart fromsrc/vite-env.d.ts
-
src/index.css
enables tailwind. Imported bysrc/main.tsx
-
src/App.tsx
contains examples of Tauri's notification API and Tailwind.
-