chore: 录像调试说明 & 打包调试

This commit is contained in:
unanmed 2025-10-20 13:34:34 +08:00
parent a521699094
commit 66e60f5f15
2 changed files with 12 additions and 0 deletions

View File

@ -3,12 +3,20 @@ import { create } from './create';
import { patchAll } from '@user/data-fallback'; import { patchAll } from '@user/data-fallback';
import { loading } from '@user/data-base'; import { loading } from '@user/data-base';
import { Patch } from '@motajs/legacy-common'; import { Patch } from '@motajs/legacy-common';
import { logger } from '@motajs/common';
export function createData() { export function createData() {
createMota(); createMota();
patchAll(); patchAll();
create(); create();
if (main.replayChecking) {
logger.log(
`如果需要调试录像验证,请在 script/build-game.ts 中将 DEBUG_REPLAY 设为 true` +
`此时录像验证中可以看到完整正确的报错栈。调试完毕后,记得将它重新设为 false`
);
}
loading.once('coreInit', () => { loading.once('coreInit', () => {
Patch.patchAll(); Patch.patchAll();
}); });

View File

@ -13,6 +13,9 @@ import { RequiredData, RequiredIconsData, ResourceType } from './types';
import { splitResource, SplittedResource } from './build-resource'; import { splitResource, SplittedResource } from './build-resource';
import { formatSize } from './utils'; import { formatSize } from './utils';
/** 打包调试 */
const DEBUG_BUILD = false;
/** 录像验证调试 */
const DEBUG_REPLAY = false; const DEBUG_REPLAY = false;
const ansi = { const ansi = {
@ -52,6 +55,7 @@ async function buildClient(outDir: string) {
build: { build: {
outDir, outDir,
copyPublicDir: true, copyPublicDir: true,
minify: !DEBUG_BUILD,
rollupOptions: { rollupOptions: {
external: ['@wasm-audio-decoders/opus-ml'], external: ['@wasm-audio-decoders/opus-ml'],
output: { output: {