forked from Vanilagy/mediabunny
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathvite.config.ts
More file actions
45 lines (41 loc) · 1.12 KB
/
Copy pathvite.config.ts
File metadata and controls
45 lines (41 loc) · 1.12 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
import { defineConfig } from 'vite';
import path from 'path';
import fs from 'fs';
import tailwindcss from '@tailwindcss/vite';
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: {
'mediabunny': path.resolve(__dirname, './dist/bundles/mediabunny.mjs'),
'@mediabunny/aac-encoder':
path.resolve(__dirname, './packages/aac-encoder/dist/bundles/mediabunny-aac-encoder.mjs'),
'@mediabunny/flac-encoder':
path.resolve(__dirname, './packages/flac-encoder/dist/bundles/mediabunny-flac-encoder.mjs'),
},
},
plugins: [
tailwindcss(),
],
server: {
hmr: false,
allowedHosts: true,
},
build: {
outDir: 'dist-docs', // Build them directly into the docs build folder
emptyOutDir: false,
rollupOptions: {
input: rollupInput,
},
minify: false,
},
});