Fix loading external plugins. (#380)
This commit is contained in:
parent
9eb9684abc
commit
481c0be897
1 changed files with 1 additions and 1 deletions
|
@ -33,7 +33,7 @@ export class Plugins {
|
|||
if (fs.existsSync(this.userPluginsPath)) {
|
||||
fs.readdirSync(this.userPluginsPath).forEach(file => {
|
||||
if (file.endsWith('.ts') || file.endsWith('.js')) {
|
||||
const plugin = require(path.join(this.userPluginsPath, file)).default;
|
||||
const plugin = require(path.join(this.userPluginsPath, file));
|
||||
file = file.replace('.ts', '').replace('.js', '');
|
||||
if (plugins[file] || plugin in plugins) {
|
||||
console.log(`[${plugin.name}] Plugin already loaded / Duplicate Class Name`);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue