forked from georchestra/mapstore2-georchestra
-
Notifications
You must be signed in to change notification settings - Fork 0
/
themes.js
23 lines (20 loc) · 753 Bytes
/
themes.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
const MiniCssExtractPlugin = require("mini-css-extract-plugin");
var path = require("path");
const glob = require('glob');
const extractThemesPlugin = new MiniCssExtractPlugin({
filename: '[name].css'
});
const themeEntries = (() => {
const globPath = path.join(__dirname, "themes", "*");
var files = glob.sync(globPath, {mark: true});
return files.filter((f) => f.lastIndexOf('/') === f.length - 1).reduce((res, curr) => {
var finalRes = res || {};
var themeName = path.basename(curr, path.extname(curr));
finalRes["themes/" + themeName] = path.join(__dirname, "themes", `${themeName}`, "theme.less");
return finalRes;
}, {});
})();
module.exports = {
themeEntries,
extractThemesPlugin
};