include webpack babel file in server for possible isomorphic stuff in the future

This commit is contained in:
Cassie Tarakajian 2018-05-04 14:26:20 -07:00
parent 257ee24b90
commit dceff0d4cf
2 changed files with 13 additions and 3 deletions

View file

@ -1,11 +1,21 @@
let parsed = require('dotenv').config();
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 {
require('babel-register');
require('babel-register')({
"plugins": [
[
"babel-plugin-webpack-loaders",
{
"config": "./webpack.config.babel.js",
"verbose": false
}
]
]
});
require('babel-polyfill');
let parsed = require('dotenv').config();
//// 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) {

View file

@ -26,7 +26,7 @@ module.exports = {
})
},
{
test: /\.jpe?g$|\.gif$|\.png$|\.svg$/i,
test: /\.jpe?g$|\.gif$|\.png$|\.svg$|\.mp3$|\.eot$|\.ttf$|\.woff$|\.woff2$/i,
loader: 'url-loader?limit=10000',
},
],