embedのbootエントリーポイントを分離

This commit is contained in:
kakkokari-gtyih
2024-06-07 16:50:13 +09:00
parent bd0b7f90cf
commit 29033bd460
8 changed files with 65 additions and 36 deletions

View File

@@ -161,6 +161,7 @@ export type Config = {
driveUrl: string;
userAgent: string;
clientEntry: string;
clientEmbedEntry: string;
clientManifestExists: boolean;
mediaProxy: string;
externalMediaProxyEnabled: boolean;
@@ -199,7 +200,7 @@ export function loadConfig(): Config {
const clientManifestExists = fs.existsSync(_dirname + '/../../../built/_vite_/manifest.json');
const clientManifest = clientManifestExists ?
JSON.parse(fs.readFileSync(`${_dirname}/../../../built/_vite_/manifest.json`, 'utf-8'))
: { 'src/_boot_.ts': { file: 'src/_boot_.ts' } };
: { 'src/_boot_.ts': { file: 'src/_boot_.ts' }, 'src/_embed_boot_.ts': { file: 'src/_embed_boot_.ts' } };
const config = yaml.load(fs.readFileSync(path, 'utf-8')) as Source;
const url = tryCreateUrl(config.url);
@@ -267,6 +268,7 @@ export function loadConfig(): Config {
: null,
userAgent: `Misskey/${version} (${config.url})`,
clientEntry: clientManifest['src/_boot_.ts'],
clientEmbedEntry: clientManifest['src/_embed_boot_.ts'],
clientManifestExists: clientManifestExists,
perChannelMaxNoteCacheCount: config.perChannelMaxNoteCacheCount ?? 1000,
perUserNotificationsMaxCount: config.perUserNotificationsMaxCount ?? 500,

View File

@@ -1,7 +1,7 @@
block vars
block loadClientEntry
- const clientEntry = config.clientEntry;
- const clientEntry = embed ? config.clientEmbedEntry : config.clientEntry;
doctype html