mirror of https://github.com/embarklabs/embark.git
chore(plugins): remove second require as it always fails
This commit is contained in:
parent
f9384733f8
commit
cb4f18c4c2
|
@ -52,27 +52,16 @@ Plugins.prototype.createPlugin = function(pluginName, pluginConfig) {
|
||||||
};
|
};
|
||||||
|
|
||||||
Plugins.prototype.loadInternalPlugin = function(pluginName, pluginConfig) {
|
Plugins.prototype.loadInternalPlugin = function(pluginName, pluginConfig) {
|
||||||
var pluginPath = fs.embarkPath('dist/lib/modules/' + pluginName);
|
const pluginPath = fs.embarkPath('dist/lib/modules/' + pluginName);
|
||||||
|
|
||||||
var plugin;
|
let plugin;
|
||||||
try {
|
plugin = require(pluginPath);
|
||||||
plugin = require(pluginPath);
|
|
||||||
|
if (plugin.default) {
|
||||||
if (plugin.default) {
|
plugin = plugin.default;
|
||||||
plugin = plugin.default;
|
|
||||||
}
|
|
||||||
} catch(e) {
|
|
||||||
try{
|
|
||||||
pluginPath = fs.embarkPath('modules/' + pluginName);
|
|
||||||
plugin = require(pluginPath);
|
|
||||||
} catch(e2) {
|
|
||||||
this.logger.error(e.message);
|
|
||||||
this.logger.error(e.stack);
|
|
||||||
throw(e2);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
var pluginWrapper = new Plugin({
|
const pluginWrapper = new Plugin({
|
||||||
name: pluginName,
|
name: pluginName,
|
||||||
pluginModule: plugin,
|
pluginModule: plugin,
|
||||||
pluginConfig: pluginConfig || {},
|
pluginConfig: pluginConfig || {},
|
||||||
|
|
Loading…
Reference in New Issue