forked from geosolutions-it/MapStore2
-
Notifications
You must be signed in to change notification settings - Fork 0
/
themes.js
23 lines (20 loc) · 833 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 ExtractTextPlugin = require('extract-text-webpack-plugin');
var path = require("path");
const glob = require('glob');
const extractThemesPlugin = new ExtractTextPlugin({
filename: '[name].css',
disable: process.env.NODE_ENV === "development"
});
const themeEntries = (() => {
const globPath = path.join(__dirname, "web", "client", "themes", "*");
var files = glob.sync(globPath, {mark: true});
return files.filter((f) => f.lastIndexOf('/') === f.length - 1).reduce((res, curr) => {
var finalRes = res || {};
finalRes["themes/" + path.basename(curr, path.extname(curr))] = path.join(__dirname, "web", "client", "themes", `${path.basename(curr, path.extname(curr))}`, "theme.less");
return finalRes;
}, {});
})();
module.exports = {
themeEntries,
extractThemesPlugin
};