mirror of https://github.com/embarklabs/embark.git
Add support for ES6 plugins
This commit is contained in:
parent
2d19d12e39
commit
7e75b1eee7
|
@ -77,13 +77,17 @@ Plugin.prototype.hasContext = function(context) {
|
|||
|
||||
Plugin.prototype.loadPlugin = function() {
|
||||
if (!this.isContextValid()) {
|
||||
this.logger.warn(__('Plugin {{name}} can only be loaded in the context of "{{contextes}}"', {name: this.name, contextes: this.acceptedContext.join(', ')}));
|
||||
this.logger.warn(__('Plugin {{name}} can only be loaded in the context of "{{contexts}}"', {name: this.name, contexts: this.acceptedContext.join(', ')}));
|
||||
return false;
|
||||
}
|
||||
this.loaded = true;
|
||||
if (this.shouldInterceptLogs) {
|
||||
this.setUpLogger();
|
||||
}
|
||||
if (typeof this.pluginModule === 'object' && typeof this.pluginModule.default === 'function' && this.pluginModule.__esModule){
|
||||
this.pluginModule = this.pluginModule.default;
|
||||
return new this.pluginModule(this);
|
||||
}
|
||||
(this.pluginModule.call(this, this));
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in New Issue