dubdiff/src/server/babel.index.js

31 lines
673 B
JavaScript
Raw Normal View History

var Path = require('path');
2016-12-28 22:44:45 +01:00
var srcRoot = Path.join(__dirname, '..')
//there should be some option for distribution / optimization?
var config = {
presets: ["node6", "react"],
2016-12-28 22:44:45 +01:00
//enable source maps for non-production instances
sourceMaps: (process.env.NODE_ENV !== "production" ? "both" : false),
//highlightCode: false,
sourceRoot: srcRoot,
only: /src/
};
require('babel-core/register')(config);
2016-12-28 22:44:45 +01:00
// Enable piping for non-production environments
if (process.env.NODE_ENV !== "production") {
if (!require("piping")({hook: true, includeModules: false})) {
return;
}
2016-12-28 22:44:45 +01:00
}
try {
require('./index.js');
}
catch (error) {
console.error(error.stack);
}