From dceff0d4cfe8e8581dca465a6a674fea117ba8c9 Mon Sep 17 00:00:00 2001 From: Cassie Tarakajian Date: Fri, 4 May 2018 14:26:20 -0700 Subject: [PATCH] include webpack babel file in server for possible isomorphic stuff in the future --- index.js | 14 ++++++++++++-- webpack.config.babel.js | 2 +- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/index.js b/index.js index 887b2dc6..e8b25418 100644 --- a/index.js +++ b/index.js @@ -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) { diff --git a/webpack.config.babel.js b/webpack.config.babel.js index 6ad8a01d..f19cc4b0 100644 --- a/webpack.config.babel.js +++ b/webpack.config.babel.js @@ -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', }, ],