1
0
mirror of https://github.com/hakimel/reveal.js.git synced 2025-08-31 02:10:23 +02:00

vite theme build

This commit is contained in:
Hakim El Hattab
2024-10-17 19:00:37 +02:00
parent a89af36022
commit 41cca8e576
36 changed files with 1512 additions and 1562 deletions

View File

@@ -1,5 +1,13 @@
import { resolve } from 'path'
import { defineConfig } from 'vite'
import fs from 'fs';
// List all theme files in the css/theme directory
const themeFiles = fs.readdirSync(resolve(__dirname, 'css/theme')).filter(file => file.endsWith('.scss'));
const themeEntries = themeFiles.reduce((acc, file) => {
acc[`theme/${file.replace('.scss', '')}`] = resolve(__dirname, `css/theme/${file}`);
return acc;
}, {});
export default defineConfig({
root: './',
@@ -12,7 +20,7 @@ export default defineConfig({
'reveal': resolve(__dirname, 'css/reveal.scss'),
'reset': resolve(__dirname, 'css/reset.css'),
'theme/black': resolve(__dirname, 'css/theme/black.scss'),
...themeEntries,
},
}
},