fix(deploy): use ASCII player assets and harden Docker Linux builds
Rename Chinese public paths and image filenames so Vite builds succeed on Linux, strip legacy public dirs in Dockerfiles, and document clean redeploy steps. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
16
pack.mjs
16
pack.mjs
@@ -5,7 +5,7 @@
|
||||
* 输出: release/thebet365-deploy-YYYYMMDD-HHmmss.zip
|
||||
*/
|
||||
import { execSync } from 'node:child_process';
|
||||
import { mkdirSync, statSync } from 'node:fs';
|
||||
import { existsSync, mkdirSync, readdirSync, rmSync, statSync } from 'node:fs';
|
||||
import { basename, join } from 'node:path';
|
||||
|
||||
const root = process.cwd();
|
||||
@@ -42,6 +42,20 @@ const excludePaths = [
|
||||
|
||||
mkdirSync(outDir, { recursive: true });
|
||||
|
||||
const sharedPublic = join(root, 'packages/shared/public');
|
||||
const playersDir = join(sharedPublic, 'players');
|
||||
if (!existsSync(playersDir)) {
|
||||
console.error('Missing packages/shared/public/players — player avatars not migrated.');
|
||||
process.exit(1);
|
||||
}
|
||||
for (const name of readdirSync(sharedPublic, { withFileTypes: true })) {
|
||||
if (!name.isDirectory()) continue;
|
||||
if (name.name === 'flags' || name.name === 'players') continue;
|
||||
const legacy = join(sharedPublic, name.name);
|
||||
rmSync(legacy, { recursive: true, force: true });
|
||||
console.log(`Removed legacy public dir: ${name.name}`);
|
||||
}
|
||||
|
||||
const excludeArgs = excludePaths
|
||||
.map((p) => `--exclude=${projectName}/${p}`)
|
||||
.join(' ');
|
||||
|
||||
Reference in New Issue
Block a user