mirror of
https://github.com/embarklabs/embark.git
synced 2025-01-11 14:24:24 +00:00
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() {
|
Plugin.prototype.loadPlugin = function() {
|
||||||
if (!this.isContextValid()) {
|
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;
|
return false;
|
||||||
}
|
}
|
||||||
this.loaded = true;
|
this.loaded = true;
|
||||||
if (this.shouldInterceptLogs) {
|
if (this.shouldInterceptLogs) {
|
||||||
this.setUpLogger();
|
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));
|
(this.pluginModule.call(this, this));
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user