ZikXewen / tauri-test

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Tauri-React Test

Testing Tauri with Vite, React, Typescript

By ZikXewen. Inspired by elibro.

How Did We Get Here?

  1. Clone or Follow the instructions in Template branch.

  2. Make some changes to src-tauri/tauri.config.json to minimize the size of our bundle.

    "allowlist": {
       "notification": {
          "all": true
       }
    }
    
  3. Add tailwind and tailwind-scrollbar plugin.

    yarn add -D tailwindcss postcss autoprefixer tailwind-scrollbar
    npx tailwindcss init -p
    
  4. Configure tailwind.config.js

    module.exports = {
       content: ['index.html', './src/**/*.tsx'],
       theme: {
          extend: {},
       },
       plugins: [require('tailwind-scrollbar')],
    }
    
  5. Reformat the whole src directory. Apart from src/vite-env.d.ts

    • src/index.css enables tailwind. Imported by src/main.tsx

    • src/App.tsx contains examples of Tauri's notification API and Tailwind.

About

License:MIT License


Languages

Language:TypeScript 52.4%Language:HTML 18.8%Language:Rust 14.1%Language:JavaScript 11.6%Language:CSS 3.1%