Files
Owen/vite.demo.config.js
Kaj Kowalski b447abee00
Some checks failed
CI/CD Pipeline / Test & Lint (16.x) (push) Has been cancelled
CI/CD Pipeline / Test & Lint (18.x) (push) Has been cancelled
CI/CD Pipeline / Test & Lint (20.x) (push) Has been cancelled
CI/CD Pipeline / Security Audit (push) Has been cancelled
CI/CD Pipeline / Release (push) Has been cancelled
Demo Deployment / Build Demo (push) Has been cancelled
Demo Deployment / Test Demo (push) Has been cancelled
Demo Deployment / Performance Audit (push) Has been cancelled
Demo Deployment / Deploy to Staging (push) Has been cancelled
Demo Deployment / Deploy to Production (push) Has been cancelled
Animation Processing Pipeline / Validate Animation Names (push) Has been cancelled
Animation Processing Pipeline / Process Blender Animation Assets (push) Has been cancelled
Multi-Scheme Testing / Validate Naming Schemes (artist) (push) Has been cancelled
Multi-Scheme Testing / Validate Naming Schemes (hierarchical) (push) Has been cancelled
Multi-Scheme Testing / Validate Naming Schemes (legacy) (push) Has been cancelled
Multi-Scheme Testing / Validate Naming Schemes (semantic) (push) Has been cancelled
Multi-Scheme Testing / Test Scheme Conversions (push) Has been cancelled
Multi-Scheme Testing / Validate Demo Functionality (push) Has been cancelled
Multi-Scheme Testing / Performance Benchmarks (push) Has been cancelled
Performance Testing / Animation Conversion Performance (100, artist) (push) Has been cancelled
Performance Testing / Animation Conversion Performance (100, hierarchical) (push) Has been cancelled
Performance Testing / Animation Conversion Performance (100, legacy) (push) Has been cancelled
Performance Testing / Animation Conversion Performance (100, semantic) (push) Has been cancelled
Performance Testing / Animation Conversion Performance (1000, artist) (push) Has been cancelled
Performance Testing / Animation Conversion Performance (1000, hierarchical) (push) Has been cancelled
Performance Testing / Animation Conversion Performance (1000, legacy) (push) Has been cancelled
Performance Testing / Animation Conversion Performance (1000, semantic) (push) Has been cancelled
Performance Testing / Animation Conversion Performance (5000, artist) (push) Has been cancelled
Performance Testing / Animation Conversion Performance (5000, hierarchical) (push) Has been cancelled
Performance Testing / Animation Conversion Performance (5000, legacy) (push) Has been cancelled
Performance Testing / Animation Conversion Performance (5000, semantic) (push) Has been cancelled
Performance Testing / Memory Usage Analysis (push) Has been cancelled
Performance Testing / Demo Performance Audit (push) Has been cancelled
Animation Processing Pipeline / Update Animation Documentation (push) Has been cancelled
Animation Processing Pipeline / Deploy Animation Demo (push) Has been cancelled
Performance Testing / Generate Performance Report (push) Has been cancelled
Implement multi-scheme animation name mapper for Owen Animation System
- Added AnimationNameMapper class to handle conversion between different animation naming schemes (legacy, artist, hierarchical, semantic).
- Included methods for initialization, pattern matching, conversion, and validation of animation names.
- Developed comprehensive unit tests for the animation name converter and demo pages using Playwright.
- Created a Vite configuration for the demo application, including asset handling and optimization settings.
- Enhanced the demo with features for batch conversion, performance metrics, and responsive design.
2025-05-24 05:20:19 +02:00

168 lines
3.8 KiB
JavaScript

import { defineConfig } from 'vite'
import path from 'path'
/**
* Vite configuration for Owen Animation System Demo
*
* This configuration builds the demo application showcasing
* the multi-scheme animation naming system and its features.
*/
export default defineConfig({
// Demo-specific build configuration
root: './demo',
build: {
outDir: '../dist-demo',
emptyOutDir: true,
// Optimization settings for demo
rollupOptions: {
input: {
main: path.resolve(__dirname, 'demo/index.html'),
examples: path.resolve(__dirname, 'demo/examples.html'),
comparison: path.resolve(__dirname, 'demo/comparison.html'),
interactive: path.resolve(__dirname, 'demo/interactive.html')
},
output: {
// Asset organization
assetFileNames: (assetInfo) => {
const info = assetInfo.name.split('.')
const ext = info[info.length - 1]
if (/png|jpe?g|svg|gif|tiff|bmp|ico/i.test(ext)) {
return 'assets/images/[name]-[hash][extname]'
}
if (/woff2?|eot|ttf|otf/i.test(ext)) {
return 'assets/fonts/[name]-[hash][extname]'
}
if (/gltf|glb|fbx/i.test(ext)) {
return 'assets/animations/[name]-[hash][extname]'
}
return 'assets/[name]-[hash][extname]'
},
chunkFileNames: 'js/[name]-[hash].js',
entryFileNames: 'js/[name]-[hash].js'
}
},
// Source maps for debugging
sourcemap: true,
// Minification
minify: 'terser',
terserOptions: {
compress: {
drop_console: false, // Keep console logs for demo
drop_debugger: true
}
},
// Target modern browsers for demo
target: 'es2020'
},
// Development server settings
server: {
port: 3001,
host: true,
open: '/demo/',
// Proxy API calls if needed
proxy: {
'/api': {
target: 'http://localhost:3000',
changeOrigin: true,
rewrite: (path) => path.replace(/^\/api/, '')
}
}
},
// Preview server settings
preview: {
port: 3002,
host: true,
open: true
},
// Resolve configuration
resolve: {
alias: {
'@': path.resolve(__dirname, 'src'),
'@demo': path.resolve(__dirname, 'demo'),
'@assets': path.resolve(__dirname, 'assets'),
'@examples': path.resolve(__dirname, 'examples')
}
},
// Define global constants for demo
define: {
__DEMO_VERSION__: JSON.stringify(process.env.npm_package_version || '1.0.0'),
__BUILD_TIMESTAMP__: JSON.stringify(new Date().toISOString()),
__ANIMATION_SCHEMES__: JSON.stringify(['legacy', 'artist', 'hierarchical', 'semantic'])
},
// Plugin configuration
plugins: [
// Add any demo-specific plugins here
],
// CSS configuration
css: {
preprocessorOptions: {
scss: {
additionalData: `
@import "@demo/styles/variables.scss";
@import "@demo/styles/mixins.scss";
`
}
},
// CSS modules for component styling
modules: {
localsConvention: 'camelCase'
}
},
// Asset handling
assetsInclude: [
'**/*.gltf',
'**/*.glb',
'**/*.fbx',
'**/*.babylon'
],
// Optimization
optimizeDeps: {
include: [
'three',
'three/examples/jsm/loaders/GLTFLoader',
'three/examples/jsm/loaders/FBXLoader',
'three/examples/jsm/controls/OrbitControls'
],
exclude: [
// Exclude any demo-specific modules that shouldn't be pre-bundled
]
},
// Environment variables
envPrefix: 'OWEN_DEMO_',
// Base path for deployment
base: process.env.NODE_ENV === 'production' ? '/Owen/' : '/',
// Worker configuration for animation processing
worker: {
format: 'es'
},
// Experimental features
experimental: {
buildAdvancedBaseOptions: true
}
})