- Set up Vitest for unit testing with jsdom - Add test setup with Web Audio API and requestAnimationFrame mocks - Create initial test suites for DOM and animations modules - Add test scripts to package.json (test, test:ui, test:run, coverage) - Update CI workflow to include test execution - Create CONTRIBUTING.md with conventional commits guidelines - Create SECURITY.md with security policy - Update ESLint config to support test files - All tests passing (8/8) Co-authored-by: ZaneThePython <102631678+ZaneThePython@users.noreply.github.com>
50 lines
1.1 KiB
JavaScript
50 lines
1.1 KiB
JavaScript
import { defineConfig } from 'vite';
|
|
import { resolve } from 'path';
|
|
|
|
export default defineConfig({
|
|
root: '.',
|
|
build: {
|
|
outDir: 'dist',
|
|
assetsDir: 'assets',
|
|
minify: 'terser',
|
|
terserOptions: {
|
|
compress: {
|
|
drop_console: true,
|
|
drop_debugger: true,
|
|
},
|
|
},
|
|
rollupOptions: {
|
|
input: {
|
|
main: resolve(__dirname, 'index.html'),
|
|
},
|
|
output: {
|
|
assetFileNames: (assetInfo) => {
|
|
let extType = assetInfo.name.split('.').at(1);
|
|
if (/png|jpe?g|svg|gif|tiff|bmp|ico/i.test(extType)) {
|
|
extType = 'images';
|
|
}
|
|
if (/css/i.test(extType)) {
|
|
extType = 'css';
|
|
}
|
|
return `assets/${extType}/[name]-[hash][extname]`;
|
|
},
|
|
chunkFileNames: 'assets/js/[name]-[hash].js',
|
|
entryFileNames: 'assets/js/[name]-[hash].js',
|
|
},
|
|
},
|
|
},
|
|
server: {
|
|
port: 5173,
|
|
open: true,
|
|
},
|
|
test: {
|
|
globals: true,
|
|
environment: 'jsdom',
|
|
setupFiles: './tests/setup.js',
|
|
coverage: {
|
|
reporter: ['text', 'html'],
|
|
exclude: ['node_modules/', 'dist/', 'tests/'],
|
|
},
|
|
},
|
|
});
|