Add arrangement demo site from original project
Copies the multi-page demo app (Providers → Packages → Comparison flow) with Zustand basket state, URL sync, and per-slice Vite build config. All pages render correctly on React 19 + MUI v7 with zero code changes needed. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
41
vite.demo.config.ts
Normal file
41
vite.demo.config.ts
Normal file
@@ -0,0 +1,41 @@
|
||||
import { defineConfig } from 'vite';
|
||||
import react from '@vitejs/plugin-react';
|
||||
import path from 'path';
|
||||
|
||||
/**
|
||||
* Per-slice demo build. Slice name comes from `--mode <name>` and selects
|
||||
* the app folder, base path, and output directory.
|
||||
*
|
||||
* Dev: vite -c vite.demo.config.ts --mode arrangement
|
||||
* Build: vite build -c vite.demo.config.ts --mode arrangement
|
||||
* → dist-demo/arrangement/
|
||||
*/
|
||||
export default defineConfig(({ mode, command }) => {
|
||||
const slice = mode;
|
||||
const appRoot = path.resolve(__dirname, `src/demo/apps/${slice}`);
|
||||
|
||||
return {
|
||||
root: appRoot,
|
||||
envDir: __dirname,
|
||||
base: command === 'build' ? `/${slice}/` : '/',
|
||||
publicDir: path.resolve(__dirname, 'brandassets'),
|
||||
plugins: [react()],
|
||||
resolve: {
|
||||
alias: {
|
||||
'@atoms': path.resolve(__dirname, 'src/components/atoms'),
|
||||
'@molecules': path.resolve(__dirname, 'src/components/molecules'),
|
||||
'@organisms': path.resolve(__dirname, 'src/components/organisms'),
|
||||
'@theme': path.resolve(__dirname, 'src/theme'),
|
||||
},
|
||||
},
|
||||
build: {
|
||||
outDir: path.resolve(__dirname, `dist-demo/${slice}`),
|
||||
emptyOutDir: true,
|
||||
sourcemap: true,
|
||||
},
|
||||
server: {
|
||||
port: 5180,
|
||||
open: false,
|
||||
},
|
||||
};
|
||||
});
|
||||
Reference in New Issue
Block a user