forked from video-dev/hls.js
-
Notifications
You must be signed in to change notification settings - Fork 0
/
rollup.config.js
32 lines (29 loc) · 951 Bytes
/
rollup.config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
/* eslint-disable no-console */
const { configs } = require('./build-config');
module.exports = ({ configType = [] }) => {
const requestedConfigs = Array.isArray(configType)
? configType
: [configType];
let configEntries;
if (!requestedConfigs.length) {
// If no arguments are specified, return every configuration
configEntries = configs;
} else {
// Filter out enabled configs
const enabledEntries = configs.filter(([name]) =>
requestedConfigs.includes(name),
);
if (!enabledEntries.length) {
throw new Error(
`Couldn't find a valid config with the names ${JSON.stringify(
requestedConfigs,
)}. Known configs are: ${configs.map(([name]) => name).join(', ')}`,
);
}
configEntries = enabledEntries;
}
console.log(
`Building configs: ${configEntries.map(([name]) => name).join(', ')}.\n`,
);
return configEntries.map(([, config]) => config);
};