mirror of
https://gitea.com/gitea/docs.git
synced 2026-07-22 02:37:42 +00:00
add 'make watch-frontend' and expand docs (#10931)
* add 'make watch-frontend' and expand docs * add bindata note * add .PHONY Co-authored-by: guillep2k <18600385+guillep2k@users.noreply.github.com>
This commit is contained in:
@@ -128,10 +128,28 @@ make revive vet misspell-check
|
|||||||
|
|
||||||
### Working on JS and CSS
|
### Working on JS and CSS
|
||||||
|
|
||||||
Edit files in `web_src` and run the linter and build the files in `public`:
|
For simple changes, edit files in `web_src`, run the build and start the server to test:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
make webpack
|
make build && ./gitea
|
||||||
|
```
|
||||||
|
|
||||||
|
For more involved changes use the `watch-frontend` task to continuously rebuild files when their sources change. The `bindata` tag must be absent to ensure the file system will be used for files in `public`. First, build and run the backend:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
make backend && ./gitea
|
||||||
|
```
|
||||||
|
|
||||||
|
With the backend running, open another terminal and run:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
make watch-frontend
|
||||||
|
```
|
||||||
|
|
||||||
|
Before committing, make sure the linters pass:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
make lint-frontend
|
||||||
```
|
```
|
||||||
|
|
||||||
Note: When working on frontend code, it is advisable to set `USE_SERVICE_WORKER` to `false` in `app.ini` which will prevent undesirable caching of frontend assets.
|
Note: When working on frontend code, it is advisable to set `USE_SERVICE_WORKER` to `false` in `app.ini` which will prevent undesirable caching of frontend assets.
|
||||||
|
|||||||
Reference in New Issue
Block a user