Allows exports.default in plugins

This commit is contained in:
Zack Rauen 2020-10-20 14:38:40 -04:00
parent 37cec0ef7e
commit ac8e5fefee
1 changed files with 1 additions and 1 deletions

View File

@ -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;