1
0
Fork 0
mirror of https://github.com/jellyfin/jellyfin-web synced 2025-03-30 19:56:21 +00:00

Lookup themes dynamically

This commit is contained in:
Bill Thornton 2025-03-25 15:36:32 -04:00
parent a768ca3037
commit fe6b43d586
5 changed files with 17 additions and 32 deletions

View file

@ -1,3 +1,4 @@
const fg = require('fast-glob');
const path = require('path');
const { CleanWebpackPlugin } = require('clean-webpack-plugin');
const CopyPlugin = require('copy-webpack-plugin');
@ -33,9 +34,19 @@ try {
const NODE_MODULES_REGEX = /[\\/]node_modules[\\/]/;
const THEMES = fg.globSync('themes/**/*.scss', { cwd: path.resolve(__dirname, 'src') });
const THEMES_BY_ID = THEMES.reduce((acc, theme) => {
acc[theme.substring(0, theme.lastIndexOf('/'))] = `./${theme}`;
return acc;
}, {});
const config = {
context: path.resolve(__dirname, 'src'),
target: 'browserslist',
entry: {
'main.jellyfin': './index.jsx',
...THEMES_BY_ID
},
resolve: {
extensions: ['.tsx', '.ts', '.js'],
modules: [