2018-05-04 23:26:20 +02:00
|
|
|
let parsed = require('dotenv').config();
|
2016-11-09 00:11:12 +01:00
|
|
|
if (process.env.NODE_ENV === 'production') {
|
2018-05-04 22:36:59 +02:00
|
|
|
process.env.webpackAssets = JSON.stringify(require('./dist/static/manifest.json'));
|
|
|
|
process.env.webpackChunkAssets = JSON.stringify(require('./dist/static/chunk-manifest.json'));
|
|
|
|
require('./dist/server.bundle.js');
|
2018-05-04 02:20:40 +02:00
|
|
|
} else {
|
2018-05-04 23:26:20 +02:00
|
|
|
require('babel-register')({
|
|
|
|
"plugins": [
|
|
|
|
[
|
|
|
|
"babel-plugin-webpack-loaders",
|
|
|
|
{
|
|
|
|
"config": "./webpack.config.babel.js",
|
|
|
|
"verbose": false
|
|
|
|
}
|
|
|
|
]
|
|
|
|
]
|
|
|
|
});
|
2018-05-04 02:20:40 +02:00
|
|
|
require('babel-polyfill');
|
|
|
|
//// in development, let .env values override those in the environment already (i.e. in docker-compose.yml)
|
|
|
|
if (process.env.NODE_ENV === 'development') {
|
|
|
|
for (let key in parsed) {
|
|
|
|
process.env[key] = parsed[key];
|
|
|
|
}
|
2017-12-13 20:56:24 +01:00
|
|
|
}
|
2018-05-04 02:20:40 +02:00
|
|
|
require('./server/server');
|
2017-12-13 20:56:24 +01:00
|
|
|
}
|