Files
Curse/scripts/build-assets.mjs
かっこかり edf5094c1b enhance(backend): pugをやめ、JSXベースのテンプレートに変更 (to misskey-dev dev branch) (#16889)
* wip

* wip

* wip

* wip

* fix lint

* attempt to fix test

* fix

* fix

* fix: oauthページの描画がおかしい問題を修正

* typo [ci skip]

* fix

* fix

* fix

* fix

* fix

* refactor

* fix

* fix

* fix broken lockfile

* fix: expose supported languages as global variable

* remove i18n package from root as it is no longer required [ci skip]

* fix
2025-11-30 17:54:40 +09:00

35 lines
1.1 KiB
JavaScript

/*
* SPDX-FileCopyrightText: syuilo and misskey-project
* SPDX-License-Identifier: AGPL-3.0-only
*/
import * as fs from 'node:fs/promises';
import * as path from 'node:path';
import { fileURLToPath } from 'node:url';
import * as yaml from 'js-yaml';
import buildTarball from './tarball.mjs';
const configDir = fileURLToPath(new URL('../.config', import.meta.url));
const configPath = process.env.MISSKEY_CONFIG_YML
? path.resolve(configDir, process.env.MISSKEY_CONFIG_YML)
: process.env.NODE_ENV === 'test'
? path.resolve(configDir, 'test.yml')
: path.resolve(configDir, 'default.yml');
async function loadConfig() {
return fs.readFile(configPath, 'utf-8').then(data => yaml.load(data)).catch(() => null);
}
async function copyFrontendFonts() {
await fs.cp('./packages/frontend/node_modules/three/examples/fonts', './built/_frontend_dist_/fonts', { dereference: true, recursive: true });
}
async function build() {
await Promise.all([
copyFrontendFonts(),
loadConfig().then(config => config?.publishTarballInsteadOfProvideRepositoryUrl && buildTarball()),
]);
}
await build();