mirror of
https://github.com/mediacms-io/mediacms.git
synced 2025-11-08 00:18:54 -05:00
* Added frontend development files/environment * More items-categories related removals * Improvements in pages templates (inc. static pages) * Improvements in video player * Added empty home page message + cta * Updates in media, playlist and management pages * Improvements in material icons font loading * Replaced media & playlists links in frontend dev-env * frontend package version update * chnaged frontend dev url port * static files update * Changed default position of theme switcher * enabled frontend docker container
95 lines
1.9 KiB
JavaScript
95 lines
1.9 KiB
JavaScript
const fs = require('fs');
|
|
const path = require('path');
|
|
|
|
function validateDevOptions(options) {
|
|
if (void 0 !== options.config) {
|
|
if ('string' !== typeof options.config) {
|
|
throw Error('Invalid configuration file: ' + options.config);
|
|
}
|
|
|
|
options.config = path.resolve(options.config);
|
|
|
|
if (!fs.existsSync(options.config)) {
|
|
throw Error('Invalid configuration file: ' + options.config);
|
|
}
|
|
|
|
options.config = require(path.resolve(options.config));
|
|
}
|
|
|
|
if (void 0 !== options.env) {
|
|
// TODO!
|
|
}
|
|
|
|
if (void 0 !== options.host) {
|
|
// TODO!
|
|
}
|
|
|
|
if (void 0 !== options.port) {
|
|
// TODO!
|
|
}
|
|
|
|
return options;
|
|
}
|
|
|
|
function validateBuildOptions(options) {
|
|
if (void 0 !== options.config) {
|
|
if ('string' !== typeof options.config) {
|
|
throw Error('Invalid configuration file: ' + options.config);
|
|
}
|
|
|
|
options.config = path.resolve(options.config);
|
|
|
|
if (!fs.existsSync(options.config)) {
|
|
throw Error('Invalid configuration file: ' + options.config);
|
|
}
|
|
|
|
options.config = require(path.resolve(options.config));
|
|
}
|
|
|
|
if (void 0 !== options.env) {
|
|
// TODO!
|
|
}
|
|
|
|
return options;
|
|
}
|
|
|
|
function validateAnalyzerOptions(options) {
|
|
if (void 0 !== options.config) {
|
|
if ('string' !== typeof options.config) {
|
|
throw Error('Invalid configuration file: ' + options.config);
|
|
}
|
|
|
|
options.config = path.resolve(options.config);
|
|
|
|
if (!fs.existsSync(options.config)) {
|
|
throw Error('Invalid configuration file: ' + options.config);
|
|
}
|
|
|
|
options.config = require(path.resolve(options.config));
|
|
}
|
|
|
|
if (void 0 !== options.env) {
|
|
// TODO!
|
|
}
|
|
|
|
if (void 0 !== options.host) {
|
|
// TODO!
|
|
}
|
|
|
|
if (void 0 !== options.port) {
|
|
// TODO!
|
|
}
|
|
|
|
if (void 0 !== options.mode) {
|
|
// TODO!
|
|
}
|
|
|
|
return options;
|
|
}
|
|
|
|
module.exports = {
|
|
validateDevOptions,
|
|
validateBuildOptions,
|
|
validateAnalyzerOptions,
|
|
};
|