perf: 프로필 프런트엔드 자산을 커밋 단위로 공유한다
정적 운영 빌드에서 프로필별 base와 API 설정을 런타임 JSON으로 분리하고, 공용 Vite 번들과 sourcemap을 한 번만 생성·게시한다. Preview와 기존 정적 artifact의 전환 호환 경계는 유지한다.
This commit is contained in:
@@ -29,6 +29,31 @@ void describe('game frontend Vite config', () => {
|
||||
assert.equal(loaded?.config.build?.sourcemap, true);
|
||||
});
|
||||
|
||||
void it('allows a profile-neutral relative asset base without changing the application base fallback', async () => {
|
||||
const previousAssetBasePath = process.env.VITE_ASSET_BASE_PATH;
|
||||
const previousAppBasePath = process.env.VITE_APP_BASE_PATH;
|
||||
process.env.VITE_ASSET_BASE_PATH = './';
|
||||
process.env.VITE_APP_BASE_PATH = '/che';
|
||||
try {
|
||||
const configPath = path.resolve(import.meta.dirname, '../vite.config.ts');
|
||||
const loaded = await loadConfigFromFile(
|
||||
{ command: 'build', mode: 'production' },
|
||||
configPath,
|
||||
path.dirname(configPath),
|
||||
undefined,
|
||||
undefined,
|
||||
'runner'
|
||||
);
|
||||
|
||||
assert.equal(loaded?.config.base, './');
|
||||
} finally {
|
||||
if (previousAssetBasePath === undefined) delete process.env.VITE_ASSET_BASE_PATH;
|
||||
else process.env.VITE_ASSET_BASE_PATH = previousAssetBasePath;
|
||||
if (previousAppBasePath === undefined) delete process.env.VITE_APP_BASE_PATH;
|
||||
else process.env.VITE_APP_BASE_PATH = previousAppBasePath;
|
||||
}
|
||||
});
|
||||
|
||||
void it('uses the deployment-pinned full commit SHA as the displayed build version', async () => {
|
||||
const commitSha = 'ABCDEF0123456789ABCDEF0123456789ABCDEF01';
|
||||
const previousCommitSha = process.env.VITE_BUILD_COMMIT_SHA;
|
||||
|
||||
Reference in New Issue
Block a user