aboutsummaryrefslogtreecommitdiffstats
path: root/config/webpack/utils/scripts.js
blob: 21967370970f5fd0cf3af409b2d6193f5797e7ad (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
const path = require("path");
const scripts = require(path.resolve(SOURCE_DIR, "scripts.json"));

const formattedScripts = {};

for (const scriptType in scripts) {
	const currentScripts = scripts[scriptType];
	for (const scriptName in currentScripts) {
		const scriptPath = currentScripts[scriptName];
		formattedScripts[scriptPath] = formattedScripts[scriptPath] || {};
		formattedScripts[scriptPath][scriptType] = formattedScripts[scriptPath][scriptType] || [];
		formattedScripts[scriptPath][scriptType].push(scriptName);
	}
}

module.exports = formattedScripts;