var app = require('app');
var fs = require('fs');
var babel = require('babel-core');

function loadFile(module, filePath) {
  var sourceCode = fs.readFileSync(filePath, 'utf8');
  var result = babel.transform(sourceCode, options);
  return module._compile(result.code, filePath);
}

app.on('ready', function() {
  Object.defineProperty(require.extensions, '.js', {
    writable: false,
    value: loadFile
  });

  require('./main')();
});
