Skip to content

Commit

Permalink
chore: 以前の開発環境(backendにアクセスする方式)を立ち上げられるように (misskey-dev#13220)
Browse files Browse the repository at this point in the history
* chore: 以前の開発環境(backendにアクセスする方式)を立ち上げられるように

* Update scripts/dev.mjs

Co-authored-by: かっこかり <67428053+kakkokari-gtyih@users.noreply.github.com>

---------

Co-authored-by: かっこかり <67428053+kakkokari-gtyih@users.noreply.github.com>
  • Loading branch information
tamaina and kakkokari-gtyih authored Feb 12, 2024
1 parent 63c4396 commit 4f80b6f
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
13 changes: 13 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,19 @@ command.
If you have not changed it from the default, it will be "http://localhost:3000".
If "port" in .config/default.yml is set to something other than 3000, you need to change the proxy settings in packages/frontend/vite.config.local-dev.ts.

### `MK_DEV_PREFER=backend pnpm dev`
pnpm dev has another mode with `MK_DEV_PREFER=backend`.

```
MK_DEV_PREFER=backend pnpm dev
```

- This mode is closer to the production environment than the default mode.
- Vite runs behind the backend (the backend will proxy Vite at /vite).
- You can see Misskey by accessing `http://localhost:3000` (Replace `3000` with the port configured with `port` in .config/default.yml).
- To change the port of Vite, specify with `VITE_PORT` environment variable.
- HMR may not work in some environments such as Windows.

### Dev Container
Instead of running `pnpm` locally, you can use Dev Container to set up your development environment.
To use Dev Container, open the project directory on VSCode with Dev Containers installed.
Expand Down
2 changes: 1 addition & 1 deletion scripts/dev.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ execa('pnpm', ['--filter', 'backend', 'dev'], {
stderr: process.stderr,
});

execa('pnpm', ['--filter', 'frontend', 'dev'], {
execa('pnpm', ['--filter', 'frontend', process.env.MK_DEV_PREFER === 'backend' ? 'dev' : 'watch'], {
cwd: _dirname + '/../',
stdout: process.stdout,
stderr: process.stderr,
Expand Down

0 comments on commit 4f80b6f

Please sign in to comment.