Skip to content

Commit

Permalink
Update readme for the frontend:dev:watcher config flag.
Browse files Browse the repository at this point in the history
  • Loading branch information
BillBuilt committed Mar 26, 2022
1 parent f935574 commit 5f9de63
Showing 1 changed file with 20 additions and 3 deletions.
23 changes: 20 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,29 @@ If you try this on Windows, I would appreciate it if you'd let me know how it we

Starting with Wails version v2.0.0-beta.33 you can just use `wails dev` to start and monitor both frontend and backend changes simultaneously.

There is a new config setting for `wails.json` called `frontend:dev:watcher`. Set its value to `vite build --watch` and clear the value for `frontend:dev`.
There is a new config setting for `wails.json` called `frontend:dev:watcher`.
Im my experience it's best to set its value to an `npm run` script command that is launching `vite build --watch` rather than entering `vite build --watch` for the value.
At this point you should be able to just do `wails dev` and it will first launch the Vite watcher, then compile the app and launch it with just that one command.

I will update these templates accordingly once more time has passed and no major issues have arisen. As of this writing (March, 2022) this is a brand new feature but one I thought was worth mentioning now.
Example `frontend/package.json`:
```
"scripts": {
"vite": "vite",
"dev": "vite build --watch",
"build": "vite build",
"preview": "vite preview",
},
```

And `wails.json`:
```
"frontend:build": "npm run build",
"frontend:install": "npm install",
"frontend:dev": "",
"frontend:dev:watcher": "npm run dev",
"wailsjsdir": "./frontend",
```

More information can be found here: https://wails.io/docs/reference/project-config


## Shout-Outs
Expand Down

0 comments on commit 5f9de63

Please sign in to comment.