From ac8e5fefee7025658b1f75eb415353ea7aaec134 Mon Sep 17 00:00:00 2001 From: Zack Rauen Date: Tue, 20 Oct 2020 14:38:40 -0400 Subject: [PATCH] Allows exports.default in plugins --- src/modules/pluginmanager.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/modules/pluginmanager.js b/src/modules/pluginmanager.js index 220c15d0..fad1991f 100644 --- a/src/modules/pluginmanager.js +++ b/src/modules/pluginmanager.js @@ -92,7 +92,7 @@ export default new class PluginManager extends AddonManager { } getFileModification(module, fileContent, meta) { - fileContent += `\nif (!module.exports || !module.exports.prototype || !module.exports.prototype.start) {module.exports = ${meta.exports || meta.name};}`; + fileContent += `\nif (module.exports.default) {module.exports = module.exports.default;}\nif (!module.exports.prototype || !module.exports.prototype.start) {module.exports = ${meta.exports || meta.name};}`; module._compile(fileContent, module.filename); meta.exports = module.exports; module.exports = meta;