p5.js-web-editor/index.js

19 lines
667 B
JavaScript
Raw Normal View History

if (process.env.NODE_ENV === 'production') {
process.env.webpackAssets = JSON.stringify(require('./dist/static/manifest.json'));
require('./dist/server.bundle.js');
2018-05-04 02:20:40 +02:00
} else {
2018-06-07 23:49:17 +02:00
let parsed = require('dotenv').config();
require('@babel/register')({
presets: ["@babel/preset-env"]
});
require('@babel/polyfill');
2018-05-04 02:20:40 +02:00
//// in development, let .env values override those in the environment already (i.e. in docker-compose.yml)
// so commenting this out makes the docker container work.
// if (process.env.NODE_ENV === 'development') {
// for (let key in parsed) {
// process.env[key] = parsed[key];
// }
// }
2018-05-04 02:20:40 +02:00
require('./server/server');
}