tauri icon indicating copy to clipboard operation
tauri copied to clipboard

Build Vite Project !!

Open quyphuc2111 opened this issue 1 year ago • 1 comments

Hello Tauri devs,

I'm working on a Tauri application in the release folder. I need to execute the command: .\Scorm-BKT.exe --i="D:\bkt-workspace\ScormProject\tauri-app\src-tauri\public\data.json".

In my Tauri app, I've successfully implemented the functionality to read data from a JSON file. Now, I want to integrate a feature where clicking a button in the frontend triggers the build process for a Vite project. This build process should export an HTML file based on the data read from the JSON file.

Can you assist me with achieving this?

I'm working on React + Vite + Tauri + Tailwind

Thank you!

quyphuc2111 avatar May 10 '24 03:05 quyphuc2111

Using only JavaScript or TypeScript might not be sufficient for this task. You can attempt to execute commands and retrieve their output using Rust's standard library std::process::Command. The output can then be passed to the frontend via an event using window.emit.

thep0y avatar May 10 '24 14:05 thep0y

or use the JS Command api, see https://tauri.app/v1/api/js/shell#command

amrbashir avatar May 13 '24 17:05 amrbashir