Set up examples folder structure

This commit is contained in:
Vanilagy
2025-05-10 17:43:18 +02:00
parent 65ff4d0106
commit 7ae47c0b23
16 changed files with 736 additions and 628 deletions
+33
View File
@@ -0,0 +1,33 @@
import { defineConfig } from 'vite';
import path from 'path';
import fs from 'fs';
const examplesDir = path.resolve(__dirname, './examples');
const exampleFolders = fs
.readdirSync(examplesDir, { withFileTypes: true })
.filter(dirent => dirent.isDirectory())
.map(dirent => dirent.name);
const rollupInput = Object.fromEntries(
exampleFolders.map(folderName => [
folderName,
path.resolve(examplesDir, folderName, 'index.html'),
]),
);
export default defineConfig({
resolve: {
alias: {
mediakit: path.resolve(__dirname, './dist/metamuxer.mjs'),
},
},
build: {
outDir: 'dist-docs', // Build them directly into the docs build folder
emptyOutDir: false,
rollupOptions: {
input: rollupInput,
},
minify: false,
},
});