Compare commits
No commits in common. "47a944fe2afc206f3da8ac9cafceb47c2fa03897" and "de0af4d2ac8c6b0e41250aa74f6cefedab93f1d3" have entirely different histories.
47a944fe2a
...
de0af4d2ac
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -13,7 +13,6 @@
|
|||
|
||||
# misc
|
||||
.DS_Store
|
||||
.env
|
||||
.env.local
|
||||
.env.development.local
|
||||
.env.test.local
|
||||
|
|
|
@ -29,7 +29,7 @@ let plugins = {}
|
|||
function loadplugin(pluginname, pluginpath) {
|
||||
try {
|
||||
plugins[pluginname] = require(pluginpath)
|
||||
plugins[pluginname].load(cfg)
|
||||
plugins[pluginname]?.load(cfg)
|
||||
} catch (error) {
|
||||
if (error.code == 'MODULE_NOT_FOUND') {
|
||||
console.warn('plugin not used:', pluginpath)
|
||||
|
@ -44,7 +44,7 @@ function unloadplugin(pluginname, pluginpath) {
|
|||
const plugin = require.resolve(pluginpath)
|
||||
try {
|
||||
if (plugin && require.cache[plugin]) {
|
||||
require.cache[plugin].exports.unload()
|
||||
require.cache[plugin].exports?.unload()
|
||||
delete plugins[pluginname]
|
||||
delete require.cache[plugin]
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user