Scaffold Vite + TypeScript + Three.js (scène vide : sol + boîte, marqueur de build), store et encodage de l'état dans l'URL (5 tests), lint de frontières entre modules, pipeline d'extraction Rhino (graine du 26/09) et première géométrie v0, deploy.sh statique (releases + lien symbolique + smoke), AGENTS.md, RUNBOOK, licences MIT + CC BY-SA 4.0. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
43 lines
1.1 KiB
TypeScript
43 lines
1.1 KiB
TypeScript
import { defineConfig } from 'vite';
|
|
import { execSync } from 'node:child_process';
|
|
|
|
// Marqueur de build : hash git court, injecté dans la page et dans /build.json.
|
|
// Un HTTP 200 ne valide rien ; le marqueur, si.
|
|
function hashGit(): string {
|
|
try {
|
|
return execSync('git rev-parse --short HEAD', { stdio: ['ignore', 'pipe', 'ignore'] }).toString().trim();
|
|
} catch {
|
|
return 'sans-git';
|
|
}
|
|
}
|
|
|
|
const BUILD_HASH = process.env.QUARTIER_BUILD_HASH ?? hashGit();
|
|
|
|
export default defineConfig({
|
|
base: '/',
|
|
define: { __BUILD_HASH__: JSON.stringify(BUILD_HASH) },
|
|
build: {
|
|
target: 'es2022',
|
|
sourcemap: false,
|
|
// Budget V1 : < 5 Mo transférés en démo, < 1,5 Mo en ambiance (ARCHITECTURE §1 bis).
|
|
chunkSizeWarningLimit: 900,
|
|
rollupOptions: {
|
|
output: {
|
|
manualChunks: { three: ['three'] },
|
|
},
|
|
},
|
|
},
|
|
plugins: [
|
|
{
|
|
name: 'quartier-build-json',
|
|
generateBundle() {
|
|
this.emitFile({
|
|
type: 'asset',
|
|
fileName: 'build.json',
|
|
source: JSON.stringify({ hash: BUILD_HASH, date: new Date().toISOString() }),
|
|
});
|
|
},
|
|
},
|
|
],
|
|
});
|