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:
@@ -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,
|
||||
},
|
||||
}
|
||||
},
|
||||
|
Reference in New Issue
Block a user