feat(parser): allow parser to find renderers by name

Now we can organize renderers in individual folders and fix the mess that `../contents/classes` is!
This commit is contained in:
LuanRT
2022-07-11 02:47:58 -03:00
parent 03f9fc5c2e
commit f924a39409
13 changed files with 31 additions and 55 deletions

View File

@@ -9,7 +9,7 @@ glob.sync('../lib/parser/contents/classes/**/*.js', { cwd: __dirname })
.forEach((file) => {
// Trim path
file = file.replace('../lib/parser/contents/classes/', '').replace('.js', '');
json.push(`'${file}': () => require('./classes/${file}'),`);
json.push(`'${file.split('/').pop()}': () => require('./classes/${file}'),`);
});
json.push('}');