embark/lib/index.js

25 lines
676 B
JavaScript
Raw Normal View History

2017-03-30 13:16:46 +00:00
let version = require('../package.json').version;
2017-03-31 11:34:43 +00:00
class Embark {
2017-03-30 13:16:46 +00:00
constructor(options) {
2017-03-30 13:16:46 +00:00
this.version = version;
this.options = options || {};
}
2017-03-30 11:12:39 +00:00
2017-03-30 13:16:46 +00:00
initConfig(env, options) {
let Events = require('./core/events.js');
let Logger = require('./core/logger.js');
let Config = require('./core/config.js');
2017-03-30 11:12:39 +00:00
2017-03-30 13:16:46 +00:00
this.events = new Events();
this.logger = new Logger({logLevel: 'debug', events: this.events, context: this.context});
2017-03-30 13:16:46 +00:00
this.config = new Config({env: env, logger: this.logger, events: this.events, context: this.context});
2017-03-30 11:12:39 +00:00
this.config.loadConfigFiles(options);
this.plugins = this.config.plugins;
2017-03-30 13:16:46 +00:00
}
}
2016-08-18 00:29:41 +00:00
module.exports = Embark;