forked from misskey-dev/misskey
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: 開発モードでフロントエンドとバックエンドを独立して起動するようにする(再) (misskey-dev#12593)
* [wip]run standalone vite * [wip]run standalone vite * some fix (tabler icons, sw, streaming) * fix theme * fix run scripts * favicon * client-assets * cssの読み込み順序とCSP設定の変更 * fix lang change * fix clientManifest * baseを相対パスにしてドメイン直下とサブディレクトリ配下両方に対応 * 色々修正 * 色々修正 * 色々修正 * fix * Revert "client-assets" This reverts commit 582601e. # Conflicts: # packages/frontend/vite.config.ts * 色々修正 * fix * fix * add url and proxy to server proxy * Update packages/frontend/src/index.html * wip * Merge remote-tracking branch 'origin/develop' into feat/launch-standalone-frontend # Conflicts: # packages/frontend/src/pages/welcome.entrance.a.vue * Merge remote-tracking branch 'origin/develop' into feat/launch-standalone-frontend # Conflicts: # packages/frontend/src/pages/welcome.entrance.a.vue * fix tabler load * Apply suggestions from code review * Update packages/frontend/src/index.html * fix * fix vite.config.local-dev.ts * fix CONTRIBUTING.md --------- Co-authored-by: FruitRiin <[email protected]> Co-authored-by: osamu <[email protected]> Co-authored-by: 果物リン <[email protected]> Co-authored-by: syuilo <[email protected]> Co-authored-by: ozelot <[email protected]>
- Loading branch information
1 parent
e6d01e3
commit b0039f0
Showing
11 changed files
with
153 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
version: "3" | ||
|
||
# このconfigは、 dockerでMisskey本体を起動せず、 redisとpostgresql などだけを起動します | ||
|
||
services: | ||
redis: | ||
restart: always | ||
image: redis:7-alpine | ||
ports: | ||
- "6379:6379" | ||
volumes: | ||
- ./redis:/data | ||
healthcheck: | ||
test: "redis-cli ping" | ||
interval: 5s | ||
retries: 20 | ||
|
||
db: | ||
restart: always | ||
image: postgres:15-alpine | ||
ports: | ||
- "5432:5432" | ||
env_file: | ||
- .config/docker.env | ||
volumes: | ||
- ./db:/var/lib/postgresql/data | ||
healthcheck: | ||
test: "pg_isready -U $$POSTGRES_USER -d $$POSTGRES_DB" | ||
interval: 5s | ||
retries: 20 | ||
|
||
# meilisearch: | ||
# restart: always | ||
# image: getmeili/meilisearch:v1.3.4 | ||
# environment: | ||
# - MEILI_NO_ANALYTICS=true | ||
# - MEILI_ENV=production | ||
# env_file: | ||
# - .config/meilisearch.env | ||
# volumes: | ||
# - ./meili_data:/meili_data | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
/* | ||
* SPDX-FileCopyrightText: syuilo and other misskey contributors | ||
* SPDX-License-Identifier: AGPL-3.0-only | ||
*/ | ||
|
||
// devモードで起動される際(index.htmlを使うとき)はrouterが暴発してしまってうまく読み込めない。 | ||
// よって、devモードとして起動されるときはビルド時に組み込む形としておく。 | ||
// (pnpm start時はpugファイルの中で静的リソースとして読み込むようになっており、この問題は起こっていない) | ||
import '@tabler/icons-webfont/tabler-icons.scss'; | ||
|
||
import('@/_boot_.js'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
<!-- | ||
SPDX-FileCopyrightText: syuilo and other misskey contributors | ||
SPDX-License-Identifier: AGPL-3.0-only | ||
--> | ||
|
||
<!-- | ||
開発モードのviteはこのファイルを起点にサーバーを起動します。 | ||
このファイルに書かれた [t]js のリンクと (s)cssのリンクと、その依存関係にあるファイルはビルドされます | ||
--> | ||
|
||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<meta charset="UTF-8" /> | ||
<title>misskey</title> | ||
<!-- https://developer.mozilla.org/en-US/docs/Web/HTTP/CSP --> | ||
<meta | ||
http-equiv="Content-Security-Policy" | ||
content="default-src 'self'; | ||
script-src 'self'; | ||
style-src 'self' 'unsafe-inline'; | ||
img-src 'self' data: www.google.com xn--931a.moe localhost:3000 localhost:5137 127.0.0.1:5173 127.0.0.1:3000" | ||
/> | ||
</head> | ||
|
||
<body> | ||
<div id="app"></div> | ||
<script type="module" src="./_dev_boot_.ts"></script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
import dns from 'dns'; | ||
import { defineConfig } from 'vite'; | ||
import { getConfig } from './vite.config.js'; | ||
|
||
dns.setDefaultResultOrder('ipv4first'); | ||
|
||
const defaultConfig = getConfig(); | ||
|
||
const devConfig = { | ||
// 基本の設定は vite.config.js から引き継ぐ | ||
...defaultConfig, | ||
root: 'src', | ||
publicDir: '../assets', | ||
base: './', | ||
server: { | ||
host: 'localhost', | ||
port: 5173, | ||
proxy: { | ||
'/api': { | ||
changeOrigin: true, | ||
target: 'http://localhost:3000/', | ||
}, | ||
'/assets': 'http://localhost:3000/', | ||
'/files': 'http://localhost:3000/', | ||
'/twemoji': 'http://localhost:3000/', | ||
'/fluent-emoji': 'http://localhost:3000/', | ||
'/sw.js': 'http://localhost:3000/', | ||
'/streaming': { | ||
target: 'ws://localhost:3000/', | ||
ws: true, | ||
}, | ||
'/favicon.ico': 'http://localhost:3000/', | ||
'/identicon': { | ||
target: 'http://localhost:3000/', | ||
rewrite(path) { | ||
return path.replace('@localhost:5173', ''); | ||
}, | ||
}, | ||
'/url': 'http://localhost:3000', | ||
'/proxy': 'http://localhost:3000', | ||
}, | ||
}, | ||
build: { | ||
...defaultConfig.build, | ||
rollupOptions: { | ||
...defaultConfig.build?.rollupOptions, | ||
input: 'index.html', | ||
}, | ||
}, | ||
}; | ||
|
||
export default defineConfig(({ command, mode }) => devConfig); | ||
|