p5.js-web-editor/index.js
Cassie Tarakajian 18f646bde9
for #950, update babel to v7 (#1077)
* for #950, upgrade babel to v7

* fix linting errors

* for #950, remove @babel/core from devDependencies (so it's only in dependencies) and change babel-loader config to use .babelrc

* for #950, changes to .babelrc to make  work

* for #950, include core-js modules in webpack config for IE support with babel/plugin-syntax-dynamic-import

* for #950, update babel and associated packages to LTS
2019-06-05 12:05:31 -04:00

19 lines
764 B
JavaScript

if (process.env.NODE_ENV === 'production') {
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');
} else {
let parsed = require('dotenv').config();
require('@babel/register')({
presets: ["@babel/preset-env"]
});
require('@babel/polyfill');
//// 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];
// }
// }
require('./server/server');
}